merge: integrate remote token rotation + memory pipeline

Merge remote main (token rotation, usage API, dashboard fixes)
with local memory pipeline changes. Smart quote encoding fixed.
Test alignment pending.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Eyejoker
2026-03-24 03:53:15 +09:00
22 changed files with 2356 additions and 691 deletions

View File

@@ -9,7 +9,7 @@
"start": "node dist/index.js"
},
"dependencies": {
"@anthropic-ai/claude-agent-sdk": "^0.2.76",
"@anthropic-ai/claude-agent-sdk": "^0.2.81",
"@modelcontextprotocol/sdk": "^1.12.1",
"cron-parser": "^5.0.0",
"zod": "^4.0.0"

View File

@@ -9,8 +9,8 @@ importers:
.:
dependencies:
'@anthropic-ai/claude-agent-sdk':
specifier: ^0.2.76
version: 0.2.76(zod@4.3.6)
specifier: ^0.2.81
version: 0.2.81(zod@4.3.6)
'@modelcontextprotocol/sdk':
specifier: ^1.12.1
version: 1.27.1(zod@4.3.6)
@@ -30,8 +30,8 @@ importers:
packages:
'@anthropic-ai/claude-agent-sdk@0.2.76':
resolution: {integrity: sha512-HZxvnT8ZWkzCnQygaYCA0dl8RSUzuVbxE1YG4ecy6vh4nQbTT36CxUxBy+QVdR12pPQluncC0mCOLhI2918Eaw==}
'@anthropic-ai/claude-agent-sdk@0.2.81':
resolution: {integrity: sha512-CBeebgibBEN/DWOQGZN67vhuTG55RbI1hlsFSSoZ4uA/Io3lw04eHTE2ISCmdbqyJaefYTt6GKZei1nP0TQMNw==}
engines: {node: '>=18.0.0'}
peerDependencies:
zod: ^4.0.0
@@ -512,7 +512,7 @@ packages:
snapshots:
'@anthropic-ai/claude-agent-sdk@0.2.76(zod@4.3.6)':
'@anthropic-ai/claude-agent-sdk@0.2.81(zod@4.3.6)':
dependencies:
zod: 4.3.6
optionalDependencies:

View File

@@ -35,6 +35,9 @@ interface ContainerInput {
interface ContainerOutput {
status: 'success' | 'error';
phase?: 'progress' | 'final' | 'tool-activity' | 'intermediate';
agentId?: string;
agentLabel?: string;
agentDone?: boolean;
result: string | null;
newSessionId?: string;
error?: string;
@@ -672,19 +675,35 @@ async function runQuery(
if (message.type === 'system' && (message as { subtype?: string }).subtype === 'task_notification') {
const tn = message as { task_id: string; status: string; summary: string };
log(`Task notification: task=${tn.task_id} status=${tn.status} summary=${tn.summary}`);
if (tn.status === 'completed' || tn.status === 'error' || tn.status === 'cancelled') {
writeOutput({
status: 'success',
phase: 'progress',
agentId: tn.task_id,
agentDone: true,
result: tn.summary || null,
newSessionId,
});
}
}
if (message.type === 'system' && (message as { subtype?: string }).subtype === 'task_progress') {
const tp = message as Record<string, unknown>;
const taskId = typeof tp.task_id === 'string' ? tp.task_id : undefined;
const summary = typeof tp.summary === 'string' ? tp.summary : '';
const description = typeof tp.description === 'string' ? tp.description : '';
if (description) {
if (description && description.length <= 80) {
// Short tool description → show as sub-line in progress
writeOutput({
status: 'success',
phase: 'tool-activity',
result: description,
agentId: taskId,
newSessionId,
});
} else if (description) {
// Long AI summary → skip (too long for progress sub-line)
log(`Skipping long task_progress description (${description.length} chars)`);
}
}
@@ -697,6 +716,8 @@ async function runQuery(
status: 'success',
phase: 'progress',
result: `🔄 ${desc}`,
agentId: ts.task_id,
agentLabel: desc,
newSessionId,
});
}

View File

@@ -8,7 +8,7 @@ importers:
.:
dependencies:
'@openai/codex-sdk':
'@openai/codex':
specifier: ^0.115.0
version: 0.115.0
devDependencies:
@@ -21,10 +21,6 @@ importers:
packages:
'@openai/codex-sdk@0.115.0':
resolution: {integrity: sha512-BPoPhim0uUm3rzugY7JFaFJ+rPG/wMRhvKNFii//Dp3kTb+gFy3jrip7ijXqhswsnqXM3nwTiv7kYHt1+TMUPg==}
engines: {node: '>=18'}
'@openai/codex@0.115.0':
resolution: {integrity: sha512-uu689DHUzvuPcb39hJ+7fqy++TAvY32w9VggDpcz3HS0Sx0WadWoAPPcMK547P2T6AqfMsAtA8kspkR3tqErOg==}
engines: {node: '>=16'}
@@ -79,10 +75,6 @@ packages:
snapshots:
'@openai/codex-sdk@0.115.0':
dependencies:
'@openai/codex': 0.115.0
'@openai/codex@0.115.0':
optionalDependencies:
'@openai/codex-darwin-arm64': '@openai/codex@0.115.0-darwin-arm64'