@slopus/happy-agent-base 0.0.0 → 0.0.2

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 (99) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +640 -15
  3. package/dist/Agent.d.ts +86 -0
  4. package/dist/Agent.d.ts.map +1 -0
  5. package/dist/Agent.js +326 -0
  6. package/dist/Agent.js.map +1 -0
  7. package/dist/AgentBase.d.ts +340 -0
  8. package/dist/AgentBase.d.ts.map +1 -0
  9. package/dist/AgentBase.js +2295 -0
  10. package/dist/AgentBase.js.map +1 -0
  11. package/dist/AgentBaseHooks.d.ts +156 -0
  12. package/dist/AgentBaseHooks.d.ts.map +1 -0
  13. package/dist/AgentBaseHooks.js +2 -0
  14. package/dist/AgentBaseHooks.js.map +1 -0
  15. package/dist/AgentBasePending.d.ts +49 -0
  16. package/dist/AgentBasePending.d.ts.map +1 -0
  17. package/dist/AgentBasePending.js +73 -0
  18. package/dist/AgentBasePending.js.map +1 -0
  19. package/dist/AgentBaseState.d.ts +13 -0
  20. package/dist/AgentBaseState.d.ts.map +1 -0
  21. package/dist/AgentBaseState.js +2 -0
  22. package/dist/AgentBaseState.js.map +1 -0
  23. package/dist/AgentBaseStoreLock.d.ts +16 -0
  24. package/dist/AgentBaseStoreLock.d.ts.map +1 -0
  25. package/dist/AgentBaseStoreLock.js +37 -0
  26. package/dist/AgentBaseStoreLock.js.map +1 -0
  27. package/dist/AgentConfig.d.ts +67 -0
  28. package/dist/AgentConfig.d.ts.map +1 -0
  29. package/dist/AgentConfig.js +81 -0
  30. package/dist/AgentConfig.js.map +1 -0
  31. package/dist/AgentContexts.d.ts +40 -0
  32. package/dist/AgentContexts.d.ts.map +1 -0
  33. package/dist/AgentContexts.js +70 -0
  34. package/dist/AgentContexts.js.map +1 -0
  35. package/dist/AgentFeature.d.ts +119 -0
  36. package/dist/AgentFeature.d.ts.map +1 -0
  37. package/dist/AgentFeature.js +2 -0
  38. package/dist/AgentFeature.js.map +1 -0
  39. package/dist/AgentFeatureAction.d.ts +16 -0
  40. package/dist/AgentFeatureAction.d.ts.map +1 -0
  41. package/dist/AgentFeatureAction.js +2 -0
  42. package/dist/AgentFeatureAction.js.map +1 -0
  43. package/dist/AgentKV.d.ts +63 -0
  44. package/dist/AgentKV.d.ts.map +1 -0
  45. package/dist/AgentKV.js +122 -0
  46. package/dist/AgentKV.js.map +1 -0
  47. package/dist/AgentModel.d.ts +17 -0
  48. package/dist/AgentModel.d.ts.map +1 -0
  49. package/dist/AgentModel.js +2 -0
  50. package/dist/AgentModel.js.map +1 -0
  51. package/dist/AgentPersistence.d.ts +95 -0
  52. package/dist/AgentPersistence.d.ts.map +1 -0
  53. package/dist/AgentPersistence.js +2 -0
  54. package/dist/AgentPersistence.js.map +1 -0
  55. package/dist/AgentProviders.d.ts +22 -0
  56. package/dist/AgentProviders.d.ts.map +1 -0
  57. package/dist/AgentProviders.js +35 -0
  58. package/dist/AgentProviders.js.map +1 -0
  59. package/dist/AgentRef.d.ts +41 -0
  60. package/dist/AgentRef.d.ts.map +1 -0
  61. package/dist/AgentRef.js +60 -0
  62. package/dist/AgentRef.js.map +1 -0
  63. package/dist/AgentStorage.d.ts +19 -0
  64. package/dist/AgentStorage.d.ts.map +1 -0
  65. package/dist/AgentStorage.js +16 -0
  66. package/dist/AgentStorage.js.map +1 -0
  67. package/dist/AgentSystem.d.ts +50 -0
  68. package/dist/AgentSystem.d.ts.map +1 -0
  69. package/dist/AgentSystem.js +2 -0
  70. package/dist/AgentSystem.js.map +1 -0
  71. package/dist/AgentSystemContext.d.ts +15 -0
  72. package/dist/AgentSystemContext.d.ts.map +1 -0
  73. package/dist/AgentSystemContext.js +20 -0
  74. package/dist/AgentSystemContext.js.map +1 -0
  75. package/dist/AgentSystemLocal.d.ts +103 -0
  76. package/dist/AgentSystemLocal.d.ts.map +1 -0
  77. package/dist/AgentSystemLocal.js +282 -0
  78. package/dist/AgentSystemLocal.js.map +1 -0
  79. package/dist/AgentSystemRef.d.ts +56 -0
  80. package/dist/AgentSystemRef.d.ts.map +1 -0
  81. package/dist/AgentSystemRef.js +75 -0
  82. package/dist/AgentSystemRef.js.map +1 -0
  83. package/dist/AgentTaskContext.d.ts +17 -0
  84. package/dist/AgentTaskContext.d.ts.map +1 -0
  85. package/dist/AgentTaskContext.js +26 -0
  86. package/dist/AgentTaskContext.js.map +1 -0
  87. package/dist/AgentTool.d.ts +87 -0
  88. package/dist/AgentTool.d.ts.map +1 -0
  89. package/dist/AgentTool.js +5 -0
  90. package/dist/AgentTool.js.map +1 -0
  91. package/dist/index.d.ts +24 -1
  92. package/dist/index.d.ts.map +1 -1
  93. package/dist/index.js +31 -1
  94. package/dist/index.js.map +1 -1
  95. package/dist/models.d.ts +62 -0
  96. package/dist/models.d.ts.map +1 -0
  97. package/dist/models.js +185 -0
  98. package/dist/models.js.map +1 -0
  99. package/package.json +44 -37
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentBase.js","sourceRoot":"","sources":["../sources/AgentBase.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EACH,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,YAAY,GAGf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACH,sBAAsB,EACtB,uBAAuB,GAG1B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EA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AS,gBAAgB,CAAC,YAAoB,EAAE,KAA8B;IAC1E,OAAO,sBAAsB,CAAC;QAC1B,YAAY;QACZ,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI;YACT,IAAI,CAAC,SAAS,IAAI,IAAI;YACtB,IAAI,CAAC,oBAAoB,IAAI,IAAI;YACjC,IAAI,CAAC,WAAW,IAAI,IAAI;YACxB,IAAI,CAAC,UAAU,IAAI,IAAI;YACvB,IAAI,CAAC,KAAK,IAAI,IAAI;YAClB,IAAI,CAAC,MAAM,IAAI,IAAI;YACnB,IAAI,CAAC,OAAO,IAAI,IAAI;SACvB,CAAC;KACL,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,156 @@
1
+ import type { BaseProvider, SessionDoneState, SessionEvent, SessionSystemMessage, SessionTokens } from "@slopus/happy-providers";
2
+ import type { Context } from "@steve.kite/stdlib";
3
+ import type { AgentFeatureAction } from "./AgentFeatureAction.js";
4
+ import type { AgentProviders } from "./AgentProviders.js";
5
+ import type { AnyAgentTool } from "./AgentTool.js";
6
+ /** A value or a promise of it; every hook may answer either synchronously or asynchronously. */
7
+ export type MaybePromise<Value> = Value | Promise<Value>;
8
+ /** What the `modelChanged` hook sees when a consumed message changes the effective model. */
9
+ export interface AgentBaseModelChange {
10
+ /** The model in force before this change, absent when none had been set yet. */
11
+ readonly previousModel: string | undefined;
12
+ /** The model now in force. */
13
+ readonly model: string;
14
+ /** The registry ID of the provider serving the previous model. */
15
+ readonly previousProvider: string;
16
+ /** The registry ID of the provider serving the new model. */
17
+ readonly provider: string;
18
+ /** The registry the agent resolves its providers from. */
19
+ readonly providers: AgentProviders;
20
+ /** The live instance behind `previousProvider`, or null when no longer registered. */
21
+ readonly previousProviderInstance: BaseProvider | null;
22
+ /** The live instance behind `provider`, or null when not registered. */
23
+ readonly providerInstance: BaseProvider | null;
24
+ /** True when the change was incompatible and the conversation history was erased. */
25
+ readonly wasReset: boolean;
26
+ }
27
+ /** What the `afterInference` hook sees about the response that just completed. */
28
+ export interface AgentBaseInference {
29
+ /** How the response ended, or undefined when the stream ended without a done event. */
30
+ readonly state: SessionDoneState | undefined;
31
+ /**
32
+ * The real token counts the provider reported for this response: the complete input context
33
+ * it received plus the output it generated. Absent when the response was cancelled, failed,
34
+ * or ended without a done event, since no count was measured.
35
+ */
36
+ readonly tokens: SessionTokens | undefined;
37
+ /** The failure text of a provider-reported error response. */
38
+ readonly errorMessage?: string;
39
+ }
40
+ /** What `beforeTurn` sees about the conversation the turn is about to run on. */
41
+ export interface AgentBaseTurnStart {
42
+ /**
43
+ * The true size of the conversation context in tokens, as the provider last measured it:
44
+ * the complete input it received plus the output it generated. It is durable, so it
45
+ * survives a restart, and it is cleared whenever the conversation is replaced — by a
46
+ * compaction or by a reset — until the next response measures the new one. Absent only
47
+ * before any response has been measured.
48
+ */
49
+ readonly contextTokens: number | undefined;
50
+ }
51
+ /** What `afterTurn` sees about the turn that just ended. */
52
+ export interface AgentBaseTurn extends AgentBaseTurnStart {
53
+ /**
54
+ * True when the turn was cancelled by `abort`. The work it had already done stays in the
55
+ * history, but it stopped early, so a feature should generally not act on it.
56
+ */
57
+ readonly aborted: boolean;
58
+ }
59
+ /**
60
+ * One validated tool invocation offered to an around-execution correctness hook.
61
+ *
62
+ * A wrapper calls `execute` to continue to the next wrapper and, ultimately, the tool. Repeated
63
+ * calls join the same execution rather than repeating side effects.
64
+ */
65
+ export interface AgentBaseToolExecution {
66
+ /** The ID the model attached to this call, used to match its eventual result back to it. */
67
+ readonly callId: string;
68
+ /** The tool definition the call resolved to. */
69
+ readonly tool: AnyAgentTool;
70
+ /** The call's arguments, already parsed from JSON but not yet validated against the schema. */
71
+ readonly arguments: unknown;
72
+ /** Continue to the next wrapper and, ultimately, the tool itself. */
73
+ readonly execute: () => Promise<unknown>;
74
+ }
75
+ /**
76
+ * Optional observation points. A hook must never fail or delay the run. Every hook receives the
77
+ * agent's context, which carries the provider, model, and effort readable through
78
+ * `agentProvider`, `agentModel`, and `agentEffort`.
79
+ */
80
+ export interface AgentBaseHooks {
81
+ /** Called for every session event the provider emits, for observation only. */
82
+ readonly onEvent?: (ctx: Context, event: SessionEvent) => void;
83
+ /**
84
+ * Extends `state.instructions` for the session, consulted before each inference and
85
+ * compaction. This is a correctness hook: a failure fails the turn loudly instead of
86
+ * silently running with a wrong prompt.
87
+ */
88
+ readonly instructions?: (ctx: Context) => MaybePromise<string>;
89
+ /**
90
+ * Extends `state.tools` for the session, consulted before each inference and tool
91
+ * execution. This is a correctness hook: a failure — including duplicate tool names in
92
+ * the merged list — fails the turn loudly instead of silently running with wrong tools.
93
+ * When the merged descriptors change between inferences, the provider session is
94
+ * recreated so the model sees the current tools.
95
+ */
96
+ readonly tools?: (ctx: Context) => MaybePromise<readonly AnyAgentTool[]>;
97
+ /**
98
+ * Wraps execution after the tool exists and its JSON arguments pass runtime validation.
99
+ * This is a correctness hook: a failure becomes that call's error result. The hook must call
100
+ * `execution.execute()` to continue; omitting it deliberately replaces the execution, while
101
+ * repeated calls join the same downstream work.
102
+ */
103
+ readonly aroundToolExecution?: (ctx: Context, execution: AgentBaseToolExecution) => MaybePromise<unknown>;
104
+ /**
105
+ * Called when a consumed message changes the effective model. An incompatible change —
106
+ * judged by the provider-model compatibility matrix — erases the conversation history
107
+ * completely and destroys the old provider session; the handoff system message this hook
108
+ * returns is then injected at the very beginning of the fresh context, and without one the
109
+ * context starts completely empty. On a compatible change the history stays and the return
110
+ * value is ignored. A hook failure during an incompatible change rejects the switch: the
111
+ * previous selection stays effective and the history is not cleared.
112
+ */
113
+ readonly modelChanged?: (ctx: Context, change: AgentBaseModelChange) => MaybePromise<SessionSystemMessage | undefined>;
114
+ /** Called when the loop leaves the settled state and begins working. */
115
+ readonly beforeAgentLoop?: (ctx: Context) => MaybePromise<void>;
116
+ /**
117
+ * Called at the start of each turn, before its queues drain, with the conversation's
118
+ * measured size. Returned actions are applied before the turn runs, so a `compact` action
119
+ * here compacts the conversation the turn is about to send — never a context left
120
+ * mid-tool-call by the previous turn.
121
+ */
122
+ readonly beforeTurn?: (ctx: Context, turn: AgentBaseTurnStart) => MaybePromise<readonly AgentFeatureAction[] | undefined>;
123
+ /** Called immediately before each inference request. */
124
+ readonly beforeInference?: (ctx: Context) => MaybePromise<void>;
125
+ /**
126
+ * Called immediately after each inference response is collected, with how it ended and the
127
+ * token counts the provider measured for it.
128
+ */
129
+ readonly afterInference?: (ctx: Context, inference: AgentBaseInference) => MaybePromise<void>;
130
+ /**
131
+ * Called when a turn ends, with the conversation's measured size and whether the turn was
132
+ * cancelled. Returned actions are all applied together before the loop continues; any of
133
+ * them drives the loop into another turn.
134
+ */
135
+ readonly afterTurn?: (ctx: Context, turn: AgentBaseTurn) => MaybePromise<readonly AgentFeatureAction[] | undefined>;
136
+ /**
137
+ * Called when the loop would settle back to idle. Returned actions are all applied together
138
+ * and start the work over instead of settling.
139
+ */
140
+ readonly afterAgentLoop?: (ctx: Context) => MaybePromise<readonly AgentFeatureAction[] | undefined>;
141
+ /**
142
+ * Called inside the transaction that settles the agent, before the settlement commits. The
143
+ * key-value store on the context writes into that same transaction, so a conclusion about
144
+ * the run and the fact that the run is over become durable together, without a second commit
145
+ * a crash could land between. The `Transact` suffix is what marks this: a hook carrying it
146
+ * runs inside a transaction, and everything it writes commits or rolls back with it.
147
+ *
148
+ * Unlike the observing hooks, a failure here is not swallowed. It rolls the settlement back,
149
+ * leaving the agent recorded as still working, because a conclusion that failed to be
150
+ * written must not be reported as one that was. The store handle is lent for the call only.
151
+ */
152
+ readonly afterAgentSettledTransact?: (ctx: Context) => MaybePromise<void>;
153
+ /** Called once after the loop has fully settled and no feature reopened it. */
154
+ readonly afterAgentSettled?: (ctx: Context) => MaybePromise<void>;
155
+ }
156
+ //# sourceMappingURL=AgentBaseHooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentBaseHooks.d.ts","sourceRoot":"","sources":["../sources/AgentBaseHooks.ts"],"names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BaseHooks.js","sourceRoot":"","sources":["../sources/AgentBaseHooks.ts"],"names":[],"mappings":""}
@@ -0,0 +1,49 @@
1
+ import { type Static } from "@sinclair/typebox";
2
+ import type { Context } from "@steve.kite/stdlib";
3
+ import type { AgentPersistence } from "./AgentPersistence.js";
4
+ /**
5
+ * The one key an agent's outstanding work lives under, in the agent's own store. It is a single
6
+ * key rather than a prefix of many, because what it records is one fact — that this agent has
7
+ * something left to do — and two keys could disagree about it.
8
+ */
9
+ export declare const AGENT_BASE_PENDING_KEY = "owed";
10
+ /**
11
+ * Where a run stopped, and so what has to happen to carry it on. The stage is what a restart
12
+ * reads instead of guessing the answer from the shape of the conversation: a transcript ending
13
+ * in a user message may be a question nobody answered or a response that had nothing to say,
14
+ * and only the run that stopped knows which.
15
+ */
16
+ export declare const AgentBasePendingStage: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"inference">, import("@sinclair/typebox").TLiteral<"tools">, import("@sinclair/typebox").TLiteral<"compaction">]>;
17
+ export type AgentBasePendingStage = Static<typeof AgentBasePendingStage>;
18
+ /**
19
+ * The agent's outstanding work, as the run itself recorded it. Its presence is the whole of the
20
+ * active flag: a stored record means the agent has work left, and the absence of one means it
21
+ * settled. The run erases it on the way out, so an agent that stopped without erasing it — a
22
+ * process that died mid-turn — is discovered as owing exactly what it was doing.
23
+ */
24
+ export declare const AgentBasePendingState: import("@sinclair/typebox").TObject<{
25
+ stage: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"inference">, import("@sinclair/typebox").TLiteral<"tools">, import("@sinclair/typebox").TLiteral<"compaction">]>;
26
+ }>;
27
+ export type AgentBasePendingState = Static<typeof AgentBasePendingState>;
28
+ /**
29
+ * Read one store's pending state, or undefined when it holds none. Anything stored under the key
30
+ * that is not a pending state is treated as no pending state at all: a store this agent cannot
31
+ * make sense of must not be able to strand an identity in a stage that will never be carried out.
32
+ */
33
+ export declare function agentBasePendingStateOf(ctx: Context, persistence: AgentPersistence): Promise<AgentBasePendingState | undefined>;
34
+ /**
35
+ * Whether one agent's store has work left, asked from outside the agent. This is the question an
36
+ * owner starting up needs answered — which identities are worth resuming — and the one it needs
37
+ * again before declaring an identity finished.
38
+ *
39
+ * Two things count. A pending record means a run was under way and has not erased it, either
40
+ * because it is still running somewhere or because it died. A conversation whose last record is
41
+ * a consumed message, a tool result, or a failure note is owed a response whoever is meant to
42
+ * give it, and that outlives any one process — which is what makes it discoverable at all by an
43
+ * owner that has never seen the run.
44
+ *
45
+ * The caller is responsible for holding the store still; a half-applied step of some owner reads
46
+ * as a whole one otherwise.
47
+ */
48
+ export declare function agentBaseStoreOwesWork(ctx: Context, persistence: AgentPersistence): Promise<boolean>;
49
+ //# sourceMappingURL=AgentBasePending.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentBasePending.d.ts","sourceRoot":"","sources":["../sources/AgentBasePending.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,4LAOhC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;EAEhC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEzE;;;;GAIG;AACH,wBAAsB,uBAAuB,CACzC,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,gBAAgB,GAC9B,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAM5C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,sBAAsB,CACxC,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,gBAAgB,GAC9B,OAAO,CAAC,OAAO,CAAC,CASlB"}
@@ -0,0 +1,73 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { Value } from "@sinclair/typebox/value";
3
+ /**
4
+ * The one key an agent's outstanding work lives under, in the agent's own store. It is a single
5
+ * key rather than a prefix of many, because what it records is one fact — that this agent has
6
+ * something left to do — and two keys could disagree about it.
7
+ */
8
+ export const AGENT_BASE_PENDING_KEY = "owed";
9
+ /**
10
+ * Where a run stopped, and so what has to happen to carry it on. The stage is what a restart
11
+ * reads instead of guessing the answer from the shape of the conversation: a transcript ending
12
+ * in a user message may be a question nobody answered or a response that had nothing to say,
13
+ * and only the run that stopped knows which.
14
+ */
15
+ export const AgentBasePendingStage = Type.Union([
16
+ /** An inference request is owed: a message was consumed, or tool results completed. */
17
+ Type.Literal("inference"),
18
+ /** A dispatched tool batch has not delivered all of its results. */
19
+ Type.Literal("tools"),
20
+ /** The conversation is being replaced by the provider's summary of it. */
21
+ Type.Literal("compaction"),
22
+ ]);
23
+ /**
24
+ * The agent's outstanding work, as the run itself recorded it. Its presence is the whole of the
25
+ * active flag: a stored record means the agent has work left, and the absence of one means it
26
+ * settled. The run erases it on the way out, so an agent that stopped without erasing it — a
27
+ * process that died mid-turn — is discovered as owing exactly what it was doing.
28
+ */
29
+ export const AgentBasePendingState = Type.Object({
30
+ stage: AgentBasePendingStage,
31
+ });
32
+ /**
33
+ * Read one store's pending state, or undefined when it holds none. Anything stored under the key
34
+ * that is not a pending state is treated as no pending state at all: a store this agent cannot
35
+ * make sense of must not be able to strand an identity in a stage that will never be carried out.
36
+ */
37
+ export async function agentBasePendingStateOf(ctx, persistence) {
38
+ const entries = await persistence.readValues(ctx, AGENT_BASE_PENDING_KEY);
39
+ const stored = entries.find((entry) => entry.key === AGENT_BASE_PENDING_KEY)?.value;
40
+ if (stored === undefined)
41
+ return undefined;
42
+ if (!Value.Check(AgentBasePendingState, stored))
43
+ return undefined;
44
+ return stored;
45
+ }
46
+ /**
47
+ * Whether one agent's store has work left, asked from outside the agent. This is the question an
48
+ * owner starting up needs answered — which identities are worth resuming — and the one it needs
49
+ * again before declaring an identity finished.
50
+ *
51
+ * Two things count. A pending record means a run was under way and has not erased it, either
52
+ * because it is still running somewhere or because it died. A conversation whose last record is
53
+ * a consumed message, a tool result, or a failure note is owed a response whoever is meant to
54
+ * give it, and that outlives any one process — which is what makes it discoverable at all by an
55
+ * owner that has never seen the run.
56
+ *
57
+ * The caller is responsible for holding the store still; a half-applied step of some owner reads
58
+ * as a whole one otherwise.
59
+ */
60
+ export async function agentBaseStoreOwesWork(ctx, persistence) {
61
+ if ((await agentBasePendingStateOf(ctx, persistence)) !== undefined)
62
+ return true;
63
+ const records = await persistence.load(ctx);
64
+ const last = records[records.length - 1];
65
+ if (last === undefined)
66
+ return false;
67
+ if (last.type === "user" || last.type === "tool" || last.type === "system")
68
+ return true;
69
+ // A replacement is not a question in itself, but it keeps the suffix that joined after its
70
+ // snapshot, and only the rewrite that wrote it knows whether that suffix ends in a request.
71
+ return last.type === "compaction" && last.continuesInference === true;
72
+ }
73
+ //# sourceMappingURL=AgentBasePending.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentBasePending.js","sourceRoot":"","sources":["../sources/AgentBasePending.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAKhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,KAAK,CAAC;IAC5C,uFAAuF;IACvF,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;IACzB,oEAAoE;IACpE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IACrB,0EAA0E;IAC1E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A4F;IAC5F,OAAO,IAAI,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,kBAAkB,KAAK,IAAI,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { AnyAgentTool } from "./AgentTool.js";
2
+ /**
3
+ * The mutable configuration of a running agent. The constructor copies the provided initial
4
+ * state into the agent's own `state`, which may then be mutated directly; every inference reads
5
+ * the current values.
6
+ */
7
+ export interface AgentBaseState {
8
+ /** The base system instructions for the session; hooks may extend this before inference. */
9
+ instructions: string;
10
+ /** The base tools offered to the model; hooks may extend this before inference or a call. */
11
+ tools: AnyAgentTool[];
12
+ }
13
+ //# sourceMappingURL=AgentBaseState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentBaseState.d.ts","sourceRoot":"","sources":["../sources/AgentBaseState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC3B,4FAA4F;IAC5F,YAAY,EAAE,MAAM,CAAC;IACrB,6FAA6F;IAC7F,KAAK,EAAE,YAAY,EAAE,CAAC;CACzB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AgentBaseState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentBaseState.js","sourceRoot":"","sources":["../sources/AgentBaseState.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import { type AsyncLock, type Context } from "@steve.kite/stdlib";
2
+ import type { AgentPersistence } from "./AgentPersistence.js";
3
+ /**
4
+ * A fresh lock for one owner of a store, remembered as belonging to that store. Two owners over
5
+ * one store are genuinely concurrent — that is what makes the store, rather than any one owner's
6
+ * memory, the authority — so each gets its own lock and neither waits for the other.
7
+ */
8
+ export declare function agentBaseStoreLock(persistence: AgentPersistence): AsyncLock;
9
+ /**
10
+ * Run work with every owner of a store holding still. This is for the questions asked about a
11
+ * store from outside it — whether it owes work, or erasing it once its identity is gone — where
12
+ * a half-applied step of some owner would be read as a whole one. Owners only ever take their
13
+ * own lock, so taking all of them in one fixed order cannot deadlock against them.
14
+ */
15
+ export declare function agentBaseWithStoreStill<Result>(ctx: Context, persistence: AgentPersistence, work: (ctx: Context) => Promise<Result>): Promise<Result>;
16
+ //# sourceMappingURL=AgentBaseStoreLock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentBaseStoreLock.d.ts","sourceRoot":"","sources":["../sources/AgentBaseStoreLock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAK9D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,gBAAgB,GAAG,SAAS,CAS3E;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAAC,MAAM,EAChD,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,gBAAgB,EAC7B,IAAI,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,GACxC,OAAO,CAAC,MAAM,CAAC,CASjB"}
@@ -0,0 +1,37 @@
1
+ import { asyncLock } from "@steve.kite/stdlib";
2
+ /** Every lock handed out for a store, so `agentBaseWithStoreStill` can find and hold them all. */
3
+ const owners = new WeakMap();
4
+ /**
5
+ * A fresh lock for one owner of a store, remembered as belonging to that store. Two owners over
6
+ * one store are genuinely concurrent — that is what makes the store, rather than any one owner's
7
+ * memory, the authority — so each gets its own lock and neither waits for the other.
8
+ */
9
+ export function agentBaseStoreLock(persistence) {
10
+ const created = asyncLock({ reentry: "block" });
11
+ const existing = owners.get(persistence);
12
+ if (existing === undefined) {
13
+ owners.set(persistence, [created]);
14
+ }
15
+ else {
16
+ existing.push(created);
17
+ }
18
+ return created;
19
+ }
20
+ /**
21
+ * Run work with every owner of a store holding still. This is for the questions asked about a
22
+ * store from outside it — whether it owes work, or erasing it once its identity is gone — where
23
+ * a half-applied step of some owner would be read as a whole one. Owners only ever take their
24
+ * own lock, so taking all of them in one fixed order cannot deadlock against them.
25
+ */
26
+ export async function agentBaseWithStoreStill(ctx, persistence, work) {
27
+ const held = [...(owners.get(persistence) ?? [])];
28
+ /** Take the next lock in `held` and recurse, running `work` once every owner is held. */
29
+ const enter = async (index, entered) => {
30
+ const lock = held[index];
31
+ if (lock === undefined)
32
+ return await work(entered);
33
+ return await lock.runInLock(entered, (lockCtx) => enter(index + 1, lockCtx));
34
+ };
35
+ return await enter(0, ctx);
36
+ }
37
+ //# sourceMappingURL=AgentBaseStoreLock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentBaseStoreLock.js","sourceRoot":"","sources":["../sources/AgentBaseStoreLock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgC,MAAM,oBAAoB,CAAC;AAI7E,kGAAkG;AAClG,MAAM,MAAM,GAAG,IAAI,OAAO,EAAiC,CAAC;AAE5D;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAA6B;IAC5D,MAAM,OAAO,GAAG,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACzC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACvC,CAAC;SAAM,CAAC;QACJ,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CACzC,GAAY,EACZ,WAA6B,EAC7B,IAAuC;IAEvC,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAClD,yFAAyF;IACzF,MAAM,KAAK,GAAG,KAAK,EAAE,KAAa,EAAE,OAAgB,EAAmB,EAAE;QACrE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;QACnD,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IACjF,CAAC,CAAC;IACF,OAAO,MAAM,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { type Static } from "@sinclair/typebox";
2
+ import { type Context } from "@steve.kite/stdlib";
3
+ /** The operating systems Node reports, mirroring `NodeJS.Platform`. */
4
+ export declare const agentPlatformSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"aix">, import("@sinclair/typebox").TLiteral<"android">, import("@sinclair/typebox").TLiteral<"cygwin">, import("@sinclair/typebox").TLiteral<"darwin">, import("@sinclair/typebox").TLiteral<"freebsd">, import("@sinclair/typebox").TLiteral<"haiku">, import("@sinclair/typebox").TLiteral<"linux">, import("@sinclair/typebox").TLiteral<"netbsd">, import("@sinclair/typebox").TLiteral<"openbsd">, import("@sinclair/typebox").TLiteral<"sunos">, import("@sinclair/typebox").TLiteral<"win32">]>;
5
+ /** The TypeScript type inferred from {@link agentPlatformSchema}. */
6
+ export type AgentPlatform = Static<typeof agentPlatformSchema>;
7
+ /**
8
+ * The settings one feature was configured with. The agent never looks inside: a feature owns
9
+ * the shape of its own entry and validates it against its own schema.
10
+ */
11
+ export declare const agentFeatureConfigSchema: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
12
+ /** The TypeScript type inferred from {@link agentFeatureConfigSchema}. */
13
+ export type AgentFeatureConfig = Static<typeof agentFeatureConfigSchema>;
14
+ /**
15
+ * The machine an agent works on. It is all or nothing: an agent either knows its environment
16
+ * completely or not at all, so nothing it is told about the machine is ever half-true.
17
+ */
18
+ export declare const agentEnvironmentSchema: import("@sinclair/typebox").TObject<{
19
+ /** The operating system release, as a human-readable version string. */
20
+ osVersion: import("@sinclair/typebox").TString;
21
+ /** The operating system the agent runs on. */
22
+ platform: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"aix">, import("@sinclair/typebox").TLiteral<"android">, import("@sinclair/typebox").TLiteral<"cygwin">, import("@sinclair/typebox").TLiteral<"darwin">, import("@sinclair/typebox").TLiteral<"freebsd">, import("@sinclair/typebox").TLiteral<"haiku">, import("@sinclair/typebox").TLiteral<"linux">, import("@sinclair/typebox").TLiteral<"netbsd">, import("@sinclair/typebox").TLiteral<"openbsd">, import("@sinclair/typebox").TLiteral<"sunos">, import("@sinclair/typebox").TLiteral<"win32">]>;
23
+ /** The absolute path the agent's work is rooted at. */
24
+ workingDirectory: import("@sinclair/typebox").TString;
25
+ /** The shell the agent's commands run in, such as `/bin/zsh`. */
26
+ shell: import("@sinclair/typebox").TString;
27
+ }>;
28
+ /** The TypeScript type inferred from {@link agentEnvironmentSchema}. */
29
+ export type AgentEnvironment = Static<typeof agentEnvironmentSchema>;
30
+ /**
31
+ * What an agent was created with: the environment it works on, when it has one, and one opaque
32
+ * settings map per feature, keyed by the feature's name. The configuration is static for the
33
+ * agent's whole life and is persisted when the agent is created, so a later process resolves
34
+ * the very same agent it was created as.
35
+ */
36
+ export declare const agentConfigSchema: import("@sinclair/typebox").TObject<{
37
+ /** The machine this agent was told it works on, when it was told anything at all. */
38
+ environment: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
39
+ /** The operating system release, as a human-readable version string. */
40
+ osVersion: import("@sinclair/typebox").TString;
41
+ /** The operating system the agent runs on. */
42
+ platform: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"aix">, import("@sinclair/typebox").TLiteral<"android">, import("@sinclair/typebox").TLiteral<"cygwin">, import("@sinclair/typebox").TLiteral<"darwin">, import("@sinclair/typebox").TLiteral<"freebsd">, import("@sinclair/typebox").TLiteral<"haiku">, import("@sinclair/typebox").TLiteral<"linux">, import("@sinclair/typebox").TLiteral<"netbsd">, import("@sinclair/typebox").TLiteral<"openbsd">, import("@sinclair/typebox").TLiteral<"sunos">, import("@sinclair/typebox").TLiteral<"win32">]>;
43
+ /** The absolute path the agent's work is rooted at. */
44
+ workingDirectory: import("@sinclair/typebox").TString;
45
+ /** The shell the agent's commands run in, such as `/bin/zsh`. */
46
+ shell: import("@sinclair/typebox").TString;
47
+ }>>;
48
+ /** Per-feature settings, keyed by feature name; each entry is opaque to the agent. */
49
+ features: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>>;
50
+ }>;
51
+ /** The TypeScript type inferred from {@link agentConfigSchema}. */
52
+ export type AgentConfig = Static<typeof agentConfigSchema>;
53
+ /**
54
+ * The environment this process is running in, ready to be handed to an agent at creation. The
55
+ * platform is typed, so a Node release reporting an unknown platform fails to compile rather
56
+ * than slipping into a persisted configuration; an unset `SHELL` reports as no shell at all.
57
+ */
58
+ export declare function currentAgentEnvironment(): AgentEnvironment;
59
+ /** Carry the configuration an agent was created with; every hook and tool reads it back. */
60
+ export declare function withAgentConfig(ctx: Context, config: AgentConfig): Context;
61
+ /** The configuration of the agent owning this context, when one was attached. */
62
+ export declare function agentConfig(ctx: Context): AgentConfig | undefined;
63
+ /** The environment of the agent owning this context, when it was created with one. */
64
+ export declare function agentEnvironment(ctx: Context): AgentEnvironment | undefined;
65
+ /** The opaque settings the named feature was configured with, if it was configured at all. */
66
+ export declare function agentFeatureConfig(ctx: Context, name: string): AgentFeatureConfig | undefined;
67
+ //# sourceMappingURL=AgentConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentConfig.d.ts","sourceRoot":"","sources":["../sources/AgentConfig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAA0B,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE1E,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,kjBAY9B,CAAC;AAEH,qEAAqE;AACrE,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,wBAAwB,gHAA6C,CAAC;AAEnF,0EAA0E;AAC1E,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEzE;;;GAGG;AACH,eAAO,MAAM,sBAAsB;IAC/B,wEAAwE;;IAExE,8CAA8C;;IAE9C,uDAAuD;;IAEvD,iEAAiE;;EAEnE,CAAC;AAEH,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAErE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;IAC1B,qFAAqF;;QApBrF,wEAAwE;;QAExE,8CAA8C;;QAE9C,uDAAuD;;QAEvD,iEAAiE;;;IAgBjE,sFAAsF;;EAExF,CAAC;AAEH,mEAAmE;AACnE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,gBAAgB,CAQ1D;AAQD,4FAA4F;AAC5F,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAE1E;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,W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