@xandreed/core 0.4.0 → 0.11.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/README.md +1 -1
- package/dist/conformance.entity.d.ts +15 -0
- package/dist/conformance.entity.js +7 -0
- package/dist/decision-record.entity.d.ts +23 -23
- package/dist/decision-record.entity.functions.d.ts +6 -0
- package/dist/decision-record.entity.functions.js +3 -0
- package/dist/decision-record.entity.js +4 -4
- package/dist/domain/agent-failure.entity.d.ts +6 -6
- package/dist/domain/agent-failure.entity.js +12 -1
- package/dist/domain/failure.entity.d.ts +2 -2
- package/dist/domain/loop-event.entity.d.ts +2 -0
- package/dist/domain/message.entity.d.ts +143 -156
- package/dist/domain/message.entity.js +6 -6
- package/dist/domain/model-call-policy.entity.d.ts +3 -3
- package/dist/domain/model-call-policy.entity.js +1 -1
- package/dist/domain/model-catalog.entity.d.ts +4 -4
- package/dist/domain/model-catalog.entity.js +1 -1
- package/dist/domain/model-selection.entity.d.ts +6 -13
- package/dist/domain/prompt-provenance.entity.d.ts +6 -6
- package/dist/domain/prompt-provenance.entity.js +4 -4
- package/dist/domain/token-usage.entity.d.ts +4 -4
- package/dist/harness/capability.entity.d.ts +88 -41
- package/dist/harness/capability.entity.functions.d.ts +30 -1
- package/dist/harness/capability.entity.functions.js +55 -2
- package/dist/harness/capability.entity.js +33 -12
- package/dist/harness/config.entity.d.ts +28 -28
- package/dist/harness/config.entity.js +4 -4
- package/dist/harness/plugin-stack.adapter.d.ts +24 -0
- package/dist/harness/plugin-stack.adapter.js +8 -0
- package/dist/harness/plugin-stack.adapter.test.d.ts +1 -0
- package/dist/harness/plugin.adapter.d.ts +15 -4
- package/dist/harness/plugin.adapter.js +18 -11
- package/dist/harness/plugin.adapter.test.d.ts +1 -0
- package/dist/harness/plugin.entity.d.ts +26 -10
- package/dist/harness/plugin.entity.js +1 -1
- package/dist/harness/session.entity.d.ts +20 -20
- package/dist/harness/session.entity.js +1 -1
- package/dist/harness/skill-files.d.ts +17 -0
- package/dist/harness/skill-files.js +25 -0
- package/dist/index.d.ts +47 -4
- package/dist/index.js +45 -4
- package/dist/loop/cacheKey.d.ts +3 -3
- package/dist/loop/cacheKey.js +4 -2
- package/dist/loop/mapping.d.ts +4 -5
- package/dist/loop/mapping.js +8 -16
- package/dist/loop/modelPolicy.d.ts +4 -4
- package/dist/loop/modelPolicy.js +2 -2
- package/dist/loop/promptProvenance.d.ts +2 -2
- package/dist/loop/promptProvenance.js +2 -2
- package/dist/loop/stepContext.d.ts +2 -2
- package/dist/loop/stepContext.js +2 -2
- package/dist/loop/streamFold.js +3 -3
- package/dist/loop/toolSchema.d.ts +17 -0
- package/dist/loop/toolSchema.js +25 -0
- package/dist/loop/toolSchema.test.d.ts +1 -0
- package/dist/mcp/bridge.d.ts +15 -15
- package/dist/mcp/bridge.js +14 -14
- package/dist/memory/memory-log.entity.d.ts +320 -0
- package/dist/memory/memory-log.entity.functions.d.ts +89 -0
- package/dist/memory/memory-log.entity.functions.js +180 -0
- package/dist/memory/memory-log.entity.js +75 -0
- package/dist/memory/memory-log.entity.test.d.ts +1 -0
- package/dist/memory/memory-session.d.ts +51 -0
- package/dist/memory/memory-session.js +97 -0
- package/dist/memory/memory-session.test.d.ts +1 -0
- package/dist/memory/memory.conformance.d.ts +32 -0
- package/dist/memory/memory.conformance.js +102 -0
- package/dist/ports/auth-store.port.d.ts +16 -18
- package/dist/ports/auth-store.port.js +13 -9
- package/dist/ports/capability.port.d.ts +131 -7
- package/dist/ports/capability.port.js +2 -2
- package/dist/ports/conversation-store.port.d.ts +54 -177
- package/dist/ports/conversation-store.port.js +9 -9
- package/dist/ports/file-system.port.d.ts +5 -7
- package/dist/ports/file-system.port.js +1 -1
- package/dist/ports/harness.port.d.ts +19 -13
- package/dist/ports/harness.port.js +10 -10
- package/dist/ports/mcp-client.port.d.ts +15 -47
- package/dist/ports/mcp-client.port.js +3 -3
- package/dist/ports/memory.port.d.ts +116 -0
- package/dist/ports/memory.port.js +7 -0
- package/dist/ports/model-catalog.port.d.ts +1 -1
- package/dist/ports/model-catalog.port.js +1 -1
- package/dist/ports/permission.port.d.ts +10 -0
- package/dist/ports/permission.port.js +4 -0
- package/dist/ports/run-context.port.d.ts +28 -0
- package/dist/ports/run-context.port.js +4 -0
- package/dist/ports/session-log.port.d.ts +25 -0
- package/dist/ports/session-log.port.js +4 -0
- package/dist/ports/sessions.port.d.ts +141 -0
- package/dist/ports/sessions.port.js +4 -0
- package/dist/ports/settings-store.port.d.ts +18 -56
- package/dist/ports/settings-store.port.js +3 -3
- package/dist/ports/shell.port.d.ts +9 -21
- package/dist/ports/shell.port.js +1 -1
- package/dist/ports/step-loop.port.d.ts +85 -0
- package/dist/ports/step-loop.port.js +4 -0
- package/dist/ports/tasks.port.d.ts +59 -0
- package/dist/ports/tasks.port.js +10 -0
- package/dist/ports/tool-registry.port.d.ts +53 -0
- package/dist/ports/tool-registry.port.js +4 -0
- package/dist/ports/turn-admission.port.d.ts +23 -0
- package/dist/ports/turn-admission.port.js +4 -0
- package/dist/ports/turn-events.port.d.ts +55 -0
- package/dist/ports/turn-events.port.js +7 -0
- package/dist/ports/turn-scope.port.d.ts +101 -0
- package/dist/ports/turn-scope.port.js +10 -0
- package/dist/ports/turn.port.d.ts +113 -0
- package/dist/ports/turn.port.js +0 -0
- package/dist/ports/utility-llm.port.d.ts +12 -31
- package/dist/ports/utility-llm.port.js +1 -1
- package/dist/session/chassis.js +7 -7
- package/dist/session/session-event.entity.d.ts +55 -0
- package/dist/session/session-event.entity.functions.d.ts +31 -0
- package/dist/session/session-event.entity.functions.js +42 -0
- package/dist/session/session-event.entity.js +37 -0
- package/dist/session/session-event.entity.test.d.ts +1 -0
- package/dist/session/session-log.conformance.d.ts +13 -0
- package/dist/session/session-log.conformance.js +167 -0
- package/dist/session/session-log.entity.d.ts +164 -0
- package/dist/session/session-log.entity.js +82 -0
- package/dist/session/session-log.memory.adapter.d.ts +7 -0
- package/dist/session/session-log.memory.adapter.js +82 -0
- package/dist/session/session-log.memory.adapter.test.d.ts +1 -0
- package/dist/session/sessions.entity.d.ts +201 -0
- package/dist/session/sessions.entity.js +98 -0
- package/dist/session/tasks.entity.d.ts +39 -0
- package/dist/session/tasks.entity.js +26 -0
- package/dist/session/turn-admission.open.adapter.d.ts +4 -0
- package/dist/session/turn-admission.open.adapter.js +3 -0
- package/dist/spec/SpecDoc.d.ts +30 -117
- package/dist/spec/SpecDoc.js +10 -10
- package/dist/spec/codec.js +1 -1
- package/dist/turn/model-request.entity.d.ts +99 -0
- package/dist/turn/model-request.entity.functions.d.ts +108 -0
- package/dist/turn/model-request.entity.functions.js +167 -0
- package/dist/turn/model-request.entity.js +41 -0
- package/dist/turn/model-request.entity.test.d.ts +1 -0
- package/dist/turn/prompt-sections.d.ts +10 -0
- package/dist/turn/prompt-sections.js +3 -0
- package/dist/turn/step-loop.conformance.d.ts +16 -0
- package/dist/turn/step-loop.conformance.js +164 -0
- package/dist/turn/testing.d.ts +30 -0
- package/dist/turn/turn-bus.d.ts +23 -0
- package/dist/turn/turn-bus.js +54 -0
- package/dist/turn/turn-bus.test.d.ts +1 -0
- package/dist/turn/turn-event.entity.d.ts +263 -0
- package/dist/turn/turn-event.entity.functions.d.ts +35 -0
- package/dist/turn/turn-event.entity.functions.js +21 -0
- package/dist/turn/turn-event.entity.js +101 -0
- package/dist/turn/turn-lifecycle.d.ts +32 -0
- package/dist/turn/turn-lifecycle.js +48 -0
- package/dist/turn/turn-run.d.ts +26 -0
- package/dist/turn/turn-run.js +105 -0
- package/dist/turn/turn.adapter.d.ts +21 -0
- package/dist/turn/turn.adapter.js +126 -0
- package/dist/turn/turn.adapter.test.d.ts +1 -0
- package/dist/turn/turn.conformance.d.ts +20 -0
- package/dist/turn/turn.conformance.js +74 -0
- package/dist/turn/user-message.entity.d.ts +14 -0
- package/dist/turn/user-message.entity.js +10 -0
- package/dist/util/json.d.ts +2 -2
- package/dist/util/json.js +10 -10
- package/package.json +3 -3
|
@@ -2,206 +2,80 @@ import { Context, Option, Schema } from "effect";
|
|
|
2
2
|
import type { Effect } from "effect";
|
|
3
3
|
import { AgentMessage, ConversationId } from "../domain/message.entity.js";
|
|
4
4
|
import type { Checkpoint } from "../domain/message.entity.js";
|
|
5
|
-
declare const StoreError_base: Schema.
|
|
6
|
-
readonly
|
|
7
|
-
}
|
|
8
|
-
message: typeof Schema.String;
|
|
9
|
-
}>;
|
|
5
|
+
declare const StoreError_base: Schema.Class<StoreError, Schema.TaggedStruct<"StoreError", {
|
|
6
|
+
readonly message: Schema.String;
|
|
7
|
+
}>, import("effect/Cause").YieldableError>;
|
|
10
8
|
export declare class StoreError extends StoreError_base {
|
|
11
9
|
}
|
|
12
|
-
declare const RunOutcomeRecord_base: Schema.Class<RunOutcomeRecord, {
|
|
13
|
-
conversationId: Schema.brand<
|
|
14
|
-
/** Epoch millis. */
|
|
15
|
-
at: typeof Schema.Number;
|
|
16
|
-
outcome: Schema.Literal<["ok", "partial"]>;
|
|
17
|
-
reason: Schema.Literal<["completed", "step-cap", "degenerate-loop"]>;
|
|
18
|
-
}, Schema.Struct.Encoded<{
|
|
19
|
-
conversationId: Schema.brand<typeof Schema.UUID, "ConversationId">;
|
|
10
|
+
declare const RunOutcomeRecord_base: Schema.Class<RunOutcomeRecord, Schema.Struct<{
|
|
11
|
+
readonly conversationId: Schema.brand<Schema.String, "ConversationId">;
|
|
20
12
|
/** Epoch millis. */
|
|
21
|
-
at:
|
|
22
|
-
outcome: Schema.
|
|
23
|
-
reason: Schema.
|
|
24
|
-
}>,
|
|
25
|
-
readonly at: number;
|
|
26
|
-
} & {
|
|
27
|
-
readonly conversationId: string & import("effect/Brand").Brand<"ConversationId">;
|
|
28
|
-
} & {
|
|
29
|
-
readonly outcome: "ok" | "partial";
|
|
30
|
-
} & {
|
|
31
|
-
readonly reason: "completed" | "step-cap" | "degenerate-loop";
|
|
32
|
-
}, {}, {}>;
|
|
13
|
+
readonly at: Schema.Number;
|
|
14
|
+
readonly outcome: Schema.Literals<readonly ["ok", "partial"]>;
|
|
15
|
+
readonly reason: Schema.Literals<readonly ["completed", "step-cap", "degenerate-loop"]>;
|
|
16
|
+
}>, {}>;
|
|
33
17
|
/** How a run ENDED — persisted beside the trail so the database alone says
|
|
34
18
|
* whether the last run completed on its own or was stopped by the step cap
|
|
35
19
|
* or the degenerate-loop breaker (the loop's `agent_end` was in-memory only). */
|
|
36
20
|
export declare class RunOutcomeRecord extends RunOutcomeRecord_base {
|
|
37
21
|
}
|
|
38
|
-
declare const ConversationSummary_base: Schema.Class<ConversationSummary, {
|
|
39
|
-
id: Schema.brand<
|
|
40
|
-
createdAt:
|
|
41
|
-
firstPrompt: Schema.
|
|
42
|
-
|
|
43
|
-
}>;
|
|
44
|
-
title: Schema.optionalWith<typeof Schema.String, {
|
|
45
|
-
as: "Option";
|
|
46
|
-
}>;
|
|
47
|
-
/** The latest recorded run outcome, when a run has finished in it. */
|
|
48
|
-
lastOutcome: Schema.optionalWith<Schema.Struct<{
|
|
49
|
-
outcome: Schema.Literal<["ok", "partial"]>;
|
|
50
|
-
reason: Schema.Literal<["completed", "step-cap", "degenerate-loop"]>;
|
|
51
|
-
}>, {
|
|
52
|
-
as: "Option";
|
|
53
|
-
}>;
|
|
54
|
-
}, Schema.Struct.Encoded<{
|
|
55
|
-
id: Schema.brand<typeof Schema.UUID, "ConversationId">;
|
|
56
|
-
createdAt: typeof Schema.Number;
|
|
57
|
-
firstPrompt: Schema.optionalWith<typeof Schema.String, {
|
|
58
|
-
as: "Option";
|
|
59
|
-
}>;
|
|
60
|
-
title: Schema.optionalWith<typeof Schema.String, {
|
|
61
|
-
as: "Option";
|
|
62
|
-
}>;
|
|
22
|
+
declare const ConversationSummary_base: Schema.Class<ConversationSummary, Schema.Struct<{
|
|
23
|
+
readonly id: Schema.brand<Schema.String, "ConversationId">;
|
|
24
|
+
readonly createdAt: Schema.Number;
|
|
25
|
+
readonly firstPrompt: Schema.OptionFromOptional<Schema.String>;
|
|
26
|
+
readonly title: Schema.OptionFromOptional<Schema.String>;
|
|
63
27
|
/** The latest recorded run outcome, when a run has finished in it. */
|
|
64
|
-
lastOutcome: Schema.
|
|
65
|
-
outcome: Schema.
|
|
66
|
-
reason: Schema.
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
}>;
|
|
70
|
-
}>, never, {
|
|
71
|
-
readonly createdAt: number;
|
|
72
|
-
} & {
|
|
73
|
-
readonly id: string & import("effect/Brand").Brand<"ConversationId">;
|
|
74
|
-
} & {
|
|
75
|
-
readonly firstPrompt: Option.Option<string>;
|
|
76
|
-
} & {
|
|
77
|
-
readonly title: Option.Option<string>;
|
|
78
|
-
} & {
|
|
79
|
-
readonly lastOutcome: Option.Option<{
|
|
80
|
-
readonly outcome: "ok" | "partial";
|
|
81
|
-
readonly reason: "completed" | "step-cap" | "degenerate-loop";
|
|
82
|
-
}>;
|
|
83
|
-
}, {}, {}>;
|
|
28
|
+
readonly lastOutcome: Schema.OptionFromOptional<Schema.Struct<{
|
|
29
|
+
readonly outcome: Schema.Literals<readonly ["ok", "partial"]>;
|
|
30
|
+
readonly reason: Schema.Literals<readonly ["completed", "step-cap", "degenerate-loop"]>;
|
|
31
|
+
}>>;
|
|
32
|
+
}>, {}>;
|
|
84
33
|
export declare class ConversationSummary extends ConversationSummary_base {
|
|
85
34
|
}
|
|
86
|
-
declare const StoredMessage_base: Schema.Class<StoredMessage, {
|
|
87
|
-
position:
|
|
88
|
-
message: Schema.Union<[Schema.Struct<{
|
|
89
|
-
role: Schema.Literal<
|
|
90
|
-
content:
|
|
91
|
-
providerOptions: Schema.optional<
|
|
35
|
+
declare const StoredMessage_base: Schema.Class<StoredMessage, Schema.Struct<{
|
|
36
|
+
readonly position: Schema.Int;
|
|
37
|
+
readonly message: Schema.Union<readonly [Schema.Struct<{
|
|
38
|
+
readonly role: Schema.Literal<"user">;
|
|
39
|
+
readonly content: Schema.String;
|
|
40
|
+
readonly providerOptions: Schema.optional<Schema.Unknown>;
|
|
92
41
|
}>, Schema.Struct<{
|
|
93
|
-
role: Schema.Literal<
|
|
94
|
-
content: Schema
|
|
95
|
-
type: Schema.Literal<
|
|
96
|
-
text:
|
|
97
|
-
providerOptions: Schema.optional<
|
|
42
|
+
readonly role: Schema.Literal<"assistant">;
|
|
43
|
+
readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
44
|
+
readonly type: Schema.Literal<"text">;
|
|
45
|
+
readonly text: Schema.String;
|
|
46
|
+
readonly providerOptions: Schema.optional<Schema.Unknown>;
|
|
98
47
|
}>, Schema.Struct<{
|
|
99
|
-
type: Schema.Literal<
|
|
100
|
-
text:
|
|
101
|
-
providerOptions: Schema.optional<
|
|
48
|
+
readonly type: Schema.Literal<"reasoning">;
|
|
49
|
+
readonly text: Schema.String;
|
|
50
|
+
readonly providerOptions: Schema.optional<Schema.Unknown>;
|
|
102
51
|
}>, Schema.Struct<{
|
|
103
|
-
type: Schema.Literal<
|
|
104
|
-
toolCallId: Schema.brand<
|
|
105
|
-
toolName:
|
|
106
|
-
input:
|
|
107
|
-
providerOptions: Schema.optional<
|
|
108
|
-
providerExecuted: Schema.optional<
|
|
52
|
+
readonly type: Schema.Literal<"tool-call">;
|
|
53
|
+
readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
|
|
54
|
+
readonly toolName: Schema.String;
|
|
55
|
+
readonly input: Schema.Unknown;
|
|
56
|
+
readonly providerOptions: Schema.optional<Schema.Unknown>;
|
|
57
|
+
readonly providerExecuted: Schema.optional<Schema.Boolean>;
|
|
109
58
|
}>]>>;
|
|
110
|
-
providerOptions: Schema.optional<
|
|
59
|
+
readonly providerOptions: Schema.optional<Schema.Unknown>;
|
|
111
60
|
}>, Schema.Struct<{
|
|
112
|
-
role: Schema.Literal<
|
|
113
|
-
content: Schema
|
|
114
|
-
type: Schema.Literal<
|
|
115
|
-
toolCallId: Schema.brand<
|
|
116
|
-
toolName:
|
|
117
|
-
output:
|
|
118
|
-
providerOptions: Schema.optional<
|
|
119
|
-
isError: Schema.optional<
|
|
61
|
+
readonly role: Schema.Literal<"tool">;
|
|
62
|
+
readonly content: Schema.$Array<Schema.Struct<{
|
|
63
|
+
readonly type: Schema.Literal<"tool-result">;
|
|
64
|
+
readonly toolCallId: Schema.brand<Schema.String, "ToolCallId">;
|
|
65
|
+
readonly toolName: Schema.String;
|
|
66
|
+
readonly output: Schema.Unknown;
|
|
67
|
+
readonly providerOptions: Schema.optional<Schema.Unknown>;
|
|
68
|
+
readonly isError: Schema.optional<Schema.Boolean>;
|
|
120
69
|
}>>;
|
|
121
|
-
providerOptions: Schema.optional<
|
|
70
|
+
readonly providerOptions: Schema.optional<Schema.Unknown>;
|
|
122
71
|
}>]>;
|
|
123
|
-
}
|
|
124
|
-
position: typeof Schema.Int;
|
|
125
|
-
message: Schema.Union<[Schema.Struct<{
|
|
126
|
-
role: Schema.Literal<["user"]>;
|
|
127
|
-
content: typeof Schema.String;
|
|
128
|
-
providerOptions: Schema.optional<typeof Schema.Unknown>;
|
|
129
|
-
}>, Schema.Struct<{
|
|
130
|
-
role: Schema.Literal<["assistant"]>;
|
|
131
|
-
content: Schema.Array$<Schema.Union<[Schema.Struct<{
|
|
132
|
-
type: Schema.Literal<["text"]>;
|
|
133
|
-
text: typeof Schema.String;
|
|
134
|
-
providerOptions: Schema.optional<typeof Schema.Unknown>;
|
|
135
|
-
}>, Schema.Struct<{
|
|
136
|
-
type: Schema.Literal<["reasoning"]>;
|
|
137
|
-
text: typeof Schema.String;
|
|
138
|
-
providerOptions: Schema.optional<typeof Schema.Unknown>;
|
|
139
|
-
}>, Schema.Struct<{
|
|
140
|
-
type: Schema.Literal<["tool-call"]>;
|
|
141
|
-
toolCallId: Schema.brand<typeof Schema.String, "ToolCallId">;
|
|
142
|
-
toolName: typeof Schema.String;
|
|
143
|
-
input: typeof Schema.Unknown;
|
|
144
|
-
providerOptions: Schema.optional<typeof Schema.Unknown>;
|
|
145
|
-
providerExecuted: Schema.optional<typeof Schema.Boolean>;
|
|
146
|
-
}>]>>;
|
|
147
|
-
providerOptions: Schema.optional<typeof Schema.Unknown>;
|
|
148
|
-
}>, Schema.Struct<{
|
|
149
|
-
role: Schema.Literal<["tool"]>;
|
|
150
|
-
content: Schema.Array$<Schema.Struct<{
|
|
151
|
-
type: Schema.Literal<["tool-result"]>;
|
|
152
|
-
toolCallId: Schema.brand<typeof Schema.String, "ToolCallId">;
|
|
153
|
-
toolName: typeof Schema.String;
|
|
154
|
-
output: typeof Schema.Unknown;
|
|
155
|
-
providerOptions: Schema.optional<typeof Schema.Unknown>;
|
|
156
|
-
isError: Schema.optional<typeof Schema.Boolean>;
|
|
157
|
-
}>>;
|
|
158
|
-
providerOptions: Schema.optional<typeof Schema.Unknown>;
|
|
159
|
-
}>]>;
|
|
160
|
-
}>, never, {
|
|
161
|
-
readonly message: {
|
|
162
|
-
readonly providerOptions?: unknown;
|
|
163
|
-
readonly role: "user";
|
|
164
|
-
readonly content: string;
|
|
165
|
-
} | {
|
|
166
|
-
readonly providerOptions?: unknown;
|
|
167
|
-
readonly role: "assistant";
|
|
168
|
-
readonly content: readonly ({
|
|
169
|
-
readonly type: "text";
|
|
170
|
-
readonly text: string;
|
|
171
|
-
readonly providerOptions?: unknown;
|
|
172
|
-
} | {
|
|
173
|
-
readonly type: "reasoning";
|
|
174
|
-
readonly text: string;
|
|
175
|
-
readonly providerOptions?: unknown;
|
|
176
|
-
} | {
|
|
177
|
-
readonly type: "tool-call";
|
|
178
|
-
readonly providerOptions?: unknown;
|
|
179
|
-
readonly toolCallId: string & import("effect/Brand").Brand<"ToolCallId">;
|
|
180
|
-
readonly toolName: string;
|
|
181
|
-
readonly input: unknown;
|
|
182
|
-
readonly providerExecuted?: boolean | undefined;
|
|
183
|
-
})[];
|
|
184
|
-
} | {
|
|
185
|
-
readonly providerOptions?: unknown;
|
|
186
|
-
readonly role: "tool";
|
|
187
|
-
readonly content: readonly {
|
|
188
|
-
readonly type: "tool-result";
|
|
189
|
-
readonly providerOptions?: unknown;
|
|
190
|
-
readonly toolCallId: string & import("effect/Brand").Brand<"ToolCallId">;
|
|
191
|
-
readonly toolName: string;
|
|
192
|
-
readonly output: unknown;
|
|
193
|
-
readonly isError?: boolean | undefined;
|
|
194
|
-
}[];
|
|
195
|
-
};
|
|
196
|
-
} & {
|
|
197
|
-
readonly position: number;
|
|
198
|
-
}, {}, {}>;
|
|
72
|
+
}>, {}>;
|
|
199
73
|
/** A persisted row WITH its durable position — what the active window is
|
|
200
74
|
* made of, so a loader never reconstructs positions by arithmetic (an
|
|
201
75
|
* undecodable row in between would shift every later one). */
|
|
202
76
|
export declare class StoredMessage extends StoredMessage_base {
|
|
203
77
|
}
|
|
204
|
-
declare const ConversationStore_base: Context.
|
|
78
|
+
declare const ConversationStore_base: Context.ServiceClass<ConversationStore, "@xandreed/core/ConversationStore", {
|
|
205
79
|
readonly create: (workspaceDir?: string) => Effect.Effect<ConversationId, StoreError>;
|
|
206
80
|
readonly append: (id: ConversationId, message: AgentMessage) => Effect.Effect<number, StoreError>;
|
|
207
81
|
/** One turn's rows land TOGETHER or not at all — an assistant tool call
|
|
@@ -235,6 +109,9 @@ declare const ConversationStore_base: Context.TagClass<ConversationStore, "@xand
|
|
|
235
109
|
readonly prune: (beforeEpochMs: number) => Effect.Effect<number, StoreError>;
|
|
236
110
|
}>;
|
|
237
111
|
/**
|
|
112
|
+
* @deprecated Positional compatibility projection over SessionLog. New composable
|
|
113
|
+
* hosts use Sessions, TurnWriter and ConversationMemory directly.
|
|
114
|
+
*
|
|
238
115
|
* The conversation persistence port. Positions are the durable identity:
|
|
239
116
|
* `append` assigns a monotonic, immutable absolute position per conversation,
|
|
240
117
|
* and UIs key their blocks on it so a live-streamed block and a later
|
|
@@ -9,20 +9,20 @@ export class StoreError extends Schema.TaggedError()("StoreError", {
|
|
|
9
9
|
export class RunOutcomeRecord extends Schema.Class("RunOutcomeRecord")({
|
|
10
10
|
conversationId: ConversationId,
|
|
11
11
|
at: Schema.Number,
|
|
12
|
-
outcome: Schema.
|
|
13
|
-
reason: Schema.
|
|
12
|
+
outcome: Schema.Literals(["ok", "partial"]),
|
|
13
|
+
reason: Schema.Literals(["completed", "step-cap", "degenerate-loop"])
|
|
14
14
|
}) {
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export class ConversationSummary extends Schema.Class("ConversationSummary")({
|
|
18
18
|
id: ConversationId,
|
|
19
19
|
createdAt: Schema.Number,
|
|
20
|
-
firstPrompt: Schema.
|
|
21
|
-
title: Schema.
|
|
22
|
-
lastOutcome: Schema.
|
|
23
|
-
outcome: Schema.
|
|
24
|
-
reason: Schema.
|
|
25
|
-
})
|
|
20
|
+
firstPrompt: Schema.OptionFromOptional(Schema.String),
|
|
21
|
+
title: Schema.OptionFromOptional(Schema.String),
|
|
22
|
+
lastOutcome: Schema.OptionFromOptional(Schema.Struct({
|
|
23
|
+
outcome: Schema.Literals(["ok", "partial"]),
|
|
24
|
+
reason: Schema.Literals(["completed", "step-cap", "degenerate-loop"])
|
|
25
|
+
}))
|
|
26
26
|
}) {
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,5 +32,5 @@ export class StoredMessage extends Schema.Class("StoredMessage")({
|
|
|
32
32
|
}) {
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
export class ConversationStore extends Context.
|
|
35
|
+
export class ConversationStore extends Context.Service()("@xandreed/core/ConversationStore") {
|
|
36
36
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { Context, Schema } from "effect";
|
|
2
2
|
import type { Effect } from "effect";
|
|
3
|
-
declare const FsError_base: Schema.
|
|
4
|
-
readonly
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
message: typeof Schema.String;
|
|
8
|
-
}>;
|
|
3
|
+
declare const FsError_base: Schema.Class<FsError, Schema.TaggedStruct<"FsError", {
|
|
4
|
+
readonly path: Schema.String;
|
|
5
|
+
readonly message: Schema.String;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
9
7
|
export declare class FsError extends FsError_base {
|
|
10
8
|
}
|
|
11
|
-
declare const FileSystem_base: Context.
|
|
9
|
+
declare const FileSystem_base: Context.ServiceClass<FileSystem, "@xandreed/core/FileSystem", {
|
|
12
10
|
readonly read: (path: string) => Effect.Effect<string, FsError>;
|
|
13
11
|
readonly write: (path: string, content: string) => Effect.Effect<void, FsError>;
|
|
14
12
|
readonly exists: (path: string) => Effect.Effect<boolean, FsError>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Context } from "effect";
|
|
2
2
|
import type { Effect, Option, Stream } from "effect";
|
|
3
|
-
import type { Tool, Toolkit } from "
|
|
3
|
+
import type { Tool, Toolkit } from "effect/ai";
|
|
4
4
|
import type { AgentMessage, ConversationId } from "../domain/message.entity.js";
|
|
5
5
|
import type { HarnessError } from "../harness/plugin.entity.js";
|
|
6
6
|
import type { EventBody, MemoryEntry, SessionEvent, SessionRecord } from "../harness/session.entity.js";
|
|
7
|
-
|
|
7
|
+
import type { UserMessage } from "../turn/user-message.entity.js";
|
|
8
|
+
declare const SessionStore_base: Context.ServiceClass<SessionStore, "efferent/SessionStore", {
|
|
8
9
|
readonly create: (workspace: string, profile: string) => Effect.Effect<SessionRecord, HarnessError>;
|
|
9
10
|
readonly get: (id: ConversationId) => Effect.Effect<SessionRecord, HarnessError>;
|
|
10
11
|
readonly list: (workspace: string) => Effect.Effect<ReadonlyArray<SessionRecord>, HarnessError>;
|
|
@@ -12,18 +13,23 @@ declare const SessionStore_base: Context.TagClass<SessionStore, "efferent/Sessio
|
|
|
12
13
|
readonly append: (id: ConversationId, body: EventBody) => Effect.Effect<SessionEvent, HarnessError>;
|
|
13
14
|
readonly fork: (id: ConversationId, through: number) => Effect.Effect<SessionRecord, HarnessError>;
|
|
14
15
|
}>;
|
|
16
|
+
/** @deprecated Historical event vocabulary; live adapters project it over SessionLog. New hosts use Sessions and TurnWriter. */
|
|
15
17
|
export declare class SessionStore extends SessionStore_base {
|
|
16
18
|
}
|
|
17
19
|
export interface LoopInput {
|
|
18
20
|
readonly session: SessionRecord;
|
|
19
21
|
readonly runId: string;
|
|
20
|
-
readonly
|
|
22
|
+
readonly userMessage: UserMessage;
|
|
21
23
|
readonly system: string;
|
|
22
24
|
readonly publish: (event: EventBody) => Effect.Effect<SessionEvent, HarnessError>;
|
|
23
25
|
readonly transient: (event: EventBody) => Effect.Effect<void>;
|
|
24
26
|
readonly steering: Effect.Effect<Option.Option<string>, HarnessError>;
|
|
27
|
+
/** Journal reads for memory plugins: events after `after`, filtered by name (all when empty). */
|
|
28
|
+
readonly history: (after: number, names: ReadonlyArray<string>) => Effect.Effect<ReadonlyArray<SessionEvent>, HarnessError>;
|
|
29
|
+
/** Host services the run's tools and hooks may require (data ports, per-turn models). */
|
|
30
|
+
readonly services: Context.Context<never>;
|
|
25
31
|
}
|
|
26
|
-
declare const AgentLoop_base: Context.
|
|
32
|
+
declare const AgentLoop_base: Context.ServiceClass<AgentLoop, "efferent/AgentLoop", {
|
|
27
33
|
readonly run: (input: LoopInput) => Effect.Effect<{
|
|
28
34
|
readonly text: string;
|
|
29
35
|
readonly outcome: "completed" | "partial";
|
|
@@ -31,7 +37,7 @@ declare const AgentLoop_base: Context.TagClass<AgentLoop, "efferent/AgentLoop",
|
|
|
31
37
|
}>;
|
|
32
38
|
export declare class AgentLoop extends AgentLoop_base {
|
|
33
39
|
}
|
|
34
|
-
declare const DelegateLoop_base: Context.
|
|
40
|
+
declare const DelegateLoop_base: Context.ServiceClass<DelegateLoop, "efferent/DelegateLoop", {
|
|
35
41
|
readonly run: (input: LoopInput) => Effect.Effect<{
|
|
36
42
|
readonly text: string;
|
|
37
43
|
readonly outcome: "completed" | "partial";
|
|
@@ -40,24 +46,24 @@ declare const DelegateLoop_base: Context.TagClass<DelegateLoop, "efferent/Delega
|
|
|
40
46
|
/** A workflow can delegate coding while retaining its own outer loop. */
|
|
41
47
|
export declare class DelegateLoop extends DelegateLoop_base {
|
|
42
48
|
}
|
|
43
|
-
declare const AgentTools_base: Context.
|
|
49
|
+
declare const AgentTools_base: Context.ServiceClass<AgentTools, "efferent/AgentTools", {
|
|
44
50
|
readonly toolkit: Toolkit.Toolkit<Record<string, Tool.Any>>;
|
|
45
51
|
readonly handlers: Context.Context<Tool.HandlersFor<Record<string, Tool.Any>>>;
|
|
46
52
|
readonly prompt: string;
|
|
47
53
|
}>;
|
|
48
54
|
export declare class AgentTools extends AgentTools_base {
|
|
49
55
|
}
|
|
50
|
-
declare const ActionPolicy_base: Context.
|
|
56
|
+
declare const ActionPolicy_base: Context.ServiceClass<ActionPolicy, "efferent/ActionPolicy", {
|
|
51
57
|
readonly authorize: (tool: string, input: unknown) => Effect.Effect<void, HarnessError>;
|
|
52
58
|
}>;
|
|
53
59
|
export declare class ActionPolicy extends ActionPolicy_base {
|
|
54
60
|
}
|
|
55
|
-
declare const Approval_base: Context.
|
|
61
|
+
declare const Approval_base: Context.ServiceClass<Approval, "efferent/Approval", {
|
|
56
62
|
readonly request: (description: string) => Effect.Effect<boolean, HarnessError>;
|
|
57
63
|
}>;
|
|
58
64
|
export declare class Approval extends Approval_base {
|
|
59
65
|
}
|
|
60
|
-
declare const ContextManager_base: Context.
|
|
66
|
+
declare const ContextManager_base: Context.ServiceClass<ContextManager, "efferent/ContextManager", {
|
|
61
67
|
readonly compact: (messages: ReadonlyArray<AgentMessage>, tokens: number) => Effect.Effect<Option.Option<{
|
|
62
68
|
readonly summary: string;
|
|
63
69
|
readonly keepFrom: number;
|
|
@@ -65,20 +71,20 @@ declare const ContextManager_base: Context.TagClass<ContextManager, "efferent/Co
|
|
|
65
71
|
}>;
|
|
66
72
|
export declare class ContextManager extends ContextManager_base {
|
|
67
73
|
}
|
|
68
|
-
declare const Memory_base: Context.
|
|
74
|
+
declare const Memory_base: Context.ServiceClass<Memory, "efferent/Memory", {
|
|
69
75
|
readonly recall: (workspace: string, query: string) => Effect.Effect<ReadonlyArray<MemoryEntry>, HarnessError>;
|
|
70
76
|
readonly remember: (workspace: string, text: string) => Effect.Effect<MemoryEntry, HarnessError>;
|
|
71
77
|
readonly forget: (workspace: string, id: string) => Effect.Effect<void, HarnessError>;
|
|
72
78
|
}>;
|
|
73
79
|
export declare class Memory extends Memory_base {
|
|
74
80
|
}
|
|
75
|
-
declare const SessionEnvironment_base: Context.
|
|
81
|
+
declare const SessionEnvironment_base: Context.ServiceClass<SessionEnvironment, "efferent/SessionEnvironment", {
|
|
76
82
|
readonly workspace: string;
|
|
77
83
|
readonly session?: SessionRecord;
|
|
78
84
|
}>;
|
|
79
85
|
export declare class SessionEnvironment extends SessionEnvironment_base {
|
|
80
86
|
}
|
|
81
|
-
declare const TurnHooks_base: Context.
|
|
87
|
+
declare const TurnHooks_base: Context.ServiceClass<TurnHooks, "efferent/TurnHooks", {
|
|
82
88
|
readonly before: (input: LoopInput) => Effect.Effect<LoopInput, HarnessError>;
|
|
83
89
|
readonly after: (input: LoopInput) => Effect.Effect<void, HarnessError>;
|
|
84
90
|
}>;
|
|
@@ -87,7 +93,7 @@ export declare class TurnHooks extends TurnHooks_base {
|
|
|
87
93
|
}
|
|
88
94
|
export interface SessionHandle {
|
|
89
95
|
readonly record: SessionRecord;
|
|
90
|
-
readonly use: <I, A, B, E, R>(tag: Context.
|
|
96
|
+
readonly use: <I, A, B, E, R>(tag: Context.Service<I, A>, run: (service: A) => Effect.Effect<B, E, R>) => Effect.Effect<B, E | HarnessError, R>;
|
|
91
97
|
readonly send: (text: string) => Effect.Effect<void, HarnessError>;
|
|
92
98
|
readonly steer: (text: string) => Effect.Effect<void, HarnessError>;
|
|
93
99
|
readonly interrupt: Effect.Effect<void>;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { Context } from "effect";
|
|
2
2
|
|
|
3
|
-
export class SessionStore extends Context.
|
|
3
|
+
export class SessionStore extends Context.Service()("efferent/SessionStore") {
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
export class AgentLoop extends Context.
|
|
6
|
+
export class AgentLoop extends Context.Service()("efferent/AgentLoop") {
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export class DelegateLoop extends Context.
|
|
9
|
+
export class DelegateLoop extends Context.Service()("efferent/DelegateLoop") {
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export class AgentTools extends Context.
|
|
12
|
+
export class AgentTools extends Context.Service()("efferent/AgentTools") {
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export class ActionPolicy extends Context.
|
|
15
|
+
export class ActionPolicy extends Context.Service()("efferent/ActionPolicy") {
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export class Approval extends Context.
|
|
18
|
+
export class Approval extends Context.Service()("efferent/Approval") {
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export class ContextManager extends Context.
|
|
21
|
+
export class ContextManager extends Context.Service()("efferent/ContextManager") {
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export class Memory extends Context.
|
|
24
|
+
export class Memory extends Context.Service()("efferent/Memory") {
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export class SessionEnvironment extends Context.
|
|
27
|
+
export class SessionEnvironment extends Context.Service()("efferent/SessionEnvironment") {
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export class TurnHooks extends Context.
|
|
30
|
+
export class TurnHooks extends Context.Service()("efferent/TurnHooks") {
|
|
31
31
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Context, Schema } from "effect";
|
|
2
2
|
import type { Effect } from "effect";
|
|
3
|
-
declare const McpError_base: Schema.
|
|
4
|
-
readonly
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
message: typeof Schema.String;
|
|
8
|
-
}>;
|
|
3
|
+
declare const McpError_base: Schema.Class<McpError, Schema.TaggedStruct<"McpError", {
|
|
4
|
+
readonly server: Schema.String;
|
|
5
|
+
readonly message: Schema.String;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
9
7
|
/**
|
|
10
8
|
* The MCP client port — external, user-configured tool servers surfaced to
|
|
11
9
|
* agents through the ordinary toolkit machinery (see `mcp/bridge.ts`). The
|
|
@@ -15,55 +13,25 @@ declare const McpError_base: Schema.TaggedErrorClass<McpError, "McpError", {
|
|
|
15
13
|
*/
|
|
16
14
|
export declare class McpError extends McpError_base {
|
|
17
15
|
}
|
|
18
|
-
declare const McpToolDescriptor_base: Schema.Class<McpToolDescriptor, {
|
|
19
|
-
server:
|
|
20
|
-
name:
|
|
21
|
-
description: Schema.
|
|
22
|
-
as: "Option";
|
|
23
|
-
}>;
|
|
24
|
-
/** The server's inputSchema, verbatim JSON Schema — the provider sees it
|
|
25
|
-
* unchanged through the bridge's annotation override. */
|
|
26
|
-
inputSchema: Schema.Record$<typeof Schema.String, typeof Schema.Unknown>;
|
|
27
|
-
}, Schema.Struct.Encoded<{
|
|
28
|
-
server: typeof Schema.String;
|
|
29
|
-
name: typeof Schema.String;
|
|
30
|
-
description: Schema.optionalWith<typeof Schema.String, {
|
|
31
|
-
as: "Option";
|
|
32
|
-
}>;
|
|
16
|
+
declare const McpToolDescriptor_base: Schema.Class<McpToolDescriptor, Schema.Struct<{
|
|
17
|
+
readonly server: Schema.String;
|
|
18
|
+
readonly name: Schema.String;
|
|
19
|
+
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
33
20
|
/** The server's inputSchema, verbatim JSON Schema — the provider sees it
|
|
34
21
|
* unchanged through the bridge's annotation override. */
|
|
35
|
-
inputSchema: Schema
|
|
36
|
-
}>,
|
|
37
|
-
readonly description: import("effect/Option").Option<string>;
|
|
38
|
-
} & {
|
|
39
|
-
readonly name: string;
|
|
40
|
-
} & {
|
|
41
|
-
readonly server: string;
|
|
42
|
-
} & {
|
|
43
|
-
readonly inputSchema: {
|
|
44
|
-
readonly [x: string]: unknown;
|
|
45
|
-
};
|
|
46
|
-
}, {}, {}>;
|
|
22
|
+
readonly inputSchema: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
23
|
+
}>, {}>;
|
|
47
24
|
export declare class McpToolDescriptor extends McpToolDescriptor_base {
|
|
48
25
|
}
|
|
49
|
-
declare const McpCallOutcome_base: Schema.Class<McpCallOutcome, {
|
|
50
|
-
/** MCP's in-band failure flag — bridged to failure-as-data, never thrown. */
|
|
51
|
-
isError: typeof Schema.Boolean;
|
|
52
|
-
/** structuredContent when the server sent it, else the text blocks joined. */
|
|
53
|
-
result: typeof Schema.Unknown;
|
|
54
|
-
}, Schema.Struct.Encoded<{
|
|
26
|
+
declare const McpCallOutcome_base: Schema.Class<McpCallOutcome, Schema.Struct<{
|
|
55
27
|
/** MCP's in-band failure flag — bridged to failure-as-data, never thrown. */
|
|
56
|
-
isError:
|
|
28
|
+
readonly isError: Schema.Boolean;
|
|
57
29
|
/** structuredContent when the server sent it, else the text blocks joined. */
|
|
58
|
-
result:
|
|
59
|
-
}>,
|
|
60
|
-
readonly isError: boolean;
|
|
61
|
-
} & {
|
|
62
|
-
readonly result: unknown;
|
|
63
|
-
}, {}, {}>;
|
|
30
|
+
readonly result: Schema.Unknown;
|
|
31
|
+
}>, {}>;
|
|
64
32
|
export declare class McpCallOutcome extends McpCallOutcome_base {
|
|
65
33
|
}
|
|
66
|
-
declare const McpClient_base: Context.
|
|
34
|
+
declare const McpClient_base: Context.ServiceClass<McpClient, "@xandreed/core/McpClient", {
|
|
67
35
|
/** Aggregate across every configured server — best-effort: an
|
|
68
36
|
* unreachable server contributes nothing, never a failure. */
|
|
69
37
|
readonly listTools: Effect.Effect<ReadonlyArray<McpToolDescriptor>>;
|
|
@@ -9,8 +9,8 @@ export class McpError extends Schema.TaggedError()("McpError", {
|
|
|
9
9
|
export class McpToolDescriptor extends Schema.Class("McpToolDescriptor")({
|
|
10
10
|
server: Schema.String,
|
|
11
11
|
name: Schema.String,
|
|
12
|
-
description: Schema.
|
|
13
|
-
inputSchema: Schema.Record(
|
|
12
|
+
description: Schema.OptionFromOptional(Schema.String),
|
|
13
|
+
inputSchema: Schema.Record(Schema.String, Schema.Unknown)
|
|
14
14
|
}) {
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -20,5 +20,5 @@ export class McpCallOutcome extends Schema.Class("McpCallOutcome")({
|
|
|
20
20
|
}) {
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export class McpClient extends Context.
|
|
23
|
+
export class McpClient extends Context.Service()("@xandreed/core/McpClient") {
|
|
24
24
|
}
|