@gajae-code/coding-agent 0.12.5 → 0.12.7
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 +34 -0
- package/README.md +4 -1
- package/dist/types/async/job-manager.d.ts +36 -1
- package/dist/types/extensibility/extensions/runner.d.ts +9 -7
- package/dist/types/gjc-runtime/launch-tmux.d.ts +22 -3
- package/dist/types/gjc-runtime/psmux-detect.d.ts +3 -0
- package/dist/types/gjc-runtime/team-launch.d.ts +3 -1
- package/dist/types/gjc-runtime/team-runtime.d.ts +14 -2
- package/dist/types/gjc-runtime/team-store.d.ts +0 -4
- package/dist/types/gjc-runtime/team-workers.d.ts +5 -0
- package/dist/types/gjc-runtime/tmux-common.d.ts +1 -0
- package/dist/types/gjc-runtime/tmux-provider-context.d.ts +57 -0
- package/dist/types/gjc-runtime/tmux-sessions.d.ts +8 -1
- package/dist/types/gjc-runtime/ultragoal-change-set.d.ts +3 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +21 -4
- package/dist/types/modes/components/gjc-bundle-settings.d.ts +1 -0
- package/dist/types/modes/components/plugin-settings.d.ts +2 -0
- package/dist/types/modes/components/settings-selector.d.ts +2 -0
- package/dist/types/sdk/broker/broker.d.ts +18 -0
- package/dist/types/sdk/broker/lifecycle-ledger.d.ts +13 -0
- package/dist/types/sdk/broker/lifecycle.d.ts +1 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +2 -3
- package/dist/types/sdk/bus/index.d.ts +4 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +2 -2
- package/dist/types/sdk/bus/telegram-daemon.d.ts +25 -3
- package/dist/types/sdk/bus/topic-registry.d.ts +63 -3
- package/dist/types/session/agent-session.d.ts +5 -4
- package/dist/types/session/attempt-record-store.d.ts +19 -0
- package/dist/types/session/session-manager.d.ts +1 -0
- package/dist/types/session/session-storage.d.ts +8 -0
- package/dist/types/task/receipt.d.ts +1 -0
- package/dist/types/task/types.d.ts +43 -0
- package/dist/types/tools/subagent.d.ts +15 -0
- package/dist/types/tools/todo-write.d.ts +3 -0
- package/package.json +8 -8
- package/scripts/capture-sticky-viewport-showcase.ts +131 -5
- package/scripts/verify-gjc-sdk-canonicalization.ts +128 -183
- package/scripts/verify-sticky-viewport-showcase.ts +620 -93
- package/src/async/job-manager.ts +430 -46
- package/src/config/model-profiles.ts +8 -0
- package/src/config/settings-schema.ts +17 -3
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +2 -0
- package/src/extensibility/extensions/runner.ts +80 -6
- package/src/extensibility/extensions/wrapper.ts +22 -15
- package/src/extensibility/runtime-skill-discovery.ts +4 -6
- package/src/gjc-runtime/launch-tmux.ts +309 -293
- package/src/gjc-runtime/managed-owner-supervisor.ts +6 -2
- package/src/gjc-runtime/psmux-detect.ts +52 -6
- package/src/gjc-runtime/team-launch.ts +50 -2
- package/src/gjc-runtime/team-runtime.ts +716 -251
- package/src/gjc-runtime/team-store.ts +25 -7
- package/src/gjc-runtime/team-workers.ts +161 -1
- package/src/gjc-runtime/tmux-common.ts +16 -4
- package/src/gjc-runtime/tmux-gc.ts +37 -5
- package/src/gjc-runtime/tmux-owner-isolation.ts +2 -0
- package/src/gjc-runtime/tmux-provider-context.ts +451 -0
- package/src/gjc-runtime/tmux-sessions.ts +409 -156
- package/src/gjc-runtime/ultragoal-change-set.ts +90 -44
- package/src/gjc-runtime/ultragoal-receipt-freshness.ts +7 -0
- package/src/gjc-runtime/ultragoal-runtime.ts +360 -156
- package/src/internal-urls/docs-index.generated.ts +4 -4
- package/src/internal-urls/local-protocol.ts +39 -18
- package/src/modes/acp/acp-agent.ts +27 -13
- package/src/modes/components/gjc-bundle-settings.ts +2 -0
- package/src/modes/components/plugin-settings.ts +5 -0
- package/src/modes/components/settings-selector.ts +4 -0
- package/src/modes/controllers/selector-controller.ts +1 -0
- package/src/prompts/tools/monitor.md +4 -4
- package/src/sdk/broker/broker.ts +93 -10
- package/src/sdk/broker/lifecycle-ledger.ts +227 -11
- package/src/sdk/broker/lifecycle.ts +691 -92
- package/src/sdk/bus/chat-daemon-control.ts +30 -6
- package/src/sdk/bus/index.ts +23 -6
- package/src/sdk/bus/telegram-daemon-contract.ts +2 -2
- package/src/sdk/bus/telegram-daemon.ts +283 -44
- package/src/sdk/bus/topic-registry.ts +133 -10
- package/src/sdk/session.ts +7 -6
- package/src/session/agent-session.ts +752 -339
- package/src/session/attempt-record-store.ts +106 -0
- package/src/session/internal/managed-session-scope.ts +252 -67
- package/src/session/internal/managed-session-storage.ts +1 -0
- package/src/session/session-manager.ts +7 -0
- package/src/session/session-storage.ts +146 -24
- package/src/task/index.ts +230 -19
- package/src/task/provider-retry-status.ts +4 -1
- package/src/task/receipt.ts +2 -0
- package/src/task/types.ts +10 -0
- package/src/tools/monitor.ts +7 -1
- package/src/tools/output-meta.ts +10 -2
- package/src/tools/subagent.ts +97 -75
- package/src/tools/todo-write.ts +47 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { AttemptScope, AttemptScopeAuthority } from "@gajae-code/agent-core/attempt-scope";
|
|
2
|
+
|
|
3
|
+
export type AttemptExecutionState = "unknown" | "clean" | "executed";
|
|
4
|
+
|
|
5
|
+
interface AttemptRecord {
|
|
6
|
+
readonly scope: AttemptScope;
|
|
7
|
+
state: AttemptExecutionState;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type RetireCapableAuthority = AttemptScopeAuthority & {
|
|
11
|
+
unregisterSide?: (lineage: AttemptScope["lineage"]) => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const RECORD_LRU_CAP = 1024;
|
|
15
|
+
|
|
16
|
+
function scopeKey(scope: AttemptScope): string {
|
|
17
|
+
return `${scope.lineage}:${scope.attemptId}:${scope.generation}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Tracks whether an attempt has had an extension handler delivered to it.
|
|
22
|
+
*
|
|
23
|
+
* Records are deliberately established in two phases: allocation registers an
|
|
24
|
+
* `unknown` record, then the session marks it `clean` immediately before the
|
|
25
|
+
* first handler-capable delivery can occur. The runner changes a clean record
|
|
26
|
+
* to `executed` immediately before invoking its first handler.
|
|
27
|
+
*/
|
|
28
|
+
export class AttemptRecordStore {
|
|
29
|
+
readonly #authority: RetireCapableAuthority;
|
|
30
|
+
readonly #records = new Map<string, AttemptRecord>();
|
|
31
|
+
|
|
32
|
+
constructor(authority: AttemptScopeAuthority) {
|
|
33
|
+
this.#authority = authority;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
register(scope: AttemptScope): boolean {
|
|
37
|
+
if (!this.#authority.isCurrent(scope)) return false;
|
|
38
|
+
const key = scopeKey(scope);
|
|
39
|
+
const existing = this.#records.get(key);
|
|
40
|
+
if (existing) {
|
|
41
|
+
this.#touch(key, existing);
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
this.#records.set(key, { scope, state: "unknown" });
|
|
45
|
+
this.#evictIfNeeded();
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
establishClean(scope: AttemptScope): boolean {
|
|
50
|
+
if (!this.#authority.isCurrent(scope)) return false;
|
|
51
|
+
const key = scopeKey(scope);
|
|
52
|
+
const record = this.#records.get(key);
|
|
53
|
+
if (!record) return false;
|
|
54
|
+
if (record.state === "unknown") record.state = "clean";
|
|
55
|
+
if (record.state === "clean") this.#touch(key, record);
|
|
56
|
+
return record.state === "clean";
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
markExecuted(scope: AttemptScope): boolean {
|
|
60
|
+
if (!this.#authority.isCurrent(scope)) return false;
|
|
61
|
+
const key = scopeKey(scope);
|
|
62
|
+
const record = this.#records.get(key);
|
|
63
|
+
if (!record) return false;
|
|
64
|
+
if (record.state === "executed") {
|
|
65
|
+
this.#touch(key, record);
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
if (record.state !== "clean") return false;
|
|
69
|
+
record.state = "executed";
|
|
70
|
+
this.#touch(key, record);
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
isClean(scope: AttemptScope): boolean {
|
|
75
|
+
if (!this.#authority.isCurrent(scope)) return false;
|
|
76
|
+
return this.#records.get(scopeKey(scope))?.state === "clean";
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
retire(scope: AttemptScope): boolean {
|
|
80
|
+
const key = scopeKey(scope);
|
|
81
|
+
const deleted = this.#records.delete(key);
|
|
82
|
+
if (scope.lineage !== "main") this.#authority.unregisterSide?.(scope.lineage);
|
|
83
|
+
return deleted;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#touch(key: string, record: AttemptRecord): void {
|
|
87
|
+
this.#records.delete(key);
|
|
88
|
+
this.#records.set(key, record);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
#evictIfNeeded(): void {
|
|
92
|
+
while (this.#records.size > RECORD_LRU_CAP) {
|
|
93
|
+
const oldest = this.#records.keys().next().value as string | undefined;
|
|
94
|
+
if (oldest === undefined) return;
|
|
95
|
+
const record = this.#records.get(oldest);
|
|
96
|
+
if (!record) {
|
|
97
|
+
this.#records.delete(oldest);
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
// Never evict a record whose scope is still current (live attempt).
|
|
101
|
+
if (this.#authority.isCurrent(record.scope)) break;
|
|
102
|
+
this.#records.delete(oldest);
|
|
103
|
+
if (record.scope.lineage !== "main") this.#authority.unregisterSide?.(record.scope.lineage);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|