@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.
Files changed (91) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +4 -1
  3. package/dist/types/async/job-manager.d.ts +36 -1
  4. package/dist/types/extensibility/extensions/runner.d.ts +9 -7
  5. package/dist/types/gjc-runtime/launch-tmux.d.ts +22 -3
  6. package/dist/types/gjc-runtime/psmux-detect.d.ts +3 -0
  7. package/dist/types/gjc-runtime/team-launch.d.ts +3 -1
  8. package/dist/types/gjc-runtime/team-runtime.d.ts +14 -2
  9. package/dist/types/gjc-runtime/team-store.d.ts +0 -4
  10. package/dist/types/gjc-runtime/team-workers.d.ts +5 -0
  11. package/dist/types/gjc-runtime/tmux-common.d.ts +1 -0
  12. package/dist/types/gjc-runtime/tmux-provider-context.d.ts +57 -0
  13. package/dist/types/gjc-runtime/tmux-sessions.d.ts +8 -1
  14. package/dist/types/gjc-runtime/ultragoal-change-set.d.ts +3 -0
  15. package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +21 -4
  16. package/dist/types/modes/components/gjc-bundle-settings.d.ts +1 -0
  17. package/dist/types/modes/components/plugin-settings.d.ts +2 -0
  18. package/dist/types/modes/components/settings-selector.d.ts +2 -0
  19. package/dist/types/sdk/broker/broker.d.ts +18 -0
  20. package/dist/types/sdk/broker/lifecycle-ledger.d.ts +13 -0
  21. package/dist/types/sdk/broker/lifecycle.d.ts +1 -0
  22. package/dist/types/sdk/bus/chat-daemon-control.d.ts +2 -3
  23. package/dist/types/sdk/bus/index.d.ts +4 -0
  24. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +2 -2
  25. package/dist/types/sdk/bus/telegram-daemon.d.ts +25 -3
  26. package/dist/types/sdk/bus/topic-registry.d.ts +63 -3
  27. package/dist/types/session/agent-session.d.ts +5 -4
  28. package/dist/types/session/attempt-record-store.d.ts +19 -0
  29. package/dist/types/session/session-manager.d.ts +1 -0
  30. package/dist/types/session/session-storage.d.ts +8 -0
  31. package/dist/types/task/receipt.d.ts +1 -0
  32. package/dist/types/task/types.d.ts +43 -0
  33. package/dist/types/tools/subagent.d.ts +15 -0
  34. package/dist/types/tools/todo-write.d.ts +3 -0
  35. package/package.json +8 -8
  36. package/scripts/capture-sticky-viewport-showcase.ts +131 -5
  37. package/scripts/verify-gjc-sdk-canonicalization.ts +128 -183
  38. package/scripts/verify-sticky-viewport-showcase.ts +620 -93
  39. package/src/async/job-manager.ts +430 -46
  40. package/src/config/model-profiles.ts +8 -0
  41. package/src/config/settings-schema.ts +17 -3
  42. package/src/defaults/gjc/skills/ultragoal/SKILL.md +2 -0
  43. package/src/extensibility/extensions/runner.ts +80 -6
  44. package/src/extensibility/extensions/wrapper.ts +22 -15
  45. package/src/extensibility/runtime-skill-discovery.ts +4 -6
  46. package/src/gjc-runtime/launch-tmux.ts +309 -293
  47. package/src/gjc-runtime/managed-owner-supervisor.ts +6 -2
  48. package/src/gjc-runtime/psmux-detect.ts +52 -6
  49. package/src/gjc-runtime/team-launch.ts +50 -2
  50. package/src/gjc-runtime/team-runtime.ts +716 -251
  51. package/src/gjc-runtime/team-store.ts +25 -7
  52. package/src/gjc-runtime/team-workers.ts +161 -1
  53. package/src/gjc-runtime/tmux-common.ts +16 -4
  54. package/src/gjc-runtime/tmux-gc.ts +37 -5
  55. package/src/gjc-runtime/tmux-owner-isolation.ts +2 -0
  56. package/src/gjc-runtime/tmux-provider-context.ts +451 -0
  57. package/src/gjc-runtime/tmux-sessions.ts +409 -156
  58. package/src/gjc-runtime/ultragoal-change-set.ts +90 -44
  59. package/src/gjc-runtime/ultragoal-receipt-freshness.ts +7 -0
  60. package/src/gjc-runtime/ultragoal-runtime.ts +360 -156
  61. package/src/internal-urls/docs-index.generated.ts +4 -4
  62. package/src/internal-urls/local-protocol.ts +39 -18
  63. package/src/modes/acp/acp-agent.ts +27 -13
  64. package/src/modes/components/gjc-bundle-settings.ts +2 -0
  65. package/src/modes/components/plugin-settings.ts +5 -0
  66. package/src/modes/components/settings-selector.ts +4 -0
  67. package/src/modes/controllers/selector-controller.ts +1 -0
  68. package/src/prompts/tools/monitor.md +4 -4
  69. package/src/sdk/broker/broker.ts +93 -10
  70. package/src/sdk/broker/lifecycle-ledger.ts +227 -11
  71. package/src/sdk/broker/lifecycle.ts +691 -92
  72. package/src/sdk/bus/chat-daemon-control.ts +30 -6
  73. package/src/sdk/bus/index.ts +23 -6
  74. package/src/sdk/bus/telegram-daemon-contract.ts +2 -2
  75. package/src/sdk/bus/telegram-daemon.ts +283 -44
  76. package/src/sdk/bus/topic-registry.ts +133 -10
  77. package/src/sdk/session.ts +7 -6
  78. package/src/session/agent-session.ts +752 -339
  79. package/src/session/attempt-record-store.ts +106 -0
  80. package/src/session/internal/managed-session-scope.ts +252 -67
  81. package/src/session/internal/managed-session-storage.ts +1 -0
  82. package/src/session/session-manager.ts +7 -0
  83. package/src/session/session-storage.ts +146 -24
  84. package/src/task/index.ts +230 -19
  85. package/src/task/provider-retry-status.ts +4 -1
  86. package/src/task/receipt.ts +2 -0
  87. package/src/task/types.ts +10 -0
  88. package/src/tools/monitor.ts +7 -1
  89. package/src/tools/output-meta.ts +10 -2
  90. package/src/tools/subagent.ts +97 -75
  91. 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
+ }