@xandreed/core 0.3.0 → 0.8.0-next.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 +31 -0
- 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 +24 -0
- 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 +48 -4
- package/dist/index.js +46 -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 +2 -3
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { UserMessage } from "../turn/user-message.entity.js";
|
|
3
|
+
/** A session as its owner names it; another owner's address finds nothing. */
|
|
4
|
+
export declare const SessionAddress: Schema.Struct<{
|
|
5
|
+
readonly id: Schema.brand<Schema.String, "ConversationId">;
|
|
6
|
+
readonly owner: Schema.Trimmed;
|
|
7
|
+
}>;
|
|
8
|
+
export type SessionAddress = typeof SessionAddress.Type;
|
|
9
|
+
/** Something delivered to a session for a later turn (a background task's result). */
|
|
10
|
+
export declare const InboxItem: Schema.Struct<{
|
|
11
|
+
/** Stable: delivering the same id twice stores it once. */
|
|
12
|
+
readonly id: Schema.Trimmed;
|
|
13
|
+
/** Who sent it and why, for the host and the UI. */
|
|
14
|
+
readonly source: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
15
|
+
/** What the turn that takes it shows the model, framed by the sender. */
|
|
16
|
+
readonly content: Schema.NonEmptyString;
|
|
17
|
+
}>;
|
|
18
|
+
export type InboxItem = typeof InboxItem.Type;
|
|
19
|
+
/** The turn a session has open. */
|
|
20
|
+
export declare const OpenTurn: Schema.Struct<{
|
|
21
|
+
readonly turn: Schema.Int;
|
|
22
|
+
readonly runId: Schema.String;
|
|
23
|
+
readonly key: Schema.String;
|
|
24
|
+
readonly origin: Schema.Literals<readonly ["user", "inbox"]>;
|
|
25
|
+
/** The writer holding it (one Sessions instance). */
|
|
26
|
+
readonly holder: Schema.String;
|
|
27
|
+
/** Storage time the lease ends; none under process ownership. */
|
|
28
|
+
readonly expiresAt: Schema.OptionFromNullOr<Schema.Number>;
|
|
29
|
+
}>;
|
|
30
|
+
export type OpenTurn = typeof OpenTurn.Type;
|
|
31
|
+
/** One session as a host lists or shows it. `open` is none once its lease has run out. */
|
|
32
|
+
export declare const SessionView: Schema.Struct<{
|
|
33
|
+
readonly header: Schema.Struct<{
|
|
34
|
+
readonly id: Schema.brand<Schema.String, "ConversationId">;
|
|
35
|
+
readonly owner: Schema.Trimmed;
|
|
36
|
+
readonly origin: Schema.Trimmed;
|
|
37
|
+
readonly createdAt: Schema.Number;
|
|
38
|
+
readonly meta: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
39
|
+
readonly parent: Schema.OptionFromNullOr<Schema.Struct<{
|
|
40
|
+
readonly id: Schema.brand<Schema.String, "ConversationId">;
|
|
41
|
+
readonly through: Schema.Int;
|
|
42
|
+
readonly turnAtFork: Schema.Int;
|
|
43
|
+
}>>;
|
|
44
|
+
}>;
|
|
45
|
+
readonly seq: Schema.Int;
|
|
46
|
+
readonly updatedAt: Schema.Number;
|
|
47
|
+
readonly turns: Schema.Int;
|
|
48
|
+
readonly title: Schema.OptionFromNullOr<Schema.String>;
|
|
49
|
+
readonly open: Schema.OptionFromNullOr<Schema.Struct<{
|
|
50
|
+
readonly turn: Schema.Int;
|
|
51
|
+
readonly runId: Schema.String;
|
|
52
|
+
readonly key: Schema.String;
|
|
53
|
+
readonly origin: Schema.Literals<readonly ["user", "inbox"]>;
|
|
54
|
+
/** The writer holding it (one Sessions instance). */
|
|
55
|
+
readonly holder: Schema.String;
|
|
56
|
+
/** Storage time the lease ends; none under process ownership. */
|
|
57
|
+
readonly expiresAt: Schema.OptionFromNullOr<Schema.Number>;
|
|
58
|
+
}>>;
|
|
59
|
+
/** Inbox items waiting for a turn. */
|
|
60
|
+
readonly pending: Schema.Int;
|
|
61
|
+
}>;
|
|
62
|
+
export type SessionView = typeof SessionView.Type;
|
|
63
|
+
/** A page of an owner's sessions and where the next page starts. */
|
|
64
|
+
export declare const SessionPage: Schema.Struct<{
|
|
65
|
+
readonly sessions: Schema.$Array<Schema.Struct<{
|
|
66
|
+
readonly header: Schema.Struct<{
|
|
67
|
+
readonly id: Schema.brand<Schema.String, "ConversationId">;
|
|
68
|
+
readonly owner: Schema.Trimmed;
|
|
69
|
+
readonly origin: Schema.Trimmed;
|
|
70
|
+
readonly createdAt: Schema.Number;
|
|
71
|
+
readonly meta: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
72
|
+
readonly parent: Schema.OptionFromNullOr<Schema.Struct<{
|
|
73
|
+
readonly id: Schema.brand<Schema.String, "ConversationId">;
|
|
74
|
+
readonly through: Schema.Int;
|
|
75
|
+
readonly turnAtFork: Schema.Int;
|
|
76
|
+
}>>;
|
|
77
|
+
}>;
|
|
78
|
+
readonly seq: Schema.Int;
|
|
79
|
+
readonly updatedAt: Schema.Number;
|
|
80
|
+
readonly turns: Schema.Int;
|
|
81
|
+
readonly title: Schema.OptionFromNullOr<Schema.String>;
|
|
82
|
+
readonly open: Schema.OptionFromNullOr<Schema.Struct<{
|
|
83
|
+
readonly turn: Schema.Int;
|
|
84
|
+
readonly runId: Schema.String;
|
|
85
|
+
readonly key: Schema.String;
|
|
86
|
+
readonly origin: Schema.Literals<readonly ["user", "inbox"]>;
|
|
87
|
+
/** The writer holding it (one Sessions instance). */
|
|
88
|
+
readonly holder: Schema.String;
|
|
89
|
+
/** Storage time the lease ends; none under process ownership. */
|
|
90
|
+
readonly expiresAt: Schema.OptionFromNullOr<Schema.Number>;
|
|
91
|
+
}>>;
|
|
92
|
+
/** Inbox items waiting for a turn. */
|
|
93
|
+
readonly pending: Schema.Int;
|
|
94
|
+
}>>;
|
|
95
|
+
readonly next: Schema.OptionFromNullOr<Schema.Struct<{
|
|
96
|
+
readonly updatedAt: Schema.Number;
|
|
97
|
+
readonly id: Schema.brand<Schema.String, "ConversationId">;
|
|
98
|
+
}>>;
|
|
99
|
+
}>;
|
|
100
|
+
export type SessionPage = typeof SessionPage.Type;
|
|
101
|
+
/** How a turn begins: a user's message, or the inbox's pending items. */
|
|
102
|
+
export declare const BeginTurn: Schema.Union<readonly [Schema.TaggedStruct<"User", {
|
|
103
|
+
readonly userMessage: typeof UserMessage;
|
|
104
|
+
readonly runId: Schema.String;
|
|
105
|
+
/** The host's idempotency key (e.g. the client's command id). */
|
|
106
|
+
readonly key: Schema.String;
|
|
107
|
+
readonly command: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
108
|
+
}>, Schema.TaggedStruct<"Inbox", {
|
|
109
|
+
readonly runId: Schema.String;
|
|
110
|
+
}>]>;
|
|
111
|
+
export type BeginTurn = typeof BeginTurn.Type;
|
|
112
|
+
/** An admitted turn, as the turn's code reads it. */
|
|
113
|
+
export declare const AdmittedTurn: Schema.Struct<{
|
|
114
|
+
readonly session: Schema.Struct<{
|
|
115
|
+
readonly id: Schema.brand<Schema.String, "ConversationId">;
|
|
116
|
+
readonly owner: Schema.Trimmed;
|
|
117
|
+
}>;
|
|
118
|
+
readonly turn: Schema.Int;
|
|
119
|
+
readonly runId: Schema.String;
|
|
120
|
+
readonly key: Schema.String;
|
|
121
|
+
readonly origin: Schema.Literals<readonly ["user", "inbox"]>;
|
|
122
|
+
readonly userMessage: typeof UserMessage;
|
|
123
|
+
readonly command: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
124
|
+
readonly claimed: Schema.$Array<Schema.Struct<{
|
|
125
|
+
/** Stable: delivering the same id twice stores it once. */
|
|
126
|
+
readonly id: Schema.Trimmed;
|
|
127
|
+
/** Who sent it and why, for the host and the UI. */
|
|
128
|
+
readonly source: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
129
|
+
/** What the turn that takes it shows the model, framed by the sender. */
|
|
130
|
+
readonly content: Schema.NonEmptyString;
|
|
131
|
+
}>>;
|
|
132
|
+
}>;
|
|
133
|
+
export type AdmittedTurn = typeof AdmittedTurn.Type;
|
|
134
|
+
/** How a turn ended, as its closer records it. */
|
|
135
|
+
export declare const TurnEnding: Schema.Struct<{
|
|
136
|
+
readonly reason: Schema.Literals<readonly ["completed", "partial", "failed", "cancelled", "interrupted"]>;
|
|
137
|
+
readonly failure: Schema.OptionFromNullOr<Schema.Struct<{
|
|
138
|
+
readonly code: Schema.String;
|
|
139
|
+
readonly message: Schema.String;
|
|
140
|
+
}>>;
|
|
141
|
+
}>;
|
|
142
|
+
export type TurnEnding = typeof TurnEnding.Type;
|
|
143
|
+
declare const SessionBusy_base: Schema.Class<SessionBusy, Schema.TaggedStruct<"SessionBusy", {
|
|
144
|
+
readonly session: Schema.brand<Schema.String, "ConversationId">;
|
|
145
|
+
readonly turn: Schema.Int;
|
|
146
|
+
}>, import("effect/Cause").YieldableError>;
|
|
147
|
+
/** A session already has a turn open: one message at a time (a host answers 409). */
|
|
148
|
+
export declare class SessionBusy extends SessionBusy_base {
|
|
149
|
+
}
|
|
150
|
+
declare const TurnDuplicate_base: Schema.Class<TurnDuplicate, Schema.TaggedStruct<"TurnDuplicate", {
|
|
151
|
+
readonly session: Schema.brand<Schema.String, "ConversationId">;
|
|
152
|
+
readonly turn: Schema.Int;
|
|
153
|
+
readonly open: Schema.Boolean;
|
|
154
|
+
}>, import("effect/Cause").YieldableError>;
|
|
155
|
+
/** The key was begun before, with the same message: that turn is the answer. */
|
|
156
|
+
export declare class TurnDuplicate extends TurnDuplicate_base {
|
|
157
|
+
}
|
|
158
|
+
declare const KeyConflict_base: Schema.Class<KeyConflict, Schema.TaggedStruct<"KeyConflict", {
|
|
159
|
+
readonly session: Schema.brand<Schema.String, "ConversationId">;
|
|
160
|
+
readonly key: Schema.String;
|
|
161
|
+
readonly turn: Schema.Int;
|
|
162
|
+
}>, import("effect/Cause").YieldableError>;
|
|
163
|
+
/** The key was begun before with another message or command. */
|
|
164
|
+
export declare class KeyConflict extends KeyConflict_base {
|
|
165
|
+
}
|
|
166
|
+
declare const NothingPending_base: Schema.Class<NothingPending, Schema.TaggedStruct<"NothingPending", {
|
|
167
|
+
readonly session: Schema.brand<Schema.String, "ConversationId">;
|
|
168
|
+
}>, import("effect/Cause").YieldableError>;
|
|
169
|
+
/** An inbox turn found nothing to take. */
|
|
170
|
+
export declare class NothingPending extends NothingPending_base {
|
|
171
|
+
}
|
|
172
|
+
declare const InboxFull_base: Schema.Class<InboxFull, Schema.TaggedStruct<"InboxFull", {
|
|
173
|
+
readonly session: Schema.brand<Schema.String, "ConversationId">;
|
|
174
|
+
readonly pending: Schema.Int;
|
|
175
|
+
}>, import("effect/Cause").YieldableError>;
|
|
176
|
+
/** The inbox holds as many waiting items as it may. */
|
|
177
|
+
export declare class InboxFull extends InboxFull_base {
|
|
178
|
+
}
|
|
179
|
+
declare const ReservedKind_base: Schema.Class<ReservedKind, Schema.TaggedStruct<"ReservedKind", {
|
|
180
|
+
readonly kind: Schema.String;
|
|
181
|
+
}>, import("effect/Cause").YieldableError>;
|
|
182
|
+
/** A host tried to record under a kind only the framework writes. */
|
|
183
|
+
export declare class ReservedKind extends ReservedKind_base {
|
|
184
|
+
}
|
|
185
|
+
declare const TurnClosed_base: Schema.Class<TurnClosed, Schema.TaggedStruct<"TurnClosed", {
|
|
186
|
+
readonly session: Schema.brand<Schema.String, "ConversationId">;
|
|
187
|
+
readonly turn: Schema.Int;
|
|
188
|
+
readonly reason: Schema.Literals<readonly ["cancelled", "interrupted", "removed"]>;
|
|
189
|
+
}>, import("effect/Cause").YieldableError>;
|
|
190
|
+
/** The turn was closed by someone else: cancelled, its lease reaped, or its session removed. */
|
|
191
|
+
export declare class TurnClosed extends TurnClosed_base {
|
|
192
|
+
}
|
|
193
|
+
declare const TurnRefused_base: Schema.Class<TurnRefused, Schema.TaggedStruct<"TurnRefused", {
|
|
194
|
+
readonly session: Schema.brand<Schema.String, "ConversationId">;
|
|
195
|
+
readonly reason: Schema.String;
|
|
196
|
+
readonly message: Schema.String;
|
|
197
|
+
}>, import("effect/Cause").YieldableError>;
|
|
198
|
+
/** The host would not open the turn (a budget, a quota): nothing was opened or counted. */
|
|
199
|
+
export declare class TurnRefused extends TurnRefused_base {
|
|
200
|
+
}
|
|
201
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { ConversationId } from "../domain/message.entity.js";
|
|
3
|
+
import { UserMessage } from "../turn/user-message.entity.js";
|
|
4
|
+
import { TurnEndReason } from "./session-event.entity.js";
|
|
5
|
+
import { JsonObject, SessionHeader, SessionListCursor } from "./session-log.entity.js";
|
|
6
|
+
export const SessionAddress = Schema.Struct({ id: ConversationId, owner: Schema.Trimmed.check(Schema.isNonEmpty()) }), InboxItem = Schema.Struct({
|
|
7
|
+
id: Schema.Trimmed.check(Schema.isNonEmpty()),
|
|
8
|
+
source: JsonObject,
|
|
9
|
+
content: Schema.NonEmptyString
|
|
10
|
+
}), OpenTurn = Schema.Struct({
|
|
11
|
+
turn: Schema.Int,
|
|
12
|
+
runId: Schema.String,
|
|
13
|
+
key: Schema.String,
|
|
14
|
+
origin: Schema.Literals(["user", "inbox"]),
|
|
15
|
+
holder: Schema.String,
|
|
16
|
+
expiresAt: Schema.OptionFromNullOr(Schema.Number)
|
|
17
|
+
}), SessionView = Schema.Struct({
|
|
18
|
+
header: SessionHeader,
|
|
19
|
+
seq: Schema.Int,
|
|
20
|
+
updatedAt: Schema.Number,
|
|
21
|
+
turns: Schema.Int,
|
|
22
|
+
title: Schema.OptionFromNullOr(Schema.String),
|
|
23
|
+
open: Schema.OptionFromNullOr(OpenTurn),
|
|
24
|
+
pending: Schema.Int
|
|
25
|
+
}), SessionPage = Schema.Struct({
|
|
26
|
+
sessions: Schema.Array(SessionView),
|
|
27
|
+
next: Schema.OptionFromNullOr(SessionListCursor)
|
|
28
|
+
}), BeginTurn = Schema.Union([
|
|
29
|
+
Schema.TaggedStruct("User", {
|
|
30
|
+
userMessage: UserMessage,
|
|
31
|
+
runId: Schema.String,
|
|
32
|
+
key: Schema.String,
|
|
33
|
+
command: JsonObject
|
|
34
|
+
}),
|
|
35
|
+
Schema.TaggedStruct("Inbox", { runId: Schema.String })
|
|
36
|
+
]), AdmittedTurn = Schema.Struct({
|
|
37
|
+
session: SessionAddress,
|
|
38
|
+
turn: Schema.Int,
|
|
39
|
+
runId: Schema.String,
|
|
40
|
+
key: Schema.String,
|
|
41
|
+
origin: Schema.Literals(["user", "inbox"]),
|
|
42
|
+
userMessage: UserMessage,
|
|
43
|
+
command: JsonObject,
|
|
44
|
+
claimed: Schema.Array(InboxItem)
|
|
45
|
+
}), TurnEnding = Schema.Struct({
|
|
46
|
+
reason: TurnEndReason,
|
|
47
|
+
failure: Schema.OptionFromNullOr(Schema.Struct({ code: Schema.String, message: Schema.String }))
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export class SessionBusy extends Schema.TaggedError()("SessionBusy", {
|
|
51
|
+
session: ConversationId,
|
|
52
|
+
turn: Schema.Int
|
|
53
|
+
}) {
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export class TurnDuplicate extends Schema.TaggedError()("TurnDuplicate", {
|
|
57
|
+
session: ConversationId,
|
|
58
|
+
turn: Schema.Int,
|
|
59
|
+
open: Schema.Boolean
|
|
60
|
+
}) {
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export class KeyConflict extends Schema.TaggedError()("KeyConflict", {
|
|
64
|
+
session: ConversationId,
|
|
65
|
+
key: Schema.String,
|
|
66
|
+
turn: Schema.Int
|
|
67
|
+
}) {
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export class NothingPending extends Schema.TaggedError()("NothingPending", {
|
|
71
|
+
session: ConversationId
|
|
72
|
+
}) {
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export class InboxFull extends Schema.TaggedError()("InboxFull", {
|
|
76
|
+
session: ConversationId,
|
|
77
|
+
pending: Schema.Int
|
|
78
|
+
}) {
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export class ReservedKind extends Schema.TaggedError()("ReservedKind", {
|
|
82
|
+
kind: Schema.String
|
|
83
|
+
}) {
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export class TurnClosed extends Schema.TaggedError()("TurnClosed", {
|
|
87
|
+
session: ConversationId,
|
|
88
|
+
turn: Schema.Int,
|
|
89
|
+
reason: Schema.Literals(["cancelled", "interrupted", "removed"])
|
|
90
|
+
}) {
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export class TurnRefused extends Schema.TaggedError()("TurnRefused", {
|
|
94
|
+
session: ConversationId,
|
|
95
|
+
reason: Schema.String,
|
|
96
|
+
message: Schema.String
|
|
97
|
+
}) {
|
|
98
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const TaskMode: Schema.Literals<readonly ["fork", "spawn"]>;
|
|
3
|
+
export type TaskMode = typeof TaskMode.Type;
|
|
4
|
+
/** Where a task stands, read from its child session. */
|
|
5
|
+
export declare const TaskStatus: Schema.Literals<readonly ["pending", "running", "completed", "partial", "failed", "interrupted", "cancelled"]>;
|
|
6
|
+
export type TaskStatus = typeof TaskStatus.Type;
|
|
7
|
+
export declare const TaskView: Schema.Struct<{
|
|
8
|
+
readonly taskId: Schema.brand<Schema.String, "ConversationId">;
|
|
9
|
+
readonly parent: Schema.brand<Schema.String, "ConversationId">;
|
|
10
|
+
readonly child: Schema.brand<Schema.String, "ConversationId">;
|
|
11
|
+
readonly instructions: Schema.String;
|
|
12
|
+
readonly mode: Schema.Literals<readonly ["fork", "spawn"]>;
|
|
13
|
+
readonly status: Schema.Literals<readonly ["pending", "running", "completed", "partial", "failed", "interrupted", "cancelled"]>;
|
|
14
|
+
/** The child's final reply, once it has one. */
|
|
15
|
+
readonly reply: Schema.OptionFromNullOr<Schema.String>;
|
|
16
|
+
/** Why it did not complete (refused, out of time, failed), when that is known. */
|
|
17
|
+
readonly failure: Schema.OptionFromNullOr<Schema.Struct<{
|
|
18
|
+
readonly code: Schema.String;
|
|
19
|
+
readonly message: Schema.String;
|
|
20
|
+
}>>;
|
|
21
|
+
/** Whether the result reached the parent's inbox. */
|
|
22
|
+
readonly delivered: Schema.Boolean;
|
|
23
|
+
}>;
|
|
24
|
+
export type TaskView = typeof TaskView.Type;
|
|
25
|
+
declare const TaskRefused_base: Schema.Class<TaskRefused, Schema.TaggedStruct<"TaskRefused", {
|
|
26
|
+
readonly session: Schema.brand<Schema.String, "ConversationId">;
|
|
27
|
+
readonly reason: Schema.Literals<readonly ["depth", "limit"]>;
|
|
28
|
+
readonly message: Schema.String;
|
|
29
|
+
}>, import("effect/Cause").YieldableError>;
|
|
30
|
+
/** A task that may not start: tasks do not start tasks, and a session runs so many at once. */
|
|
31
|
+
export declare class TaskRefused extends TaskRefused_base {
|
|
32
|
+
}
|
|
33
|
+
declare const TaskMissing_base: Schema.Class<TaskMissing, Schema.TaggedStruct<"TaskMissing", {
|
|
34
|
+
readonly session: Schema.brand<Schema.String, "ConversationId">;
|
|
35
|
+
readonly taskId: Schema.String;
|
|
36
|
+
}>, import("effect/Cause").YieldableError>;
|
|
37
|
+
export declare class TaskMissing extends TaskMissing_base {
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { ConversationId } from "../domain/message.entity.js";
|
|
3
|
+
export const TaskMode = Schema.Literals(["fork", "spawn"]), TaskStatus = Schema.Literals(["pending", "running", "completed", "partial", "failed", "interrupted", "cancelled"]), TaskView = Schema.Struct({
|
|
4
|
+
taskId: ConversationId,
|
|
5
|
+
parent: ConversationId,
|
|
6
|
+
child: ConversationId,
|
|
7
|
+
instructions: Schema.String,
|
|
8
|
+
mode: TaskMode,
|
|
9
|
+
status: TaskStatus,
|
|
10
|
+
reply: Schema.OptionFromNullOr(Schema.String),
|
|
11
|
+
failure: Schema.OptionFromNullOr(Schema.Struct({ code: Schema.String, message: Schema.String })),
|
|
12
|
+
delivered: Schema.Boolean
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export class TaskRefused extends Schema.TaggedError()("TaskRefused", {
|
|
16
|
+
session: ConversationId,
|
|
17
|
+
reason: Schema.Literals(["depth", "limit"]),
|
|
18
|
+
message: Schema.String
|
|
19
|
+
}) {
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class TaskMissing extends Schema.TaggedError()("TaskMissing", {
|
|
23
|
+
session: ConversationId,
|
|
24
|
+
taskId: Schema.String
|
|
25
|
+
}) {
|
|
26
|
+
}
|
package/dist/spec/SpecDoc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Schema } from "effect";
|
|
2
2
|
/**
|
|
3
3
|
* The SPEC artifact of the spec-driven pipeline: a rough idea becomes a
|
|
4
4
|
* SpecDoc (drafted by the refiner agent, refined WITH the human, LOCKED by
|
|
@@ -14,141 +14,54 @@ import { Option, Schema } from "effect";
|
|
|
14
14
|
* `usecases/specCodec.ts` and round-trips deterministically.
|
|
15
15
|
*/
|
|
16
16
|
/** Kebab-case spec identity — the file's basename, minted once. */
|
|
17
|
-
export declare const SpecSlug: Schema.brand<Schema.
|
|
17
|
+
export declare const SpecSlug: Schema.brand<Schema.String, "SpecSlug">;
|
|
18
18
|
export type SpecSlug = typeof SpecSlug.Type;
|
|
19
|
-
export declare const SpecStatus: Schema.
|
|
19
|
+
export declare const SpecStatus: Schema.Literals<readonly ["draft", "locked"]>;
|
|
20
20
|
export type SpecStatus = typeof SpecStatus.Type;
|
|
21
|
-
declare const SpecCheck_base: Schema.Class<SpecCheck, {
|
|
22
|
-
name: Schema.
|
|
23
|
-
command:
|
|
24
|
-
}
|
|
25
|
-
name: Schema.filter<typeof Schema.String>;
|
|
26
|
-
command: typeof Schema.NonEmptyString;
|
|
27
|
-
}>, never, {
|
|
28
|
-
readonly name: string;
|
|
29
|
-
} & {
|
|
30
|
-
readonly command: string;
|
|
31
|
-
}, {}, {}>;
|
|
21
|
+
declare const SpecCheck_base: Schema.Class<SpecCheck, Schema.Struct<{
|
|
22
|
+
readonly name: Schema.String;
|
|
23
|
+
readonly command: Schema.NonEmptyString;
|
|
24
|
+
}>, {}>;
|
|
32
25
|
/** A machine-checkable acceptance criterion: a named shell command that must
|
|
33
26
|
* exit 0. Drivers append one rank-2 command gate per check (`accept:<name>`). */
|
|
34
27
|
export declare class SpecCheck extends SpecCheck_base {
|
|
35
28
|
}
|
|
36
|
-
declare const SpecLimits_base: Schema.Class<SpecLimits, {
|
|
37
|
-
maxAttempts: Schema.
|
|
38
|
-
budgetMinutes:
|
|
39
|
-
}
|
|
40
|
-
maxAttempts: Schema.filter<typeof Schema.Int>;
|
|
41
|
-
budgetMinutes: typeof Schema.Positive;
|
|
42
|
-
}>, never, {
|
|
43
|
-
readonly maxAttempts: number;
|
|
44
|
-
} & {
|
|
45
|
-
readonly budgetMinutes: number;
|
|
46
|
-
}, {}, {}>;
|
|
29
|
+
declare const SpecLimits_base: Schema.Class<SpecLimits, Schema.Struct<{
|
|
30
|
+
readonly maxAttempts: Schema.Int;
|
|
31
|
+
readonly budgetMinutes: Schema.Number;
|
|
32
|
+
}>, {}>;
|
|
47
33
|
/** Forge-loop bounds (mirrors foundry's ForgeLimits, in human units). */
|
|
48
34
|
export declare class SpecLimits extends SpecLimits_base {
|
|
49
35
|
}
|
|
50
|
-
declare const SpecGates_base: Schema.Class<SpecGates, {
|
|
51
|
-
config: Schema.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
testCommand: Schema.optionalWith<typeof Schema.NonEmptyString, {
|
|
55
|
-
as: "Option";
|
|
56
|
-
}>;
|
|
57
|
-
noTest: Schema.optionalWith<typeof Schema.Boolean, {
|
|
58
|
-
default: () => false;
|
|
59
|
-
}>;
|
|
36
|
+
declare const SpecGates_base: Schema.Class<SpecGates, Schema.Struct<{
|
|
37
|
+
readonly config: Schema.OptionFromOptional<Schema.NonEmptyString>;
|
|
38
|
+
readonly testCommand: Schema.OptionFromOptional<Schema.NonEmptyString>;
|
|
39
|
+
readonly noTest: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.Boolean, never>>;
|
|
60
40
|
/** The rank-4 LLM judge — ON by default; a spec opts out with `judge: false`. */
|
|
61
|
-
judge: Schema.
|
|
62
|
-
|
|
63
|
-
}>;
|
|
64
|
-
}, Schema.Struct.Encoded<{
|
|
65
|
-
config: Schema.optionalWith<typeof Schema.NonEmptyString, {
|
|
66
|
-
as: "Option";
|
|
67
|
-
}>;
|
|
68
|
-
testCommand: Schema.optionalWith<typeof Schema.NonEmptyString, {
|
|
69
|
-
as: "Option";
|
|
70
|
-
}>;
|
|
71
|
-
noTest: Schema.optionalWith<typeof Schema.Boolean, {
|
|
72
|
-
default: () => false;
|
|
73
|
-
}>;
|
|
74
|
-
/** The rank-4 LLM judge — ON by default; a spec opts out with `judge: false`. */
|
|
75
|
-
judge: Schema.optionalWith<typeof Schema.Boolean, {
|
|
76
|
-
default: () => true;
|
|
77
|
-
}>;
|
|
78
|
-
}>, never, {
|
|
79
|
-
readonly config: Option.Option<string>;
|
|
80
|
-
} & {
|
|
81
|
-
readonly testCommand: Option.Option<string>;
|
|
82
|
-
} & {
|
|
83
|
-
readonly noTest?: boolean;
|
|
84
|
-
} & {
|
|
85
|
-
readonly judge?: boolean;
|
|
86
|
-
}, {}, {}>;
|
|
41
|
+
readonly judge: Schema.withConstructorDefault<Schema.withDecodingDefaultType<Schema.Boolean, never>>;
|
|
42
|
+
}>, {}>;
|
|
87
43
|
/** Gate-suite selection overrides; absent fields fall through to the driver's
|
|
88
44
|
* workspace discovery (precedence: CLI flags > these > discovery). */
|
|
89
45
|
export declare class SpecGates extends SpecGates_base {
|
|
90
46
|
}
|
|
91
|
-
declare const SpecDoc_base: Schema.Class<SpecDoc, {
|
|
92
|
-
slug: Schema.brand<Schema.
|
|
93
|
-
status: Schema.
|
|
94
|
-
/** ISO timestamps — strings on purpose (stable round-trip, no Date drift). */
|
|
95
|
-
created: typeof Schema.NonEmptyString;
|
|
96
|
-
locked: Schema.optionalWith<typeof Schema.NonEmptyString, {
|
|
97
|
-
as: "Option";
|
|
98
|
-
}>;
|
|
99
|
-
/** One imperative paragraph — becomes foundry `Spec.goal`. */
|
|
100
|
-
goal: typeof Schema.NonEmptyString;
|
|
101
|
-
/** Rendered verbatim into the implementor brief; also foundry `Spec.acceptance`. */
|
|
102
|
-
acceptance: Schema.Array$<typeof Schema.NonEmptyString>;
|
|
103
|
-
/** Hard boundaries for the implementor (brief-only; never enter foundry's Spec). */
|
|
104
|
-
constraints: Schema.Array$<typeof Schema.NonEmptyString>;
|
|
105
|
-
/** Explicit scope fences (brief-only). */
|
|
106
|
-
nonGoals: Schema.Array$<typeof Schema.NonEmptyString>;
|
|
107
|
-
checks: Schema.Array$<typeof SpecCheck>;
|
|
108
|
-
limits: typeof SpecLimits;
|
|
109
|
-
gates: typeof SpecGates;
|
|
110
|
-
}, Schema.Struct.Encoded<{
|
|
111
|
-
slug: Schema.brand<Schema.filter<typeof Schema.String>, "SpecSlug">;
|
|
112
|
-
status: Schema.Literal<["draft", "locked"]>;
|
|
47
|
+
declare const SpecDoc_base: Schema.Class<SpecDoc, Schema.Struct<{
|
|
48
|
+
readonly slug: Schema.brand<Schema.String, "SpecSlug">;
|
|
49
|
+
readonly status: Schema.Literals<readonly ["draft", "locked"]>;
|
|
113
50
|
/** ISO timestamps — strings on purpose (stable round-trip, no Date drift). */
|
|
114
|
-
created:
|
|
115
|
-
locked: Schema.
|
|
116
|
-
as: "Option";
|
|
117
|
-
}>;
|
|
51
|
+
readonly created: Schema.NonEmptyString;
|
|
52
|
+
readonly locked: Schema.OptionFromOptional<Schema.NonEmptyString>;
|
|
118
53
|
/** One imperative paragraph — becomes foundry `Spec.goal`. */
|
|
119
|
-
goal:
|
|
54
|
+
readonly goal: Schema.NonEmptyString;
|
|
120
55
|
/** Rendered verbatim into the implementor brief; also foundry `Spec.acceptance`. */
|
|
121
|
-
acceptance: Schema
|
|
56
|
+
readonly acceptance: Schema.$Array<Schema.NonEmptyString>;
|
|
122
57
|
/** Hard boundaries for the implementor (brief-only; never enter foundry's Spec). */
|
|
123
|
-
constraints: Schema
|
|
58
|
+
readonly constraints: Schema.$Array<Schema.NonEmptyString>;
|
|
124
59
|
/** Explicit scope fences (brief-only). */
|
|
125
|
-
nonGoals: Schema
|
|
126
|
-
checks: Schema
|
|
127
|
-
limits: typeof SpecLimits;
|
|
128
|
-
gates: typeof SpecGates;
|
|
129
|
-
}>,
|
|
130
|
-
readonly status: "draft" | "locked";
|
|
131
|
-
} & {
|
|
132
|
-
readonly locked: Option.Option<string>;
|
|
133
|
-
} & {
|
|
134
|
-
readonly slug: string & import("effect/Brand").Brand<"SpecSlug">;
|
|
135
|
-
} & {
|
|
136
|
-
readonly created: string;
|
|
137
|
-
} & {
|
|
138
|
-
readonly goal: string;
|
|
139
|
-
} & {
|
|
140
|
-
readonly limits: SpecLimits;
|
|
141
|
-
} & {
|
|
142
|
-
readonly gates: SpecGates;
|
|
143
|
-
} & {
|
|
144
|
-
readonly acceptance: readonly string[];
|
|
145
|
-
} & {
|
|
146
|
-
readonly constraints: readonly string[];
|
|
147
|
-
} & {
|
|
148
|
-
readonly nonGoals: readonly string[];
|
|
149
|
-
} & {
|
|
150
|
-
readonly checks: readonly SpecCheck[];
|
|
151
|
-
}, {}, {}>;
|
|
60
|
+
readonly nonGoals: Schema.$Array<Schema.NonEmptyString>;
|
|
61
|
+
readonly checks: Schema.$Array<typeof SpecCheck>;
|
|
62
|
+
readonly limits: typeof SpecLimits;
|
|
63
|
+
readonly gates: typeof SpecGates;
|
|
64
|
+
}>, {}>;
|
|
152
65
|
export declare class SpecDoc extends SpecDoc_base {
|
|
153
66
|
}
|
|
154
67
|
export declare const DEFAULT_SPEC_LIMITS: SpecLimits;
|
package/dist/spec/SpecDoc.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Option, Schema } from "effect";
|
|
2
|
-
export const SpecSlug = Schema.String.pipe(Schema.
|
|
1
|
+
import { Option, Schema, Effect } from "effect";
|
|
2
|
+
export const SpecSlug = Schema.String.pipe(Schema.check(Schema.isPattern(/^[a-z0-9][a-z0-9-]*$/)), Schema.brand("SpecSlug")), SpecStatus = Schema.Literals(["draft", "locked"]);
|
|
3
3
|
|
|
4
4
|
export class SpecCheck extends Schema.Class("SpecCheck")({
|
|
5
|
-
name: Schema.String.pipe(Schema.
|
|
5
|
+
name: Schema.String.pipe(Schema.check(Schema.isPattern(/^[a-z0-9][a-z0-9-]*$/))),
|
|
6
6
|
command: Schema.NonEmptyString
|
|
7
7
|
}) {
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export class SpecLimits extends Schema.Class("SpecLimits")({
|
|
11
|
-
maxAttempts: Schema.Int.pipe(Schema.
|
|
12
|
-
budgetMinutes: Schema.
|
|
11
|
+
maxAttempts: Schema.Int.pipe(Schema.check(Schema.isBetween({ minimum: 1, maximum: 10 }))),
|
|
12
|
+
budgetMinutes: Schema.Number.check(Schema.isGreaterThan(0))
|
|
13
13
|
}) {
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export class SpecGates extends Schema.Class("SpecGates")({
|
|
17
|
-
config: Schema.
|
|
18
|
-
testCommand: Schema.
|
|
19
|
-
noTest: Schema.
|
|
20
|
-
judge: Schema.
|
|
17
|
+
config: Schema.OptionFromOptional(Schema.NonEmptyString),
|
|
18
|
+
testCommand: Schema.OptionFromOptional(Schema.NonEmptyString),
|
|
19
|
+
noTest: Schema.Boolean.pipe(Schema.withDecodingDefaultType(Effect.sync(() => !1)), Schema.withConstructorDefault(Effect.sync(() => !1))),
|
|
20
|
+
judge: Schema.Boolean.pipe(Schema.withDecodingDefaultType(Effect.sync(() => !0)), Schema.withConstructorDefault(Effect.sync(() => !0)))
|
|
21
21
|
}) {
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -25,7 +25,7 @@ export class SpecDoc extends Schema.Class("SpecDoc")({
|
|
|
25
25
|
slug: SpecSlug,
|
|
26
26
|
status: SpecStatus,
|
|
27
27
|
created: Schema.NonEmptyString,
|
|
28
|
-
locked: Schema.
|
|
28
|
+
locked: Schema.OptionFromOptional(Schema.NonEmptyString),
|
|
29
29
|
goal: Schema.NonEmptyString,
|
|
30
30
|
acceptance: Schema.Array(Schema.NonEmptyString),
|
|
31
31
|
constraints: Schema.Array(Schema.NonEmptyString),
|
package/dist/spec/codec.js
CHANGED
|
@@ -88,7 +88,7 @@ export const decodeSpecDocText = (slug, text) => Effect.gen(function* () {
|
|
|
88
88
|
...fields.judge !== void 0 ? { judge: fields.judge === "true" } : {}
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
|
-
return yield* Schema.
|
|
91
|
+
return yield* Schema.decodeUnknownEffect(SpecDoc)(candidate, { reportInput: !0 }).pipe(Effect.mapError((error) => new SpecDocParseError({ message: String(error) })));
|
|
92
92
|
}), normalizeBullet = (text) => text.replace(/\s+/g, " ").trim(), encodeSpecDocText = (doc) => {
|
|
93
93
|
const frontmatter = [
|
|
94
94
|
"---",
|