@gajae-code/coding-agent 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/types/append-only-mode.d.ts +31 -0
- package/dist/types/capability/rule.d.ts +8 -0
- package/dist/types/cli/fixture-report.d.ts +20 -0
- package/dist/types/cli/fixture-report.test.d.ts +1 -0
- package/dist/types/cli/nofile-limit.d.ts +11 -0
- package/dist/types/cli/update-cli.d.ts +22 -0
- package/dist/types/config/settings-schema.d.ts +105 -1
- package/dist/types/discovery/index.d.ts +1 -0
- package/dist/types/export/html/template.generated.d.ts +1 -1
- package/dist/types/export/ttsr.d.ts +14 -3
- package/dist/types/gjc-runtime/deep-interview-state.d.ts +5 -2
- package/dist/types/gjc-runtime/session-state-sidecar.d.ts +7 -0
- package/dist/types/gjc-runtime/state-writer.d.ts +3 -0
- package/dist/types/gjc-runtime/team-runtime.d.ts +26 -0
- package/dist/types/gjc-runtime/ultragoal-receipt-freshness.d.ts +42 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +119 -13
- package/dist/types/goals/runtime.d.ts +1 -0
- package/dist/types/hooks/native-skill-hook.d.ts +12 -0
- package/dist/types/modes/components/assistant-message.d.ts +5 -1
- package/dist/types/modes/components/status-line.d.ts +9 -0
- package/dist/types/modes/controllers/command-controller.d.ts +1 -0
- package/dist/types/modes/controllers/event-controller.d.ts +5 -0
- package/dist/types/modes/interactive-mode.d.ts +2 -0
- package/dist/types/modes/rpc/rpc-types.d.ts +14 -0
- package/dist/types/modes/shared/agent-wire/event-contract.d.ts +19 -0
- package/dist/types/modes/shared/agent-wire/event-envelope.d.ts +23 -1
- package/dist/types/modes/types.d.ts +1 -0
- package/dist/types/modes/utils/ui-helpers.d.ts +1 -0
- package/dist/types/notifications/config.d.ts +6 -0
- package/dist/types/notifications/telegram-daemon.d.ts +8 -0
- package/dist/types/notifications/threaded-render.d.ts +6 -0
- package/dist/types/sdk.d.ts +3 -0
- package/dist/types/session/agent-session.d.ts +43 -1
- package/dist/types/session/file-mention-pruning.d.ts +8 -0
- package/dist/types/session/messages.d.ts +4 -0
- package/dist/types/session/session-manager.d.ts +17 -1
- package/dist/types/skill-state/active-state.d.ts +18 -1
- package/dist/types/system-prompt.d.ts +18 -2
- package/dist/types/task/executor.d.ts +1 -0
- package/dist/types/task/fork-context-budget.d.ts +7 -0
- package/dist/types/task/token-log.d.ts +30 -0
- package/dist/types/task/token-log.test.d.ts +1 -0
- package/dist/types/tools/bisect.d.ts +81 -0
- package/dist/types/tools/index.d.ts +1 -0
- package/dist/types/tools/search.d.ts +2 -2
- package/dist/types/utils/file-mentions.d.ts +14 -0
- package/dist/types/utils/git.d.ts +32 -0
- package/dist/types/web/scrapers/youtube.d.ts +8 -0
- package/package.json +7 -7
- package/src/append-only-mode.ts +58 -0
- package/src/autoresearch/prompt.md +1 -1
- package/src/autoresearch/tools/log-experiment.ts +1 -1
- package/src/capability/rule.ts +9 -0
- package/src/cli/config-cli.ts +27 -3
- package/src/cli/fixture-report.test.ts +230 -0
- package/src/cli/fixture-report.ts +171 -0
- package/src/cli/nofile-limit.ts +48 -0
- package/src/cli/update-cli.ts +85 -9
- package/src/cli.ts +26 -0
- package/src/commands/contribution-prep.ts +1 -1
- package/src/config/settings-schema.ts +68 -1
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +12 -13
- package/src/defaults/gjc/skills/ralplan/SKILL.md +30 -93
- package/src/defaults/gjc/skills/team/SKILL.md +16 -13
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +59 -4
- package/src/defaults/gjc/skills/ultragoal/pipeline-validation-contracts.md +30 -0
- package/src/defaults/gjc-defaults.ts +9 -0
- package/src/discovery/helpers.ts +10 -0
- package/src/discovery/index.ts +1 -0
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +60 -2
- package/src/export/ttsr.ts +96 -18
- package/src/extensibility/extensions/runner.ts +181 -219
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +156 -44
- package/src/gjc-runtime/deep-interview-state.ts +31 -2
- package/src/gjc-runtime/session-state-sidecar.ts +208 -13
- package/src/gjc-runtime/state-writer.ts +15 -0
- package/src/gjc-runtime/team-runtime.ts +164 -15
- package/src/gjc-runtime/ultragoal-guard.ts +55 -66
- package/src/gjc-runtime/ultragoal-receipt-freshness.ts +315 -0
- package/src/gjc-runtime/ultragoal-runtime.ts +1593 -143
- package/src/gjc-runtime/workflow-manifest.generated.json +113 -2
- package/src/gjc-runtime/workflow-manifest.ts +74 -1
- package/src/goals/runtime.ts +10 -2
- package/src/hindsight/backend.ts +1 -3
- package/src/hooks/native-skill-hook.ts +95 -4
- package/src/internal-urls/docs-index.generated.ts +14 -5
- package/src/main.ts +43 -2
- package/src/memories/index.ts +12 -1
- package/src/modes/components/assistant-message.ts +241 -82
- package/src/modes/components/custom-editor.ts +1 -0
- package/src/modes/components/status-line.ts +167 -54
- package/src/modes/components/tool-execution.ts +44 -19
- package/src/modes/controllers/command-controller.ts +39 -2
- package/src/modes/controllers/event-controller.ts +66 -47
- package/src/modes/controllers/input-controller.ts +1 -1
- package/src/modes/interactive-mode.ts +9 -1
- package/src/modes/rpc/rpc-mode.ts +29 -3
- package/src/modes/rpc/rpc-types.ts +9 -0
- package/src/modes/shared/agent-wire/command-validation.ts +4 -0
- package/src/modes/shared/agent-wire/event-contract.ts +22 -0
- package/src/modes/shared/agent-wire/event-envelope.ts +82 -0
- package/src/modes/shared/agent-wire/scopes.ts +1 -0
- package/src/modes/types.ts +1 -0
- package/src/modes/utils/ui-helpers.ts +17 -4
- package/src/notifications/config.ts +16 -4
- package/src/notifications/index.ts +78 -5
- package/src/notifications/telegram-daemon-cli.ts +2 -2
- package/src/notifications/telegram-daemon-control.ts +2 -2
- package/src/notifications/telegram-daemon.ts +85 -8
- package/src/notifications/threaded-render.ts +17 -1
- package/src/prompts/agents/architect.md +19 -10
- package/src/prompts/agents/critic.md +16 -18
- package/src/prompts/agents/executor.md +14 -11
- package/src/prompts/agents/planner.md +18 -13
- package/src/prompts/ci-green-request.md +3 -8
- package/src/prompts/goals/goal-continuation.md +0 -5
- package/src/prompts/goals/goal-mode-active.md +0 -5
- package/src/prompts/system/agent-creation-architect.md +2 -2
- package/src/prompts/system/plan-mode-active.md +1 -1
- package/src/prompts/system/plan-mode-subagent.md +3 -3
- package/src/prompts/system/project-prompt.md +0 -13
- package/src/prompts/system/subagent-system-prompt.md +3 -2
- package/src/prompts/system/system-prompt.md +26 -19
- package/src/prompts/system/volatile-project-context.md +10 -0
- package/src/prompts/system/web-search.md +4 -7
- package/src/prompts/tools/apply-patch.md +6 -0
- package/src/prompts/tools/ast-edit.md +1 -0
- package/src/prompts/tools/bash.md +1 -1
- package/src/prompts/tools/bisect.md +22 -0
- package/src/prompts/tools/browser.md +1 -1
- package/src/prompts/tools/cron.md +0 -2
- package/src/prompts/tools/eval.md +2 -2
- package/src/prompts/tools/find.md +1 -1
- package/src/prompts/tools/github.md +6 -6
- package/src/prompts/tools/goal.md +1 -3
- package/src/prompts/tools/image-gen.md +12 -5
- package/src/prompts/tools/irc.md +5 -4
- package/src/prompts/tools/job.md +2 -2
- package/src/prompts/tools/lsp.md +1 -1
- package/src/prompts/tools/monitor.md +2 -2
- package/src/prompts/tools/patch.md +2 -2
- package/src/prompts/tools/replace.md +2 -21
- package/src/prompts/tools/rewind.md +1 -1
- package/src/prompts/tools/search-tool-bm25.md +1 -11
- package/src/prompts/tools/search.md +1 -1
- package/src/prompts/tools/skill.md +3 -2
- package/src/prompts/tools/ssh.md +2 -1
- package/src/prompts/tools/subagent.md +2 -2
- package/src/prompts/tools/task.md +4 -5
- package/src/prompts/tools/todo-write.md +1 -1
- package/src/prompts/tools/vim.md +1 -0
- package/src/prompts/tools/web-search.md +2 -0
- package/src/prompts/tools/write.md +8 -2
- package/src/sdk.ts +32 -22
- package/src/session/agent-session.ts +732 -107
- package/src/session/file-mention-pruning.ts +64 -0
- package/src/session/messages.ts +4 -0
- package/src/session/session-manager.ts +59 -2
- package/src/skill-state/active-state.ts +141 -5
- package/src/skill-state/deep-interview-mutation-guard.ts +67 -3
- package/src/slash-commands/builtin-registry.ts +65 -0
- package/src/system-prompt.ts +57 -16
- package/src/task/executor.ts +125 -20
- package/src/task/fork-context-advisory.ts +2 -7
- package/src/task/fork-context-budget.ts +9 -0
- package/src/task/index.ts +4 -3
- package/src/task/output-manager.ts +4 -2
- package/src/task/token-log.test.ts +188 -0
- package/src/task/token-log.ts +179 -0
- package/src/tools/bisect.ts +367 -0
- package/src/tools/index.ts +3 -0
- package/src/tools/output-meta.ts +116 -4
- package/src/tools/search.ts +8 -2
- package/src/tools/skill.ts +15 -0
- package/src/utils/file-mentions.ts +39 -7
- package/src/utils/git.ts +73 -0
- package/src/web/scrapers/youtube.ts +24 -12
|
@@ -11,9 +11,16 @@ export interface TtsrMatchContext {
|
|
|
11
11
|
/** Stable key to isolate buffering (for example a tool call ID). */
|
|
12
12
|
streamKey?: string;
|
|
13
13
|
}
|
|
14
|
+
/** Tracks when a rule was last injected (for repeat gating). */
|
|
15
|
+
export interface TtsrInjectionRecord {
|
|
16
|
+
name: string;
|
|
17
|
+
lastInjectedAt: number;
|
|
18
|
+
repeatMode?: "once" | "after-gap";
|
|
19
|
+
repeatGap?: number;
|
|
20
|
+
}
|
|
14
21
|
export declare class TtsrManager {
|
|
15
22
|
#private;
|
|
16
|
-
constructor(settings?: TtsrSettings);
|
|
23
|
+
constructor(settings?: Partial<TtsrSettings>);
|
|
17
24
|
/** Add a TTSR rule to be monitored. */
|
|
18
25
|
addRule(rule: Rule): boolean;
|
|
19
26
|
/**
|
|
@@ -29,8 +36,10 @@ export declare class TtsrManager {
|
|
|
29
36
|
markInjectedByNames(ruleNames: string[]): void;
|
|
30
37
|
/** Get names of all injected rules (for persistence). */
|
|
31
38
|
getInjectedRuleNames(): string[];
|
|
32
|
-
/**
|
|
33
|
-
|
|
39
|
+
/** Get full injected rule records (for persistence). */
|
|
40
|
+
getInjectedRecords(): TtsrInjectionRecord[];
|
|
41
|
+
/** Restore injected state from legacy rule names or persisted records. */
|
|
42
|
+
restoreInjected(records: string[] | TtsrInjectionRecord[]): void;
|
|
34
43
|
/** Reset stream buffers (called on new turn). */
|
|
35
44
|
resetBuffer(): void;
|
|
36
45
|
/** Check if any TTSR rules are registered. */
|
|
@@ -39,6 +48,8 @@ export declare class TtsrManager {
|
|
|
39
48
|
incrementMessageCount(): void;
|
|
40
49
|
/** Get current message count. */
|
|
41
50
|
getMessageCount(): number;
|
|
51
|
+
/** Restore message counter after session resume. */
|
|
52
|
+
restoreMessageCount(messageCount: number): void;
|
|
42
53
|
/** Get settings. */
|
|
43
54
|
getSettings(): Required<TtsrSettings>;
|
|
44
55
|
}
|
|
@@ -92,8 +92,11 @@ export declare function deriveRoundKey(interviewId: string | undefined, input: {
|
|
|
92
92
|
* legacy flattened fields hoisted in losslessly, transcript duplicates removed
|
|
93
93
|
* from the top level, and `rounds`/`established_facts` guaranteed to be arrays.
|
|
94
94
|
*
|
|
95
|
-
* Idempotent: a canonical envelope is returned unchanged in shape.
|
|
96
|
-
* unknown envelope
|
|
95
|
+
* Idempotent: a canonical envelope is returned unchanged in shape. Preserves all
|
|
96
|
+
* unknown envelope and nested fields except the envelope-reserved keys that leak
|
|
97
|
+
* into `state` (see `ENVELOPE_RESERVED_STATE_KEYS`), which are stripped so a
|
|
98
|
+
* malformed envelope-in-state write cannot permanently nest state. Never mutates
|
|
99
|
+
* the input.
|
|
97
100
|
*/
|
|
98
101
|
export declare function normalizeDeepInterviewEnvelope(value: unknown): DeepInterviewStateEnvelope;
|
|
99
102
|
/**
|
|
@@ -3,6 +3,11 @@ export declare const GJC_COORDINATOR_SESSION_STATE_FILE_ENV = "GJC_COORDINATOR_S
|
|
|
3
3
|
export declare const GJC_COORDINATOR_SESSION_ID_ENV = "GJC_COORDINATOR_SESSION_ID";
|
|
4
4
|
export declare const GJC_COORDINATOR_SESSION_BRANCH_ENV = "GJC_COORDINATOR_SESSION_BRANCH";
|
|
5
5
|
export type RuntimeState = "ready_for_input" | "running" | "needs_user_input" | "completed" | "errored";
|
|
6
|
+
/** Test-only counters for runtime sidecar hot-path assertions. */
|
|
7
|
+
export declare const __sessionStateSidecarPerfCounters: {
|
|
8
|
+
persistFromEventCalls: number;
|
|
9
|
+
reset(): void;
|
|
10
|
+
};
|
|
6
11
|
interface RuntimeStateEvent {
|
|
7
12
|
type: string;
|
|
8
13
|
messages?: unknown[];
|
|
@@ -26,6 +31,8 @@ export declare function readTerminalRuntimeStateMarker(input: {
|
|
|
26
31
|
cwd?: string | null;
|
|
27
32
|
sessionFile?: string | null;
|
|
28
33
|
}): Promise<TerminalRuntimeStateStatus>;
|
|
34
|
+
export declare function stateForEvent(event: RuntimeStateEvent): RuntimeState | null;
|
|
35
|
+
export declare function eventAffectsCoordinatorRuntimeState(event: RuntimeStateEvent): boolean;
|
|
29
36
|
export declare function persistCoordinatorRuntimeStateFromEvent(event: RuntimeStateEvent, context: RuntimeStateContext): Promise<void>;
|
|
30
37
|
export declare function persistCoordinatorRuntimeStateFromPostmortem(reason: postmortem.Reason, context: RuntimeStateContext): void;
|
|
31
38
|
export declare function registerCoordinatorRuntimeStateFinalizer(context: RuntimeStateContext): () => void;
|
|
@@ -142,6 +142,8 @@ export declare function readExistingStateForMutation(filePath: string): Promise<
|
|
|
142
142
|
export declare function workflowEnvelopeContentSha256(value: unknown): string;
|
|
143
143
|
export declare function stampWorkflowEnvelopeChecksum<T>(value: T, filePath: string, computedAt?: string): T;
|
|
144
144
|
export declare function detectWorkflowEnvelopeIntegrityMismatch(filePath: string): Promise<WorkflowEnvelopeIntegrityMismatch | undefined>;
|
|
145
|
+
type ActiveStateCacheInvalidator = (cwd?: string, sessionId?: string) => void;
|
|
146
|
+
export declare function setActiveStateCacheInvalidator(invalidator: ActiveStateCacheInvalidator): void;
|
|
145
147
|
export declare function persistedStateRevision(value: unknown): number;
|
|
146
148
|
export declare function writeGuardedJsonAtomic(targetPath: string, value: unknown, options: GuardedStateWriterOptions): Promise<GuardedWriteResult>;
|
|
147
149
|
export declare function writeGuardedWorkflowEnvelopeAtomic(targetPath: string, value: unknown, options: GuardedStateWriterOptions): Promise<GuardedWriteResult>;
|
|
@@ -239,3 +241,4 @@ export declare function beginWorkflowTransactionJournal(input: {
|
|
|
239
241
|
}): Promise<string>;
|
|
240
242
|
export declare function updateWorkflowTransactionJournal(cwd: string, sessionId: string, mutationId: string, patch: Partial<WorkflowTransactionJournal>): Promise<string>;
|
|
241
243
|
export declare function completeWorkflowTransactionJournal(cwd: string, sessionId: string, mutationId: string): Promise<void>;
|
|
244
|
+
export {};
|
|
@@ -146,6 +146,7 @@ export interface GjcTeamWorkerLifecycle {
|
|
|
146
146
|
}
|
|
147
147
|
export type GjcTeamNotificationDeliveryState = "pending" | "sent" | "queued" | "deferred" | "failed" | "delivered" | "acknowledged";
|
|
148
148
|
export type GjcTeamPaneAttemptResult = "sent" | "queued" | "deferred" | "failed";
|
|
149
|
+
export type GjcTeamMailboxDeliveryTransportKind = "notifications_sdk" | "pane";
|
|
149
150
|
export interface GjcTeamNotification {
|
|
150
151
|
id: string;
|
|
151
152
|
kind: "mailbox_message" | "worker_lifecycle" | "invalid_attempt";
|
|
@@ -164,6 +165,29 @@ export interface GjcTeamNotification {
|
|
|
164
165
|
updated_at: string;
|
|
165
166
|
replay_count: number;
|
|
166
167
|
}
|
|
168
|
+
export interface GjcTeamMailboxDeliveryInput {
|
|
169
|
+
team_name: string;
|
|
170
|
+
state_dir: string;
|
|
171
|
+
config: GjcTeamConfig;
|
|
172
|
+
notification: GjcTeamNotification;
|
|
173
|
+
message: GjcTeamMailboxMessage;
|
|
174
|
+
cwd: string;
|
|
175
|
+
env: NodeJS.ProcessEnv;
|
|
176
|
+
}
|
|
177
|
+
export type GjcTeamMailboxDeliveryResult = {
|
|
178
|
+
transport: "notifications_sdk";
|
|
179
|
+
state: GjcTeamNotificationDeliveryState;
|
|
180
|
+
reason?: string;
|
|
181
|
+
} | {
|
|
182
|
+
transport: "pane";
|
|
183
|
+
state: GjcTeamPaneAttemptResult;
|
|
184
|
+
reason?: string;
|
|
185
|
+
};
|
|
186
|
+
export interface GjcTeamMailboxDeliveryTransport {
|
|
187
|
+
deliverMailboxMessage(input: GjcTeamMailboxDeliveryInput): Promise<GjcTeamMailboxDeliveryResult | null>;
|
|
188
|
+
}
|
|
189
|
+
export declare function setGjcTeamMailboxDeliveryTransport(transport: GjcTeamMailboxDeliveryTransport | undefined): () => void;
|
|
190
|
+
export declare function setGjcTeamMailboxDeliveryTransportForTest(transport: GjcTeamMailboxDeliveryTransport | undefined): () => void;
|
|
167
191
|
export interface GjcTeamNotificationSummary {
|
|
168
192
|
total: number;
|
|
169
193
|
replay_eligible: number;
|
|
@@ -197,6 +221,7 @@ export interface GjcTeamStartOptions {
|
|
|
197
221
|
cwd?: string;
|
|
198
222
|
env?: NodeJS.ProcessEnv;
|
|
199
223
|
dryRun?: boolean;
|
|
224
|
+
mailboxDeliveryTransport?: GjcTeamMailboxDeliveryTransport;
|
|
200
225
|
}
|
|
201
226
|
export interface GjcTeamApiClaimResult {
|
|
202
227
|
ok: boolean;
|
|
@@ -306,6 +331,7 @@ export declare function classifyGjcTeamCheckpointFiles(files: string[]): {
|
|
|
306
331
|
protected: string[];
|
|
307
332
|
};
|
|
308
333
|
export declare function classifyWorkerCheckpointStatus(cwd: string): GjcWorkerCheckpointClassification;
|
|
334
|
+
export declare function classifyWorkerCheckpointStatusAsync(cwd: string): Promise<GjcWorkerCheckpointClassification>;
|
|
309
335
|
export declare function startGjcTeam(options: GjcTeamStartOptions): Promise<GjcTeamSnapshot>;
|
|
310
336
|
export declare function readGjcTeamSnapshot(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv, options?: GjcTeamSnapshotOptions): Promise<GjcTeamSnapshot>;
|
|
311
337
|
export declare function monitorGjcTeamSnapshot(teamName: string, cwd?: string, env?: NodeJS.ProcessEnv): Promise<GjcTeamSnapshot>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { UltragoalCompletionVerification, UltragoalGoal, UltragoalGoalStatus, UltragoalLedgerEvent, UltragoalPlan, UltragoalReceiptKind } from "./ultragoal-runtime";
|
|
2
|
+
export type UltragoalReceiptFreshnessDiagnostic = {
|
|
3
|
+
state: "inactive" | "unrelated_goal" | "active_verified_complete" | "active_missing_receipt" | "active_stale_receipt" | "active_missing_final_receipt" | "active_dirty_quality_gate" | "active_review_blocked_unrecorded" | "active_review_blocked_recorded" | "unreadable_fail_closed";
|
|
4
|
+
message: string;
|
|
5
|
+
goalId?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function requiredUltragoalGoals(plan: UltragoalPlan): UltragoalGoal[];
|
|
8
|
+
export declare function receiptRelevantGoals(plan: UltragoalPlan, goal: UltragoalGoal, receiptKind: UltragoalReceiptKind): UltragoalGoal[];
|
|
9
|
+
export declare function computeUltragoalPlanGeneration(input: {
|
|
10
|
+
plan: UltragoalPlan;
|
|
11
|
+
ledger: readonly UltragoalLedgerEvent[];
|
|
12
|
+
goal: UltragoalGoal;
|
|
13
|
+
receiptKind: UltragoalReceiptKind;
|
|
14
|
+
beforeStatus: UltragoalGoalStatus;
|
|
15
|
+
excludeEventId?: string;
|
|
16
|
+
targetGoalUpdatedAt?: string;
|
|
17
|
+
}): {
|
|
18
|
+
planGeneration: string;
|
|
19
|
+
basis: UltragoalCompletionVerification["basis"];
|
|
20
|
+
};
|
|
21
|
+
export declare function findLedgerReceiptEvent(ledger: readonly UltragoalLedgerEvent[], receipt: UltragoalCompletionVerification): UltragoalLedgerEvent | null;
|
|
22
|
+
export declare function validateReceiptFreshBase(input: {
|
|
23
|
+
plan: UltragoalPlan;
|
|
24
|
+
ledger: readonly UltragoalLedgerEvent[];
|
|
25
|
+
goal: UltragoalGoal;
|
|
26
|
+
receipt: UltragoalCompletionVerification;
|
|
27
|
+
receiptKind: UltragoalReceiptKind;
|
|
28
|
+
}): UltragoalReceiptFreshnessDiagnostic | null;
|
|
29
|
+
export declare function findFreshBatchCloseReceipt(input: {
|
|
30
|
+
plan: UltragoalPlan;
|
|
31
|
+
ledger: readonly UltragoalLedgerEvent[];
|
|
32
|
+
deferredGoal: UltragoalGoal;
|
|
33
|
+
deferredReceipt: UltragoalCompletionVerification;
|
|
34
|
+
}): UltragoalCompletionVerification | null;
|
|
35
|
+
export declare function validateDeferredMemberReceiptFresh(input: {
|
|
36
|
+
plan: UltragoalPlan;
|
|
37
|
+
ledger: readonly UltragoalLedgerEvent[];
|
|
38
|
+
goal: UltragoalGoal;
|
|
39
|
+
receipt: UltragoalCompletionVerification;
|
|
40
|
+
receiptKind: UltragoalReceiptKind;
|
|
41
|
+
requireClose: boolean;
|
|
42
|
+
}): UltragoalReceiptFreshnessDiagnostic;
|
|
@@ -1,6 +1,77 @@
|
|
|
1
1
|
import type { WorkflowHudSummary } from "../skill-state/active-state";
|
|
2
|
+
export { computeUltragoalPlanGeneration, receiptRelevantGoals } from "./ultragoal-receipt-freshness";
|
|
2
3
|
export type UltragoalGjcGoalMode = "aggregate" | "per-story";
|
|
3
4
|
export type UltragoalGoalStatus = "pending" | "active" | "complete" | "failed" | "blocked" | "review_blocked" | "superseded";
|
|
5
|
+
export type UltragoalPipelineMetadataSource = "original_plan_graph" | "legacy_brief_only" | "steering";
|
|
6
|
+
export type UltragoalPipelineOverlapState = "none" | "open" | "joined_clean" | "blocked_disjoint_continue" | "quarantine_required" | "rebaseline_complete";
|
|
7
|
+
export interface UltragoalPipelineTargets extends JsonObject {
|
|
8
|
+
files: string[];
|
|
9
|
+
surfaces: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface UltragoalPipelineMetadata extends JsonObject {
|
|
12
|
+
schemaVersion: 1;
|
|
13
|
+
goalId: string;
|
|
14
|
+
source: UltragoalPipelineMetadataSource;
|
|
15
|
+
eligible: boolean;
|
|
16
|
+
dependsOn: string[];
|
|
17
|
+
independentOf: string[];
|
|
18
|
+
targets: UltragoalPipelineTargets;
|
|
19
|
+
metadataHash: string;
|
|
20
|
+
overlap: UltragoalPipelineOverlapState;
|
|
21
|
+
overlapId?: string;
|
|
22
|
+
priorGoalId?: string;
|
|
23
|
+
nextGoalId?: string;
|
|
24
|
+
blockerFootprints?: UltragoalPipelineTargets[];
|
|
25
|
+
invalidationReason?: string;
|
|
26
|
+
invalidatedAt?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface UltragoalGoalMetadataInput {
|
|
29
|
+
schemaVersion: 1;
|
|
30
|
+
goalId: string;
|
|
31
|
+
source: UltragoalPipelineMetadataSource;
|
|
32
|
+
dependsOn?: string[];
|
|
33
|
+
independentOf?: string[];
|
|
34
|
+
targets?: Partial<UltragoalPipelineTargets>;
|
|
35
|
+
}
|
|
36
|
+
export interface UltragoalValidationBatchMetadata extends JsonObject {
|
|
37
|
+
schemaVersion: 1;
|
|
38
|
+
batchId: string;
|
|
39
|
+
memberIds: string[];
|
|
40
|
+
finalGoalId: string;
|
|
41
|
+
mode: "aggregate-only";
|
|
42
|
+
metadataHash: string;
|
|
43
|
+
}
|
|
44
|
+
export interface UltragoalValidationBatchInput {
|
|
45
|
+
schemaVersion: 1;
|
|
46
|
+
batchId: string;
|
|
47
|
+
memberIds: string[];
|
|
48
|
+
finalGoalId: string;
|
|
49
|
+
}
|
|
50
|
+
export interface UltragoalPipelineOverlapHandles extends JsonObject {
|
|
51
|
+
review: JsonObject;
|
|
52
|
+
qa: JsonObject;
|
|
53
|
+
implementation: JsonObject;
|
|
54
|
+
}
|
|
55
|
+
export interface UltragoalPipelineOverlapReceipt extends JsonObject {
|
|
56
|
+
ok: true;
|
|
57
|
+
event: string;
|
|
58
|
+
overlap_id: string;
|
|
59
|
+
prior_goal_id: string;
|
|
60
|
+
next_goal_id?: string;
|
|
61
|
+
goal_id?: string;
|
|
62
|
+
status?: UltragoalPipelineOverlapState;
|
|
63
|
+
next_goal_status?: UltragoalGoalStatus;
|
|
64
|
+
goals_path: string;
|
|
65
|
+
ledger_path: string;
|
|
66
|
+
}
|
|
67
|
+
export type UltragoalPipelineLedgerEventName = "pipeline_overlap_started" | "pipeline_overlap_joined" | "pipeline_overlap_blocked" | "pipeline_overlap_quarantined" | "pipeline_overlap_rebaselined";
|
|
68
|
+
export interface UltragoalPipelineLedgerEvent extends UltragoalLedgerEvent {
|
|
69
|
+
event: UltragoalPipelineLedgerEventName;
|
|
70
|
+
schemaVersion: 1;
|
|
71
|
+
overlapId: string;
|
|
72
|
+
priorGoalId: string;
|
|
73
|
+
nextGoalId: string;
|
|
74
|
+
}
|
|
4
75
|
export interface UltragoalGoal {
|
|
5
76
|
id: string;
|
|
6
77
|
title: string;
|
|
@@ -13,6 +84,8 @@ export interface UltragoalGoal {
|
|
|
13
84
|
evidence?: string;
|
|
14
85
|
steering?: Record<string, unknown>;
|
|
15
86
|
completionVerification?: UltragoalCompletionVerification;
|
|
87
|
+
pipelineMetadata?: UltragoalPipelineMetadata;
|
|
88
|
+
validationBatch?: UltragoalValidationBatchMetadata;
|
|
16
89
|
}
|
|
17
90
|
export interface UltragoalPlan {
|
|
18
91
|
version: 1;
|
|
@@ -45,6 +118,26 @@ export interface UltragoalCompletionVerification {
|
|
|
45
118
|
requiredGoalSetHashBeforeCheckpoint: string;
|
|
46
119
|
};
|
|
47
120
|
checkpointLedgerEventId: string;
|
|
121
|
+
validationBatch?: {
|
|
122
|
+
schemaVersion: 1;
|
|
123
|
+
role: "deferred-member";
|
|
124
|
+
batchId: string;
|
|
125
|
+
memberIds: string[];
|
|
126
|
+
finalGoalId: string;
|
|
127
|
+
metadataHash: string;
|
|
128
|
+
changeSetHash: string;
|
|
129
|
+
} | {
|
|
130
|
+
schemaVersion: 1;
|
|
131
|
+
role: "batch-close";
|
|
132
|
+
batchId: string;
|
|
133
|
+
memberIds: string[];
|
|
134
|
+
finalGoalId: string;
|
|
135
|
+
memberMetadataHashes: Record<string, string>;
|
|
136
|
+
memberReceiptIds: Record<string, string>;
|
|
137
|
+
memberCheckpointLedgerEventIds: Record<string, string>;
|
|
138
|
+
memberChangeSetHashes: Record<string, string>;
|
|
139
|
+
unionHash: string;
|
|
140
|
+
};
|
|
48
141
|
}
|
|
49
142
|
export interface UltragoalLedgerEvent extends JsonObject {
|
|
50
143
|
eventId?: string;
|
|
@@ -106,6 +199,7 @@ export interface UltragoalStatusSummary {
|
|
|
106
199
|
nudgeRemaining?: number;
|
|
107
200
|
nudgeGoalId?: string;
|
|
108
201
|
nudgeTargetKind?: UltragoalNudgeTargetKind;
|
|
202
|
+
pipelineOverlap?: JsonObject;
|
|
109
203
|
}
|
|
110
204
|
export interface UltragoalCommandResult {
|
|
111
205
|
reviewBlockerGoalIds?: string[];
|
|
@@ -161,18 +255,6 @@ export declare function recordUltragoalNudgeIfBudgetRemaining(input: {
|
|
|
161
255
|
reason: string;
|
|
162
256
|
currentGoalObjective?: string;
|
|
163
257
|
}): Promise<UltragoalNudgeOutcome>;
|
|
164
|
-
export declare function computeUltragoalPlanGeneration(input: {
|
|
165
|
-
plan: UltragoalPlan;
|
|
166
|
-
ledger: readonly UltragoalLedgerEvent[];
|
|
167
|
-
goal: UltragoalGoal;
|
|
168
|
-
receiptKind: UltragoalReceiptKind;
|
|
169
|
-
beforeStatus: UltragoalGoalStatus;
|
|
170
|
-
excludeEventId?: string;
|
|
171
|
-
targetGoalUpdatedAt?: string;
|
|
172
|
-
}): {
|
|
173
|
-
planGeneration: string;
|
|
174
|
-
basis: UltragoalCompletionVerification["basis"];
|
|
175
|
-
};
|
|
176
258
|
export declare function readUltragoalPlan(cwd: string, sessionId?: string | null): Promise<UltragoalPlan | null>;
|
|
177
259
|
export declare function getUltragoalStatus(cwd: string, sessionId?: string | null): Promise<UltragoalStatusSummary>;
|
|
178
260
|
export declare function buildUltragoalHudSummary(summary: UltragoalStatusSummary, latestLedger?: UltragoalLedgerEvent): WorkflowHudSummary;
|
|
@@ -181,6 +263,10 @@ export declare function createUltragoalPlan(input: {
|
|
|
181
263
|
brief: string;
|
|
182
264
|
gjcGoalMode?: UltragoalGjcGoalMode;
|
|
183
265
|
sessionId?: string | null;
|
|
266
|
+
goalMetadata?: UltragoalGoalMetadataInput[];
|
|
267
|
+
goalMetadataJson?: string;
|
|
268
|
+
validationBatches?: UltragoalValidationBatchInput[];
|
|
269
|
+
validationBatchJson?: string;
|
|
184
270
|
}): Promise<UltragoalPlan>;
|
|
185
271
|
export interface UltragoalRunCompletionState {
|
|
186
272
|
requiredGoals: UltragoalGoal[];
|
|
@@ -190,6 +276,27 @@ export interface UltragoalRunCompletionState {
|
|
|
190
276
|
hasBlockers: boolean;
|
|
191
277
|
needsFinalAggregateReceipt: boolean;
|
|
192
278
|
}
|
|
279
|
+
export declare function startUltragoalPipelineOverlap(input: {
|
|
280
|
+
cwd: string;
|
|
281
|
+
priorGoalId: string;
|
|
282
|
+
nextGoalId: string;
|
|
283
|
+
reviewHandles: JsonObject | JsonObject[];
|
|
284
|
+
qaHandles: JsonObject | JsonObject[];
|
|
285
|
+
implementationHandle: JsonObject;
|
|
286
|
+
}): Promise<UltragoalPipelineOverlapReceipt>;
|
|
287
|
+
export declare function joinUltragoalPipelineOverlap(input: {
|
|
288
|
+
cwd: string;
|
|
289
|
+
overlapId: string;
|
|
290
|
+
reviewResult: JsonObject;
|
|
291
|
+
qaResult: JsonObject;
|
|
292
|
+
}): Promise<UltragoalPipelineOverlapReceipt>;
|
|
293
|
+
export declare function rebaselineUltragoalPipelineOverlap(input: {
|
|
294
|
+
cwd: string;
|
|
295
|
+
overlapId: string;
|
|
296
|
+
goalId: string;
|
|
297
|
+
evidence: string;
|
|
298
|
+
targetState: JsonObject;
|
|
299
|
+
}): Promise<UltragoalPipelineOverlapReceipt>;
|
|
193
300
|
export declare function getUltragoalRunCompletionState(plan: UltragoalPlan, options?: {
|
|
194
301
|
retryFailed?: boolean;
|
|
195
302
|
}): UltragoalRunCompletionState;
|
|
@@ -301,4 +408,3 @@ interface UltragoalReviewResult extends JsonObject {
|
|
|
301
408
|
export declare function resolveGitBase(cwd: string, branch?: string): Promise<string>;
|
|
302
409
|
export declare function runUltragoalReview(cwd: string, args: readonly string[]): Promise<UltragoalReviewResult>;
|
|
303
410
|
export declare function runNativeUltragoalCommand(args: string[], cwd?: string): Promise<UltragoalCommandResult>;
|
|
304
|
-
export {};
|
|
@@ -35,6 +35,7 @@ export declare class GoalRuntime {
|
|
|
35
35
|
#private;
|
|
36
36
|
constructor(host: GoalRuntimeHost);
|
|
37
37
|
get snapshot(): GoalRuntimeSnapshot;
|
|
38
|
+
shouldTrackTurnBaseline(): boolean;
|
|
38
39
|
onTurnStart(turnId: string, baselineUsage: GoalTokenUsage): void;
|
|
39
40
|
onToolCompleted(toolName: string): Promise<void>;
|
|
40
41
|
onGoalToolCompleted(): Promise<void>;
|
|
@@ -11,6 +11,18 @@ interface GjcNativeHookDispatchOptions {
|
|
|
11
11
|
effectiveSkillConfig?: EffectiveSkillConfigInput;
|
|
12
12
|
configPaths?: string[];
|
|
13
13
|
}
|
|
14
|
+
export declare function clearGjcNativeSkillHookCachesForTesting(): void;
|
|
15
|
+
export declare function getGjcNativeSkillHookCacheStatsForTesting(): {
|
|
16
|
+
effectiveSkillConfigResolutions: number;
|
|
17
|
+
};
|
|
18
|
+
export declare function resolveGjcNativeSkillConfigForTesting(input: {
|
|
19
|
+
cwd: string;
|
|
20
|
+
configPaths?: string[];
|
|
21
|
+
sessionId?: string;
|
|
22
|
+
threadId?: string;
|
|
23
|
+
stateDir?: string;
|
|
24
|
+
}): Promise<EffectiveSkillConfigInput>;
|
|
14
25
|
export declare function dispatchGjcNativeSkillHook(payload: HookPayload, options?: GjcNativeHookDispatchOptions): Promise<GjcNativeHookDispatchResult>;
|
|
26
|
+
export declare function runGjcNativeSkillHookInProcess(payload: HookPayload): Promise<string>;
|
|
15
27
|
export declare function runGjcNativeSkillHookCli(): Promise<void>;
|
|
16
28
|
export {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { AssistantMessage, ImageContent, Usage } from "@gajae-code/ai";
|
|
2
2
|
import { Container } from "@gajae-code/tui";
|
|
3
|
+
interface AssistantMessageUpdateOptions {
|
|
4
|
+
streaming?: boolean;
|
|
5
|
+
}
|
|
3
6
|
/**
|
|
4
7
|
* Component that renders a complete assistant message
|
|
5
8
|
*/
|
|
@@ -12,5 +15,6 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
12
15
|
setHideThinkingBlock(hide: boolean): void;
|
|
13
16
|
setToolResultImages(toolCallId: string, images: ImageContent[]): void;
|
|
14
17
|
setUsageInfo(usage: Usage): void;
|
|
15
|
-
updateContent(message: AssistantMessage): void;
|
|
18
|
+
updateContent(message: AssistantMessage, options?: AssistantMessageUpdateOptions): void;
|
|
16
19
|
}
|
|
20
|
+
export {};
|
|
@@ -90,5 +90,14 @@ export declare class StatusLineComponent implements Component {
|
|
|
90
90
|
* everything fits on one row.
|
|
91
91
|
*/
|
|
92
92
|
getPreviewContent(width: number): string;
|
|
93
|
+
getCacheStatsForTest(): {
|
|
94
|
+
rowHits: number;
|
|
95
|
+
rowMisses: number;
|
|
96
|
+
};
|
|
97
|
+
invalidateBranchForTest(): void;
|
|
98
|
+
setCachedPrForTest(pr: {
|
|
99
|
+
number: number;
|
|
100
|
+
url: string;
|
|
101
|
+
} | null): void;
|
|
93
102
|
render(width: number): string[];
|
|
94
103
|
}
|
|
@@ -23,6 +23,7 @@ export declare class CommandController {
|
|
|
23
23
|
handleContextCommand(): void;
|
|
24
24
|
handleMemoryCommand(text: string): Promise<void>;
|
|
25
25
|
handleClearCommand(): Promise<void>;
|
|
26
|
+
handleContextClearCommand(): Promise<void>;
|
|
26
27
|
handleDropCommand(): Promise<void>;
|
|
27
28
|
handleForkCommand(): Promise<void>;
|
|
28
29
|
handleMoveCommand(targetPath: string): Promise<void>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { InteractiveModeContext } from "../../modes/types";
|
|
2
2
|
import type { AgentSessionEvent } from "../../session/agent-session";
|
|
3
|
+
/** Test-only performance counters for advisory baseline tests. */
|
|
4
|
+
export declare const __eventControllerPerfCounters: {
|
|
5
|
+
messageUpdateContentVisits: number;
|
|
6
|
+
reset(): void;
|
|
7
|
+
};
|
|
3
8
|
export declare class EventController {
|
|
4
9
|
#private;
|
|
5
10
|
private ctx;
|
|
@@ -27,6 +27,7 @@ import { type WelcomeLogoMode } from "./components/welcome";
|
|
|
27
27
|
import { OAuthManualInputManager } from "./oauth-manual-input";
|
|
28
28
|
import type { Theme } from "./theme/theme";
|
|
29
29
|
import type { CompactionQueuedMessage, InteractiveModeContext, SubmittedUserInput, TodoItem, TodoPhase } from "./types";
|
|
30
|
+
export declare const DEFAULT_COMPOSER_PLACEHOLDER: string;
|
|
30
31
|
export type WelcomeBannerSettingMode = "auto" | "unicode" | "square" | "ascii";
|
|
31
32
|
export declare function resolveWelcomeLogoMode(mode: WelcomeBannerSettingMode, env?: Record<string, string | undefined>, platform?: NodeJS.Platform): WelcomeLogoMode;
|
|
32
33
|
/** Options for creating an InteractiveMode instance (for future API use) */
|
|
@@ -189,6 +190,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
189
190
|
handleToolsCommand(): void;
|
|
190
191
|
handleContextCommand(): void;
|
|
191
192
|
handleClearCommand(): Promise<void>;
|
|
193
|
+
handleContextClearCommand(): Promise<void>;
|
|
192
194
|
handleDropCommand(): Promise<void>;
|
|
193
195
|
handleForkCommand(): Promise<void>;
|
|
194
196
|
handleMoveCommand(targetPath: string): Promise<void>;
|
|
@@ -12,6 +12,7 @@ import type { ContextUsage } from "../../extensibility/extensions/types";
|
|
|
12
12
|
import type { SessionStats } from "../../session/agent-session";
|
|
13
13
|
import type { TodoPhase } from "../../tools/todo-write";
|
|
14
14
|
export type RpcGetStateInclude = "tools" | "dumpTools" | "systemPrompt";
|
|
15
|
+
export type RpcCapability = "compact_message_update";
|
|
15
16
|
export type RpcCommand = {
|
|
16
17
|
id?: string;
|
|
17
18
|
type: "prompt";
|
|
@@ -59,6 +60,10 @@ export type RpcCommand = {
|
|
|
59
60
|
} | {
|
|
60
61
|
id?: string;
|
|
61
62
|
type: "get_pending_workflow_gates";
|
|
63
|
+
} | {
|
|
64
|
+
id?: string;
|
|
65
|
+
type: "set_capabilities";
|
|
66
|
+
capabilities: RpcCapability[];
|
|
62
67
|
} | {
|
|
63
68
|
id?: string;
|
|
64
69
|
type: "set_model";
|
|
@@ -258,6 +263,15 @@ export type RpcResponse = {
|
|
|
258
263
|
data: {
|
|
259
264
|
gates: RpcWorkflowGate[];
|
|
260
265
|
};
|
|
266
|
+
} | {
|
|
267
|
+
id?: string;
|
|
268
|
+
type: "response";
|
|
269
|
+
command: "set_capabilities";
|
|
270
|
+
success: true;
|
|
271
|
+
data: {
|
|
272
|
+
acceptedCapabilities: RpcCapability[];
|
|
273
|
+
unsupported: string[];
|
|
274
|
+
};
|
|
261
275
|
} | {
|
|
262
276
|
id?: string;
|
|
263
277
|
type: "response";
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* an `AgentSessionEvent` variant fails typecheck until it is registered, and so
|
|
14
14
|
* conformance tests can assert fixture coverage equals the registry exactly.
|
|
15
15
|
*/
|
|
16
|
+
import type { AssistantMessageEvent } from "@gajae-code/ai";
|
|
16
17
|
import type { AgentSessionEvent } from "../../../session/agent-session";
|
|
17
18
|
/** Wire protocol version. Bump on breaking envelope/semantic changes. */
|
|
18
19
|
export declare const AGENT_WIRE_PROTOCOL_VERSION: 2;
|
|
@@ -29,6 +30,23 @@ export interface AgentWireEventPayload {
|
|
|
29
30
|
event_type: AgentWireEventType;
|
|
30
31
|
event: AgentSessionEvent;
|
|
31
32
|
}
|
|
33
|
+
export type AgentWireCompactAssistantMessageEvent = AssistantMessageEvent extends infer TEvent ? TEvent extends {
|
|
34
|
+
type: string;
|
|
35
|
+
} ? Omit<TEvent, "partial" | "message" | "error"> : never : never;
|
|
36
|
+
export interface AgentWireCompactMessageUpdatePayload {
|
|
37
|
+
event_type: "message_update";
|
|
38
|
+
/** Compact RPC opt-in payload: delta-only update plus minimal routing metadata. */
|
|
39
|
+
compact: true;
|
|
40
|
+
message_id: string | null;
|
|
41
|
+
content_index: number | null;
|
|
42
|
+
assistantMessageEvent: AgentWireCompactAssistantMessageEvent;
|
|
43
|
+
/** Full message checkpoint, snapshotted synchronously when this frame is enqueued. */
|
|
44
|
+
checkpoint_message?: Extract<AgentSessionEvent, {
|
|
45
|
+
type: "message_update";
|
|
46
|
+
}>["message"];
|
|
47
|
+
checkpoint_reason?: "periodic";
|
|
48
|
+
}
|
|
49
|
+
export type AgentWireEventFramePayload = AgentWireEventPayload | AgentWireCompactMessageUpdatePayload;
|
|
32
50
|
/**
|
|
33
51
|
* Bounded observed-signal vocabulary surfaced to owner control planes. Mirrors
|
|
34
52
|
* the Harness `ObservedSignal` set; the Harness type aliases this in a later
|
|
@@ -82,3 +100,4 @@ export interface AgentWireFrameEnvelope<TType extends AgentWireFrameType = Agent
|
|
|
82
100
|
}
|
|
83
101
|
/** An `AgentSessionEvent` serialized into a versioned wire frame. */
|
|
84
102
|
export type AgentWireEventFrame = AgentWireFrameEnvelope<"event", AgentWireEventPayload>;
|
|
103
|
+
export type AgentWireCompactEventFrame = AgentWireFrameEnvelope<"event", AgentWireEventFramePayload>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AgentSessionEvent } from "../../../session/agent-session";
|
|
2
|
-
import { type AgentWireEventFrame, type AgentWireEventPayload, type AgentWireEventType, type AgentWireFrameEnvelope, type AgentWireFrameType } from "./event-contract";
|
|
2
|
+
import { type AgentWireCompactAssistantMessageEvent, type AgentWireCompactEventFrame, type AgentWireEventFrame, type AgentWireEventPayload, type AgentWireEventType, type AgentWireFrameEnvelope, type AgentWireFrameType } from "./event-contract";
|
|
3
|
+
export declare const AGENT_WIRE_COMPACT_MESSAGE_UPDATE_CHECKPOINT_INTERVAL = 32;
|
|
3
4
|
/**
|
|
4
5
|
* Resolve the stable wire event-type for an `AgentSessionEvent`.
|
|
5
6
|
*
|
|
@@ -27,6 +28,27 @@ export type BridgeFrameSequencer = AgentWireFrameSequencer;
|
|
|
27
28
|
export declare function toAgentWireEventFrame(event: AgentSessionEvent, sequencer: AgentWireFrameSequencer): AgentWireEventFrame;
|
|
28
29
|
/** Build the rich event payload (renderer-facing) for an `AgentSessionEvent`. */
|
|
29
30
|
export declare function toAgentWireEventPayload(event: AgentSessionEvent): AgentWireEventPayload;
|
|
31
|
+
export declare function sanitizeAssistantMessageEventForCompact(assistantMessageEvent: Extract<AgentSessionEvent, {
|
|
32
|
+
type: "message_update";
|
|
33
|
+
}>["assistantMessageEvent"]): AgentWireCompactAssistantMessageEvent;
|
|
34
|
+
export interface AgentWireCompactMessageUpdateOptions {
|
|
35
|
+
checkpointInterval?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Stateful compact event serializer for opt-in RPC clients.
|
|
39
|
+
*
|
|
40
|
+
* Only `message_update` changes shape: it carries the immutable provider delta
|
|
41
|
+
* plus message/content identifiers, with periodic full-message checkpoints that
|
|
42
|
+
* are cloned synchronously before the caller returns to the event loop. All other
|
|
43
|
+
* event variants remain canonical full event frames so legacy bridge/RPC behavior
|
|
44
|
+
* and terminal `message_end` reconstruction are unchanged.
|
|
45
|
+
*/
|
|
46
|
+
export declare class AgentWireCompactEventEncoder {
|
|
47
|
+
#private;
|
|
48
|
+
constructor(sequencer: AgentWireFrameSequencer, options?: AgentWireCompactMessageUpdateOptions);
|
|
49
|
+
frame(event: AgentSessionEvent): AgentWireCompactEventFrame;
|
|
50
|
+
}
|
|
51
|
+
export declare function toAgentWireCompactEventFrame(event: AgentSessionEvent, encoder: AgentWireCompactEventEncoder): AgentWireCompactEventFrame;
|
|
30
52
|
/** Back-compat alias for {@link toAgentWireEventFrame}. */
|
|
31
53
|
export declare const toBridgeEventFrame: typeof toAgentWireEventFrame;
|
|
32
54
|
/**
|
|
@@ -198,6 +198,7 @@ export interface InteractiveModeContext {
|
|
|
198
198
|
handleDumpCommand(): void;
|
|
199
199
|
handleDebugTranscriptCommand(): Promise<void>;
|
|
200
200
|
handleClearCommand(): Promise<void>;
|
|
201
|
+
handleContextClearCommand(): Promise<void>;
|
|
201
202
|
handleDropCommand(): Promise<void>;
|
|
202
203
|
handleForkCommand(): Promise<void>;
|
|
203
204
|
handleBashCommand(command: string, excludeFromContext?: boolean): Promise<void>;
|
|
@@ -6,6 +6,7 @@ import type { SessionContext } from "../../session/session-manager";
|
|
|
6
6
|
interface RenderInitialMessagesOptions {
|
|
7
7
|
preserveExistingChat?: boolean;
|
|
8
8
|
}
|
|
9
|
+
export declare function argsWithPartialJson(args: unknown, partialJson: unknown): unknown;
|
|
9
10
|
export declare class UiHelpers {
|
|
10
11
|
#private;
|
|
11
12
|
private ctx;
|
|
@@ -17,6 +17,12 @@ export interface NotificationConfig {
|
|
|
17
17
|
}
|
|
18
18
|
/** Read typed config from Settings. */
|
|
19
19
|
export declare function getNotificationConfig(settings: Settings): NotificationConfig;
|
|
20
|
+
export declare function hasNonBlankValue(value: string | undefined): boolean;
|
|
21
|
+
/** Is Telegram configured with usable non-blank boundary credentials? */
|
|
22
|
+
export declare function isTelegramConfigured(cfg: NotificationConfig): cfg is NotificationConfig & {
|
|
23
|
+
botToken: string;
|
|
24
|
+
chatId: string;
|
|
25
|
+
};
|
|
20
26
|
/** Is global config sufficient for auto-on (enabled + at least one configured adapter)? */
|
|
21
27
|
export declare function isGloballyConfigured(cfg: NotificationConfig): boolean;
|
|
22
28
|
/** Resolve whether the notifications extension should be registered at SDK startup. */
|
|
@@ -254,6 +254,8 @@ export declare class TelegramNotificationDaemon {
|
|
|
254
254
|
private readonly opts;
|
|
255
255
|
readonly aliasTable: AliasTable;
|
|
256
256
|
readonly messageRoutes: Map<string | number, CallbackRoute | Omit<CallbackRoute, "answer">>;
|
|
257
|
+
/** Telegram message id backing each streamed `${sessionId}:${coalesceKey}`, for in-place edits. */
|
|
258
|
+
private readonly liveMessages;
|
|
257
259
|
readonly sessions: Map<string, SessionSocket>;
|
|
258
260
|
private readonly runtime;
|
|
259
261
|
private readonly sessionRouter;
|
|
@@ -375,6 +377,12 @@ export declare class TelegramNotificationDaemon {
|
|
|
375
377
|
private cleanupAllAttachmentDirs;
|
|
376
378
|
private resolveInboundAttachment;
|
|
377
379
|
private flushPool;
|
|
380
|
+
/**
|
|
381
|
+
* Track the Telegram message id backing a streamed `(sessionId, coalesceKey)`
|
|
382
|
+
* so later live/finalized frames edit it in place. Evicts this session's stale
|
|
383
|
+
* same-category entries (e.g. prior turns) so the map stays bounded.
|
|
384
|
+
*/
|
|
385
|
+
private recordLiveMessage;
|
|
378
386
|
private deliverFlatFallback;
|
|
379
387
|
private pairedChatIsPrivate;
|
|
380
388
|
private notifyThreadedFallback;
|
|
@@ -28,6 +28,12 @@ export interface ThreadedSend {
|
|
|
28
28
|
coalesceKey?: string;
|
|
29
29
|
/** True for the one-time identity header (the daemon pins it once). */
|
|
30
30
|
identity?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* When true the daemon may deliver this as an in-place edit of the message
|
|
33
|
+
* previously sent under the same `(sessionId, coalesceKey)` instead of a new
|
|
34
|
+
* message. Set for streamed turn frames so live + finalized share one message.
|
|
35
|
+
*/
|
|
36
|
+
editable?: boolean;
|
|
31
37
|
}
|
|
32
38
|
interface ThreadedFrame {
|
|
33
39
|
type?: unknown;
|