effect-agent 0.1.0-beta.103 → 0.1.0-beta.106
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/dist/{Agent-CM6JubNX.d.mts → Agent-Bk-mLtov.d.mts} +2 -2
- package/dist/{AgentError-CggcAQ7V.d.mts → AgentError-Bn1ytXRD.d.mts} +20 -4
- package/dist/{AgentRuntime-B1SXMVN7.d.mts → AgentRuntime-BEXToYl1.d.mts} +8 -8
- package/dist/{AgentRuntime-BWOnNc0d.mjs → AgentRuntime-e2M5UoXn.mjs} +4 -3
- package/dist/AgentRuntime-e2M5UoXn.mjs.map +1 -0
- package/dist/{DurableAgentRuntime-C9eRZS9N.mjs → DurableAgentRuntime-wd1x0TcB.mjs} +67 -36
- package/dist/DurableAgentRuntime-wd1x0TcB.mjs.map +1 -0
- package/dist/{EventSource-K7XUzurY.d.mts → EventSource-pH-v0k42.d.mts} +3 -3
- package/dist/FailureDiagnostic-BElLOoED.mjs +274 -0
- package/dist/FailureDiagnostic-BElLOoED.mjs.map +1 -0
- package/dist/FailureDiagnostic-CaAkzGHL.d.mts +223 -0
- package/dist/{Messaging-QMYhp297.d.mts → Messaging-Bl4SBKpR.d.mts} +3 -3
- package/dist/{MessagingHost-gAxs5gme.d.mts → MessagingHost-nwBMdRoh.d.mts} +3 -3
- package/dist/{Output-CjocJzsl.d.mts → Output-B6RQ5jRU.d.mts} +2 -2
- package/dist/{PreparedInputAdmission-KLk5rGFI.d.mts → PreparedInputAdmission-D3-BgmA9.d.mts} +8 -4
- package/dist/{Records-Bidb7ByL.d.mts → Records-B4S02MX1.d.mts} +201 -14
- package/dist/{RunJournal-srpbEBEy.mjs → RunJournal-BdIlgAEj.mjs} +2 -2
- package/dist/{RunJournal-srpbEBEy.mjs.map → RunJournal-BdIlgAEj.mjs.map} +1 -1
- package/dist/{RunOptions-Bruk54SE.d.mts → RunOptions-qOcPv08p.d.mts} +10 -5
- package/dist/{Schedule-Cy9up8Uf.d.mts → Schedule-D2TVEu3W.d.mts} +7 -2
- package/dist/{Scheduling-CHCsSCGo.mjs → Scheduling-DPb2QyAK.mjs} +2 -2
- package/dist/{Scheduling-CHCsSCGo.mjs.map → Scheduling-DPb2QyAK.mjs.map} +1 -1
- package/dist/{Subagent-DP0CzO16.d.mts → Subagent-BxuDuCHt.d.mts} +172 -8
- package/dist/{Subagent-C2s8PFrd.mjs → Subagent-uXWHXiKb.mjs} +64 -29
- package/dist/Subagent-uXWHXiKb.mjs.map +1 -0
- package/dist/{SubagentHost-CYcxkpRc.d.mts → SubagentHost-DEPw4YME.d.mts} +6 -3
- package/dist/{Subscription-CHyoQelH.d.mts → Subscription-nX0rz4GQ.d.mts} +3 -3
- package/dist/{SubscriptionInput-DqrHW-Ja.d.mts → SubscriptionInput-CAG3_pyJ.d.mts} +3 -3
- package/dist/{Worker--j87JI__.d.mts → Worker-Bbj9uq5H.d.mts} +5 -2
- package/dist/{agent-registration-ByeHejH3.mjs → agent-registration-B5CI-Ygk.mjs} +7 -5
- package/dist/agent-registration-B5CI-Ygk.mjs.map +1 -0
- package/dist/capabilities/Commands.d.mts +1 -1
- package/dist/capabilities/Messaging.d.mts +2 -2
- package/dist/capabilities/RunHooks.d.mts +1 -1
- package/dist/capabilities/Subagent.d.mts +2 -2
- package/dist/capabilities/Subagent.mjs +1 -1
- package/dist/core/Agent.d.mts +1 -1
- package/dist/core/AgentError.d.mts +2 -2
- package/dist/core/AgentError.mjs +19 -2
- package/dist/core/AgentError.mjs.map +1 -1
- package/dist/core/FailureDiagnostic.d.mts +2 -0
- package/dist/core/FailureDiagnostic.mjs +2 -0
- package/dist/core/Worker.d.mts +1 -1
- package/dist/core/Worker.mjs +4 -1
- package/dist/core/Worker.mjs.map +1 -1
- package/dist/durable/ActivityStore.d.mts +1 -1
- package/dist/durable/ActivityStore.mjs +1 -1
- package/dist/durable/Admin.d.mts +1 -1
- package/dist/durable/Admin.mjs +1 -1
- package/dist/durable/AgentRegistration.d.mts +1 -1
- package/dist/durable/AgentRegistration.mjs +1 -1
- package/dist/durable/Certification.d.mts +1 -1
- package/dist/durable/CommittedActivity.d.mts +1 -1
- package/dist/durable/CommittedActivity.mjs +1 -1
- package/dist/durable/Digest.d.mts +1 -1
- package/dist/durable/Digest.mjs +7 -7
- package/dist/durable/Digest.mjs.map +1 -1
- package/dist/durable/DurableAgentRuntime.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.mjs +1 -1
- package/dist/durable/EventSource.d.mts +1 -1
- package/dist/durable/EventSource.mjs +1 -1
- package/dist/durable/GitHubWorkflowSource.d.mts +3 -3
- package/dist/durable/GitHubWorkflowSource.mjs +1 -1
- package/dist/durable/MessageDelivery.d.mts +15 -3
- package/dist/durable/MessageDelivery.mjs +44 -24
- package/dist/durable/MessageDelivery.mjs.map +1 -1
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +4 -1
- package/dist/durable/MessageDeliveryStoreConformance.mjs +1 -1
- package/dist/durable/PersistentHistory.d.mts +1 -1
- package/dist/durable/PersistentHistory.mjs +2 -2
- package/dist/durable/PreparedInputAdmission.d.mts +1 -1
- package/dist/durable/PreparedInputAdmission.mjs +8 -4
- package/dist/durable/PreparedInputAdmission.mjs.map +1 -1
- package/dist/durable/Records.d.mts +1 -1
- package/dist/durable/Records.mjs +831 -2
- package/dist/durable/Records.mjs.map +1 -0
- package/dist/durable/Recovery.d.mts +1 -1
- package/dist/durable/Recovery.mjs +1 -1
- package/dist/durable/RunJournal.d.mts +1 -1
- package/dist/durable/RunJournal.mjs +1 -1
- package/dist/durable/Schedule.d.mts +1 -1
- package/dist/durable/Schedule.mjs +12 -3
- package/dist/durable/Schedule.mjs.map +1 -1
- package/dist/durable/ScheduleStoreConformance.d.mts +1 -1
- package/dist/durable/ScheduleStoreConformance.mjs +1 -1
- package/dist/durable/ScheduleTransition.d.mts +1 -1
- package/dist/durable/ScheduleTransition.mjs +1 -1
- package/dist/durable/Scheduling.d.mts +2 -2
- package/dist/durable/Scheduling.mjs +1 -1
- package/dist/durable/SqlMessageDeliveryStore.mjs +13 -11
- package/dist/durable/SqlMessageDeliveryStore.mjs.map +1 -1
- package/dist/durable/SqlStorageV2Upgrade.d.mts +2 -2
- package/dist/durable/SqlStorageV2Upgrade.mjs +1 -1
- package/dist/durable/SqlSubscriptionStore.d.mts +2 -2
- package/dist/durable/SqlSubscriptionStore.mjs +1 -1
- package/dist/durable/SqlThreadNativeReads.d.mts +1 -1
- package/dist/durable/SqlThreadNativeReads.mjs +2 -2
- package/dist/durable/SubmissionLedger.d.mts +1 -1
- package/dist/durable/SubmissionLedger.mjs +6 -3
- package/dist/durable/SubmissionLedger.mjs.map +1 -1
- package/dist/durable/SubmissionLedgerConformance.d.mts +1 -1
- package/dist/durable/SubmissionLedgerConformance.mjs +1 -1
- package/dist/durable/SubmissionStatus.d.mts +1 -1
- package/dist/durable/Subscription.d.mts +1 -1
- package/dist/durable/Subscription.mjs +1 -1
- package/dist/durable/SubscriptionInput.d.mts +1 -1
- package/dist/durable/SubscriptionInput.mjs +2 -2
- package/dist/durable/SubscriptionStoreConformance.d.mts +1 -1
- package/dist/durable/SubscriptionStoreConformance.mjs +1 -1
- package/dist/durable/SubscriptionTools.d.mts +3 -3
- package/dist/durable/SubscriptionTransition.d.mts +1 -1
- package/dist/durable/SubscriptionTransition.mjs +1 -1
- package/dist/durable/Subscriptions.d.mts +5 -5
- package/dist/durable/Subscriptions.mjs +1 -1
- package/dist/durable/ThreadContextHistory.d.mts +1 -1
- package/dist/durable/ThreadContextHistory.mjs +1 -1
- package/dist/durable/ThreadContextHistoryProjection.d.mts +1 -1
- package/dist/durable/ThreadContextHistoryProjection.mjs +1 -1
- package/dist/durable/ThreadInvariants.d.mts +1 -1
- package/dist/durable/ThreadInvariants.mjs +2 -2
- package/dist/durable/ThreadProjection.d.mts +1 -1
- package/dist/durable/ThreadProjection.mjs +1 -1
- package/dist/durable/ThreadProjectionMaintenance.d.mts +1 -1
- package/dist/durable/ThreadStore.d.mts +1 -1
- package/dist/durable/ThreadStore.mjs +2 -2
- package/dist/durable/ThreadStoreConformance.d.mts +1 -1
- package/dist/durable/ThreadStoreConformance.mjs +1 -1
- package/dist/durable/ToolReconciler.mjs +1 -1
- package/dist/durable/WorkerHost.d.mts +3 -3
- package/dist/engine/AgentRuntime.d.mts +1 -1
- package/dist/engine/AgentRuntime.mjs +1 -1
- package/dist/engine/MessagingHost.d.mts +1 -1
- package/dist/engine/Output.d.mts +1 -1
- package/dist/engine/RunOptions.d.mts +1 -1
- package/dist/engine/RunOptions.mjs +2 -0
- package/dist/engine/RunOptions.mjs.map +1 -1
- package/dist/engine/SubagentHost.d.mts +1 -1
- package/dist/engine/SubagentHost.mjs.map +1 -1
- package/dist/index.d.mts +18 -17
- package/dist/index.mjs +8 -7
- package/package.json +1 -1
- package/src/capabilities/internal/subagent-background.ts +66 -23
- package/src/capabilities/internal/subagent-contract.ts +4 -0
- package/src/core/AgentError.ts +20 -0
- package/src/core/FailureDiagnostic.ts +343 -0
- package/src/core/Worker.ts +4 -1
- package/src/durable/Digest.ts +22 -28
- package/src/durable/DurableAgentRuntime.ts +37 -13
- package/src/durable/MessageDelivery.ts +82 -24
- package/src/durable/PreparedInputAdmission.ts +17 -4
- package/src/durable/Records.ts +5 -15
- package/src/durable/Schedule.ts +11 -2
- package/src/durable/SqlMessageDeliveryStore.ts +21 -9
- package/src/durable/SubmissionLedger.ts +4 -1
- package/src/durable/internal/agent-registration.ts +46 -14
- package/src/durable/internal/worker-host.ts +32 -19
- package/src/engine/RunOptions.ts +11 -3
- package/src/engine/SubagentHost.ts +3 -0
- package/src/engine/internal/agent-runtime.ts +23 -16
- package/src/index.ts +1 -0
- package/dist/AgentRuntime-BWOnNc0d.mjs.map +0 -1
- package/dist/DurableAgentRuntime-C9eRZS9N.mjs.map +0 -1
- package/dist/Records-D8167fHn.mjs +0 -844
- package/dist/Records-D8167fHn.mjs.map +0 -1
- package/dist/Subagent-C2s8PFrd.mjs.map +0 -1
- package/dist/agent-registration-ByeHejH3.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as PersistedJson } from "./Records-
|
|
2
|
-
import { E as SubscriptionSourceError, b as SubscriptionRecord, i as EventSourceVersion, t as AcceptedEvent } from "./Subscription-
|
|
1
|
+
import { O as PersistedJson } from "./Records-B4S02MX1.mjs";
|
|
2
|
+
import { E as SubscriptionSourceError, b as SubscriptionRecord, i as EventSourceVersion, t as AcceptedEvent } from "./Subscription-nX0rz4GQ.mjs";
|
|
3
3
|
import { Context, Effect, Schema, Scope } from "effect";
|
|
4
4
|
declare namespace EventSource_d_exports {
|
|
5
5
|
export { EventSource, EventSources, NormalizedEvent, makeEventSource };
|
|
@@ -48,4 +48,4 @@ declare const makeEventSource: <Event extends Schema.Top, Parameters extends Sch
|
|
|
48
48
|
}) => Effect.Effect<EventSource, never, Exclude<R, Scope.Scope> | Exclude<Event["DecodingServices"], Scope.Scope> | Exclude<Event["EncodingServices"], Scope.Scope> | Exclude<Parameters["DecodingServices"], Scope.Scope> | Exclude<Parameters["EncodingServices"], Scope.Scope>>;
|
|
49
49
|
//#endregion
|
|
50
50
|
export { makeEventSource as a, NormalizedEvent as i, EventSource_d_exports as n, EventSources as r, EventSource as t };
|
|
51
|
-
//# sourceMappingURL=EventSource-
|
|
51
|
+
//# sourceMappingURL=EventSource-pH-v0k42.d.mts.map
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { Cause, Exit, Predicate, Redacted, Schema, SchemaParser, SchemaTransformation } from "effect";
|
|
3
|
+
//#region src/core/internal/strict-schema.ts
|
|
4
|
+
/** Keep strict parsing on nested values even when an outer parser uses its defaults. */
|
|
5
|
+
const strictSchema = (schema) => Schema.declareConstructor()([schema], ([codec]) => (value, _ast, options) => SchemaParser.decodeUnknownEffect(codec)(value, {
|
|
6
|
+
...options,
|
|
7
|
+
onExcessProperty: "error"
|
|
8
|
+
}), { toCodecJson: ([codec]) => Schema.link()(codec, SchemaTransformation.passthrough()) });
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/core/FailureDiagnostic.ts
|
|
11
|
+
var FailureDiagnostic_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
+
Cause: () => Cause$1,
|
|
13
|
+
Context: () => Context$1,
|
|
14
|
+
Diagnostic: () => Diagnostic,
|
|
15
|
+
Failure: () => Failure,
|
|
16
|
+
Value: () => Value,
|
|
17
|
+
capture: () => capture,
|
|
18
|
+
captureContext: () => captureContext,
|
|
19
|
+
redactText: () => redactText
|
|
20
|
+
});
|
|
21
|
+
const Text = Schema.String.check(Schema.isMaxLength(16384));
|
|
22
|
+
const Name = Schema.String.check(Schema.isMaxLength(1024));
|
|
23
|
+
const Scalar = Schema.Union([
|
|
24
|
+
Text,
|
|
25
|
+
Schema.Finite,
|
|
26
|
+
Schema.Boolean,
|
|
27
|
+
Schema.Null
|
|
28
|
+
]);
|
|
29
|
+
/** Correlation only: never include inputs, tool parameters, request bodies, or credentials. */
|
|
30
|
+
const Context$1 = Schema.Struct({
|
|
31
|
+
agentId: Schema.optionalKey(Name),
|
|
32
|
+
threadId: Schema.optionalKey(Name),
|
|
33
|
+
runId: Schema.optionalKey(Name),
|
|
34
|
+
submissionId: Schema.optionalKey(Name),
|
|
35
|
+
attemptId: Schema.optionalKey(Name),
|
|
36
|
+
turnId: Schema.optionalKey(Name),
|
|
37
|
+
toolCallId: Schema.optionalKey(Name),
|
|
38
|
+
toolName: Schema.optionalKey(Name),
|
|
39
|
+
callId: Schema.optionalKey(Name),
|
|
40
|
+
check: Schema.optionalKey(Name),
|
|
41
|
+
operation: Schema.optionalKey(Name)
|
|
42
|
+
}).pipe(strictSchema);
|
|
43
|
+
const diagnosticSchema = (nested) => Schema.Union([
|
|
44
|
+
Schema.Struct({
|
|
45
|
+
_tag: Schema.Literal("Error"),
|
|
46
|
+
errorTag: Schema.optionalKey(Name),
|
|
47
|
+
name: Schema.optionalKey(Name),
|
|
48
|
+
message: Schema.optionalKey(Text),
|
|
49
|
+
stack: Schema.optionalKey(Text),
|
|
50
|
+
reason: Schema.optionalKey(nested),
|
|
51
|
+
code: Schema.optionalKey(Schema.Union([Name, Schema.Finite])),
|
|
52
|
+
cause: Schema.optionalKey(nested),
|
|
53
|
+
errors: Schema.optionalKey(Schema.Array(nested).check(Schema.isMaxLength(128))),
|
|
54
|
+
context: Schema.optionalKey(Context$1),
|
|
55
|
+
omittedFields: Schema.optionalKey(Schema.Array(Name).check(Schema.isMaxLength(32))),
|
|
56
|
+
truncated: Schema.optionalKey(Schema.Literal(true))
|
|
57
|
+
}),
|
|
58
|
+
Schema.Struct({
|
|
59
|
+
_tag: Schema.Literal("Cause"),
|
|
60
|
+
reasons: Schema.Array(Schema.Union([
|
|
61
|
+
Schema.Struct({
|
|
62
|
+
_tag: Schema.Literal("Fail"),
|
|
63
|
+
error: nested
|
|
64
|
+
}),
|
|
65
|
+
Schema.Struct({
|
|
66
|
+
_tag: Schema.Literal("Die"),
|
|
67
|
+
defect: nested
|
|
68
|
+
}),
|
|
69
|
+
Schema.Struct({
|
|
70
|
+
_tag: Schema.Literal("Interrupt"),
|
|
71
|
+
fiberId: Schema.optionalKey(Schema.Finite)
|
|
72
|
+
})
|
|
73
|
+
])).check(Schema.isMaxLength(128)),
|
|
74
|
+
truncated: Schema.optionalKey(Schema.Literal(true))
|
|
75
|
+
}),
|
|
76
|
+
Schema.Struct({
|
|
77
|
+
_tag: Schema.Literal("Value"),
|
|
78
|
+
value: Scalar
|
|
79
|
+
}),
|
|
80
|
+
Schema.Struct({
|
|
81
|
+
_tag: Schema.Literal("Omitted"),
|
|
82
|
+
reason: Schema.Literals([
|
|
83
|
+
"redacted",
|
|
84
|
+
"cycle",
|
|
85
|
+
"limit",
|
|
86
|
+
"unsupported"
|
|
87
|
+
])
|
|
88
|
+
})
|
|
89
|
+
]);
|
|
90
|
+
/** Structured, allowlisted Error fields and ordered Effect Fail/Die/Interrupt reasons. */
|
|
91
|
+
const Diagnostic = Schema.suspend(() => diagnosticSchema(Diagnostic)).pipe(strictSchema);
|
|
92
|
+
const decodeDiagnosticNode = Schema.decodeUnknownExit(diagnosticSchema(Schema.Unknown).pipe(strictSchema));
|
|
93
|
+
/** Remove common credential forms; hosts must keep arbitrary private payloads out of error text. */
|
|
94
|
+
const redactText = (text) => text.replace(/\b(Bearer|Basic)\s+[A-Za-z0-9._~+/=-]+/gi, "$1 [REDACTED]").replace(/(https?:\/\/)[^\s/@]+:[^\s/@]+@/gi, "$1[REDACTED]@").replace(/([?&](?:access_token|api_key|apikey|token|key|secret|password|signature)=)[^\s&#]*/gi, "$1[REDACTED]").replace(/\b((?:api[_-]?key|access[_-]?token|authorization|password|secret)\s*[=:]\s*)[^\s,;}]+/gi, "$1[REDACTED]");
|
|
95
|
+
/**
|
|
96
|
+
* Capture only diagnostic fields. Local values are never mutated. Cycles and exhausted limits
|
|
97
|
+
* are explicit, not silently dropped; capture visits at most 1,024 nodes, with 56 JSON levels
|
|
98
|
+
* and 128 KiB text. Inner causes have priority over outer stacks when the text budget is exhausted.
|
|
99
|
+
* Text remains operator-private. No generic serializer can identify secrets embedded in arbitrary
|
|
100
|
+
* prose: application error messages must exclude payloads, and hosts may supply stricter redaction.
|
|
101
|
+
*/
|
|
102
|
+
const capture = (value, options) => {
|
|
103
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
104
|
+
let remainingNodes = 1024;
|
|
105
|
+
let remainingText = 131072;
|
|
106
|
+
const text = (value, limit = 16384) => {
|
|
107
|
+
const safe = (options?.redactText ?? redactText)(value);
|
|
108
|
+
const length = Math.max(0, Math.min(limit, remainingText));
|
|
109
|
+
const marker = "[truncated]".slice(0, length);
|
|
110
|
+
const result = safe.length <= length ? safe : `${safe.slice(0, length - marker.length)}${marker}`;
|
|
111
|
+
remainingText -= result.length;
|
|
112
|
+
return result;
|
|
113
|
+
};
|
|
114
|
+
const visit = (value, depth) => {
|
|
115
|
+
if (remainingNodes <= 0 || depth >= 56) return {
|
|
116
|
+
_tag: "Omitted",
|
|
117
|
+
reason: "limit"
|
|
118
|
+
};
|
|
119
|
+
remainingNodes--;
|
|
120
|
+
if (Redacted.isRedacted(value)) return {
|
|
121
|
+
_tag: "Omitted",
|
|
122
|
+
reason: "redacted"
|
|
123
|
+
};
|
|
124
|
+
if (Predicate.isString(value)) return {
|
|
125
|
+
_tag: "Value",
|
|
126
|
+
value: text(value)
|
|
127
|
+
};
|
|
128
|
+
if (value === null || Predicate.isBoolean(value) || Predicate.isNumber(value) && Number.isFinite(value)) return {
|
|
129
|
+
_tag: "Value",
|
|
130
|
+
value
|
|
131
|
+
};
|
|
132
|
+
if (!Predicate.isObject(value)) return {
|
|
133
|
+
_tag: "Omitted",
|
|
134
|
+
reason: "unsupported"
|
|
135
|
+
};
|
|
136
|
+
if (seen.has(value)) return {
|
|
137
|
+
_tag: "Omitted",
|
|
138
|
+
reason: "cycle"
|
|
139
|
+
};
|
|
140
|
+
seen.add(value);
|
|
141
|
+
const nested = (value) => visit(value, depth + 1);
|
|
142
|
+
const decoded = value instanceof Error ? void 0 : decodeDiagnosticNode(value);
|
|
143
|
+
const node = decoded !== void 0 && Exit.isSuccess(decoded) ? decoded.value : void 0;
|
|
144
|
+
if (node?._tag === "Omitted" || node?._tag === "Value") {
|
|
145
|
+
seen.delete(value);
|
|
146
|
+
return node._tag === "Value" && typeof node.value === "string" ? {
|
|
147
|
+
_tag: "Value",
|
|
148
|
+
value: text(node.value)
|
|
149
|
+
} : node;
|
|
150
|
+
}
|
|
151
|
+
const originalReasons = Cause.isCause(value) ? value.reasons : node?._tag === "Cause" ? node.reasons : void 0;
|
|
152
|
+
if (originalReasons !== void 0) {
|
|
153
|
+
const reasons = [];
|
|
154
|
+
for (const reason of originalReasons) {
|
|
155
|
+
if (reasons.length >= 128 || remainingNodes <= 0) break;
|
|
156
|
+
remainingNodes--;
|
|
157
|
+
switch (reason._tag) {
|
|
158
|
+
case "Fail":
|
|
159
|
+
reasons.push({
|
|
160
|
+
_tag: "Fail",
|
|
161
|
+
error: visit(reason.error, depth + 3)
|
|
162
|
+
});
|
|
163
|
+
break;
|
|
164
|
+
case "Die":
|
|
165
|
+
reasons.push({
|
|
166
|
+
_tag: "Die",
|
|
167
|
+
defect: visit(reason.defect, depth + 3)
|
|
168
|
+
});
|
|
169
|
+
break;
|
|
170
|
+
case "Interrupt": reasons.push({
|
|
171
|
+
_tag: "Interrupt",
|
|
172
|
+
...reason.fiberId === void 0 ? {} : { fiberId: reason.fiberId }
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const result = {
|
|
177
|
+
_tag: "Cause",
|
|
178
|
+
...originalReasons.length > reasons.length || node?._tag === "Cause" && node.truncated ? { truncated: true } : {},
|
|
179
|
+
reasons
|
|
180
|
+
};
|
|
181
|
+
seen.delete(value);
|
|
182
|
+
return result;
|
|
183
|
+
}
|
|
184
|
+
const retained = node?._tag === "Error" ? node : void 0;
|
|
185
|
+
const omittedFields = [];
|
|
186
|
+
const read = (key) => {
|
|
187
|
+
try {
|
|
188
|
+
return Reflect.get(value, key);
|
|
189
|
+
} catch {
|
|
190
|
+
omittedFields.push(key);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
const tag = retained === void 0 ? read("_tag") : retained.errorTag;
|
|
195
|
+
const name = read("name");
|
|
196
|
+
const message = read("message");
|
|
197
|
+
const stack = read("stack");
|
|
198
|
+
const reason = read("reason");
|
|
199
|
+
const code = read("code");
|
|
200
|
+
const cause = read("cause");
|
|
201
|
+
const errors = read("errors");
|
|
202
|
+
const capturedCause = cause === void 0 ? void 0 : nested(cause);
|
|
203
|
+
const capturedReason = reason === void 0 ? void 0 : nested(reason);
|
|
204
|
+
const capturedErrors = [];
|
|
205
|
+
if (Array.isArray(errors)) for (const error of errors) {
|
|
206
|
+
if (capturedErrors.length >= 128 || remainingNodes <= 0) break;
|
|
207
|
+
capturedErrors.push(visit(error, depth + 2));
|
|
208
|
+
}
|
|
209
|
+
for (const field of retained?.omittedFields ?? []) omittedFields.push(text(field, 1024));
|
|
210
|
+
const context = {};
|
|
211
|
+
for (const key of [
|
|
212
|
+
"agentId",
|
|
213
|
+
"threadId",
|
|
214
|
+
"runId",
|
|
215
|
+
"submissionId",
|
|
216
|
+
"attemptId",
|
|
217
|
+
"turnId",
|
|
218
|
+
"toolCallId",
|
|
219
|
+
"toolName",
|
|
220
|
+
"callId",
|
|
221
|
+
"check",
|
|
222
|
+
"operation"
|
|
223
|
+
]) {
|
|
224
|
+
const field = retained === void 0 ? read(key) : retained.context?.[key];
|
|
225
|
+
if (Predicate.isString(field)) context[key] = text(field, 1024);
|
|
226
|
+
}
|
|
227
|
+
const result = {
|
|
228
|
+
_tag: "Error",
|
|
229
|
+
...Predicate.isString(tag) ? { errorTag: text(tag, 1024) } : {},
|
|
230
|
+
...Predicate.isString(name) ? { name: text(name, 1024) } : {},
|
|
231
|
+
...Predicate.isString(message) ? { message: text(message) } : {},
|
|
232
|
+
...Predicate.isString(stack) ? { stack: text(stack) } : {},
|
|
233
|
+
...capturedReason === void 0 ? {} : { reason: capturedReason },
|
|
234
|
+
...Predicate.isString(code) ? { code: text(code, 1024) } : Predicate.isNumber(code) && Number.isFinite(code) ? { code } : {},
|
|
235
|
+
...capturedCause === void 0 ? {} : { cause: capturedCause },
|
|
236
|
+
...Array.isArray(errors) ? { errors: capturedErrors } : {},
|
|
237
|
+
...Object.keys(context).length === 0 ? {} : { context },
|
|
238
|
+
...omittedFields.length === 0 ? {} : { omittedFields },
|
|
239
|
+
...retained?.truncated || Array.isArray(errors) && errors.length > capturedErrors.length || remainingText === 0 ? { truncated: true } : {}
|
|
240
|
+
};
|
|
241
|
+
seen.delete(value);
|
|
242
|
+
return result;
|
|
243
|
+
};
|
|
244
|
+
return visit(value, 0);
|
|
245
|
+
};
|
|
246
|
+
/** Bound and redact a diagnostic copy; canonical identities stay in their owning records. */
|
|
247
|
+
const captureContext = (context) => {
|
|
248
|
+
const diagnostic = capture(context);
|
|
249
|
+
return diagnostic._tag === "Error" ? diagnostic.context ?? {} : {};
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Preserve the original value in-process; across JSON retain its structured diagnostic projection.
|
|
253
|
+
* Decoding returns Diagnostic data, never claims to reconstruct an application error class.
|
|
254
|
+
*/
|
|
255
|
+
const Value = Diagnostic.pipe(Schema.decodeTo(Schema.Unknown, SchemaTransformation.transform({
|
|
256
|
+
decode: (diagnostic) => diagnostic,
|
|
257
|
+
encode: (value) => capture(value)
|
|
258
|
+
})));
|
|
259
|
+
/** Original local Effect Cause; its JSON codec preserves ordered typed, defect and interrupt reasons. */
|
|
260
|
+
const Cause$1 = Schema.Cause(Value, Value).pipe(Schema.decodeTo(Schema.declare(Cause.isCause), SchemaTransformation.transform({
|
|
261
|
+
decode: (cause) => cause,
|
|
262
|
+
encode: (cause) => cause
|
|
263
|
+
})));
|
|
264
|
+
/** Safe summary plus optional operator-private causal evidence retained at a terminal boundary. */
|
|
265
|
+
const Failure = Schema.Struct({
|
|
266
|
+
errorTag: Schema.NonEmptyString.check(Schema.isMaxLength(256)),
|
|
267
|
+
message: Text,
|
|
268
|
+
diagnostic: Schema.optionalKey(Diagnostic),
|
|
269
|
+
context: Schema.optionalKey(Context$1)
|
|
270
|
+
}).pipe(strictSchema);
|
|
271
|
+
//#endregion
|
|
272
|
+
export { FailureDiagnostic_exports as a, captureContext as c, Failure as i, redactText as l, Context$1 as n, Value as o, Diagnostic as r, capture as s, Cause$1 as t, strictSchema as u };
|
|
273
|
+
|
|
274
|
+
//# sourceMappingURL=FailureDiagnostic-BElLOoED.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FailureDiagnostic-BElLOoED.mjs","names":["Context","EffectCause","Cause"],"sources":["../src/core/internal/strict-schema.ts","../src/core/FailureDiagnostic.ts"],"sourcesContent":["import { Schema, SchemaParser, SchemaTransformation } from \"effect\";\n\n/** Keep strict parsing on nested values even when an outer parser uses its defaults. */\nexport const strictSchema = <S extends Schema.Top>(schema: S) =>\n Schema.declareConstructor<S[\"Type\"], S[\"Encoded\"]>()(\n [schema],\n ([codec]) =>\n (value, _ast, options) =>\n SchemaParser.decodeUnknownEffect(codec)(value, { ...options, onExcessProperty: \"error\" }),\n {\n toCodecJson: ([codec]) =>\n Schema.link<S[\"Encoded\"]>()(codec, SchemaTransformation.passthrough()),\n },\n );\n","import {\n Cause as EffectCause,\n Exit,\n Predicate,\n Redacted,\n Schema,\n SchemaTransformation,\n} from \"effect\";\n\nimport { strictSchema } from \"./internal/strict-schema.ts\";\n\nconst Text = Schema.String.check(Schema.isMaxLength(16 * 1024));\nconst Name = Schema.String.check(Schema.isMaxLength(1_024));\nconst Scalar = Schema.Union([Text, Schema.Finite, Schema.Boolean, Schema.Null]);\n\n/** Correlation only: never include inputs, tool parameters, request bodies, or credentials. */\nexport const Context = Schema.Struct({\n agentId: Schema.optionalKey(Name),\n threadId: Schema.optionalKey(Name),\n runId: Schema.optionalKey(Name),\n submissionId: Schema.optionalKey(Name),\n attemptId: Schema.optionalKey(Name),\n turnId: Schema.optionalKey(Name),\n toolCallId: Schema.optionalKey(Name),\n toolName: Schema.optionalKey(Name),\n callId: Schema.optionalKey(Name),\n check: Schema.optionalKey(Name),\n operation: Schema.optionalKey(Name),\n}).pipe(strictSchema);\n\nexport type Context = typeof Context.Type;\n\ntype CauseReason =\n | { readonly _tag: \"Fail\"; readonly error: Diagnostic }\n | { readonly _tag: \"Die\"; readonly defect: Diagnostic }\n | { readonly _tag: \"Interrupt\"; readonly fiberId?: number };\n\n/** A private diagnostic projection, not a JavaScript error reconstruction or model response. */\nexport type Diagnostic =\n | {\n readonly _tag: \"Error\";\n readonly errorTag?: string;\n readonly name?: string;\n readonly message?: string;\n readonly stack?: string;\n readonly reason?: Diagnostic;\n readonly code?: string | number;\n readonly cause?: Diagnostic;\n readonly errors?: ReadonlyArray<Diagnostic>;\n readonly context?: Context;\n readonly omittedFields?: ReadonlyArray<string>;\n readonly truncated?: true;\n }\n | {\n readonly _tag: \"Cause\";\n readonly reasons: ReadonlyArray<CauseReason>;\n readonly truncated?: true;\n }\n | { readonly _tag: \"Value\"; readonly value: string | number | boolean | null }\n | { readonly _tag: \"Omitted\"; readonly reason: \"redacted\" | \"cycle\" | \"limit\" | \"unsupported\" };\n\nconst diagnosticSchema = <Nested extends Schema.Top>(nested: Nested) =>\n Schema.Union([\n Schema.Struct({\n _tag: Schema.Literal(\"Error\"),\n errorTag: Schema.optionalKey(Name),\n name: Schema.optionalKey(Name),\n message: Schema.optionalKey(Text),\n stack: Schema.optionalKey(Text),\n reason: Schema.optionalKey(nested),\n code: Schema.optionalKey(Schema.Union([Name, Schema.Finite])),\n cause: Schema.optionalKey(nested),\n errors: Schema.optionalKey(Schema.Array(nested).check(Schema.isMaxLength(128))),\n context: Schema.optionalKey(Context),\n omittedFields: Schema.optionalKey(Schema.Array(Name).check(Schema.isMaxLength(32))),\n truncated: Schema.optionalKey(Schema.Literal(true)),\n }),\n Schema.Struct({\n _tag: Schema.Literal(\"Cause\"),\n reasons: Schema.Array(\n Schema.Union([\n Schema.Struct({ _tag: Schema.Literal(\"Fail\"), error: nested }),\n Schema.Struct({ _tag: Schema.Literal(\"Die\"), defect: nested }),\n Schema.Struct({\n _tag: Schema.Literal(\"Interrupt\"),\n fiberId: Schema.optionalKey(Schema.Finite),\n }),\n ]),\n ).check(Schema.isMaxLength(128)),\n truncated: Schema.optionalKey(Schema.Literal(true)),\n }),\n Schema.Struct({ _tag: Schema.Literal(\"Value\"), value: Scalar }),\n Schema.Struct({\n _tag: Schema.Literal(\"Omitted\"),\n reason: Schema.Literals([\"redacted\", \"cycle\", \"limit\", \"unsupported\"]),\n }),\n ]);\n\n/** Structured, allowlisted Error fields and ordered Effect Fail/Die/Interrupt reasons. */\nexport const Diagnostic: Schema.Codec<Diagnostic> = Schema.suspend(() =>\n diagnosticSchema(Diagnostic),\n).pipe(strictSchema);\n\n// Inspect one encoded node only; recursion must share capture's depth/node/text budgets.\nconst decodeDiagnosticNode = Schema.decodeUnknownExit(\n diagnosticSchema(Schema.Unknown).pipe(strictSchema),\n);\n\n/** Remove common credential forms; hosts must keep arbitrary private payloads out of error text. */\nexport const redactText = (text: string): string =>\n text\n .replace(/\\b(Bearer|Basic)\\s+[A-Za-z0-9._~+/=-]+/gi, \"$1 [REDACTED]\")\n .replace(/(https?:\\/\\/)[^\\s/@]+:[^\\s/@]+@/gi, \"$1[REDACTED]@\")\n .replace(\n /([?&](?:access_token|api_key|apikey|token|key|secret|password|signature)=)[^\\s&#]*/gi,\n \"$1[REDACTED]\",\n )\n .replace(\n /\\b((?:api[_-]?key|access[_-]?token|authorization|password|secret)\\s*[=:]\\s*)[^\\s,;}]+/gi,\n \"$1[REDACTED]\",\n );\n\n/**\n * Capture only diagnostic fields. Local values are never mutated. Cycles and exhausted limits\n * are explicit, not silently dropped; capture visits at most 1,024 nodes, with 56 JSON levels\n * and 128 KiB text. Inner causes have priority over outer stacks when the text budget is exhausted.\n * Text remains operator-private. No generic serializer can identify secrets embedded in arbitrary\n * prose: application error messages must exclude payloads, and hosts may supply stricter redaction.\n */\nexport const capture = (\n value: unknown,\n options?: { readonly redactText?: (text: string) => string },\n): Diagnostic => {\n const seen = new WeakSet<object>();\n let remainingNodes = 1_024;\n let remainingText = 128 * 1024;\n\n const text = (value: string, limit = 16 * 1024): string => {\n const safe = (options?.redactText ?? redactText)(value);\n const length = Math.max(0, Math.min(limit, remainingText));\n\n const marker = \"[truncated]\".slice(0, length);\n\n const result =\n safe.length <= length ? safe : `${safe.slice(0, length - marker.length)}${marker}`;\n\n remainingText -= result.length;\n\n return result;\n };\n\n const visit = (value: unknown, depth: number): Diagnostic => {\n if (remainingNodes <= 0 || depth >= 56) return { _tag: \"Omitted\", reason: \"limit\" };\n remainingNodes--;\n if (Redacted.isRedacted(value)) return { _tag: \"Omitted\", reason: \"redacted\" };\n if (Predicate.isString(value)) return { _tag: \"Value\", value: text(value) };\n if (\n value === null ||\n Predicate.isBoolean(value) ||\n (Predicate.isNumber(value) && Number.isFinite(value))\n )\n return { _tag: \"Value\", value };\n if (!Predicate.isObject(value)) return { _tag: \"Omitted\", reason: \"unsupported\" };\n if (seen.has(value)) return { _tag: \"Omitted\", reason: \"cycle\" };\n seen.add(value);\n const nested = (value: unknown) => visit(value, depth + 1);\n // Local errors retain their own tag, even when it happens to be \"Error\".\n const decoded = value instanceof Error ? undefined : decodeDiagnosticNode(value);\n const node = decoded !== undefined && Exit.isSuccess(decoded) ? decoded.value : undefined;\n\n if (node?._tag === \"Omitted\" || node?._tag === \"Value\") {\n seen.delete(value);\n\n return node._tag === \"Value\" && typeof node.value === \"string\"\n ? { _tag: \"Value\", value: text(node.value) }\n : node;\n }\n\n const originalReasons = EffectCause.isCause(value)\n ? value.reasons\n : node?._tag === \"Cause\"\n ? node.reasons\n : undefined;\n\n if (originalReasons !== undefined) {\n const reasons: Array<CauseReason> = [];\n\n for (const reason of originalReasons) {\n if (reasons.length >= 128 || remainingNodes <= 0) break;\n remainingNodes--;\n\n // reasons -> array item -> error/defect contributes three JSON levels.\n switch (reason._tag) {\n case \"Fail\":\n reasons.push({ _tag: \"Fail\", error: visit(reason.error, depth + 3) });\n break;\n case \"Die\":\n reasons.push({ _tag: \"Die\", defect: visit(reason.defect, depth + 3) });\n break;\n case \"Interrupt\":\n reasons.push({\n _tag: \"Interrupt\",\n ...(reason.fiberId === undefined ? {} : { fiberId: reason.fiberId }),\n });\n break;\n }\n }\n\n const result: Diagnostic = {\n _tag: \"Cause\",\n ...(originalReasons.length > reasons.length || (node?._tag === \"Cause\" && node.truncated)\n ? { truncated: true }\n : {}),\n reasons,\n };\n\n seen.delete(value);\n\n return result;\n }\n const retained = node?._tag === \"Error\" ? node : undefined;\n const omittedFields: Array<string> = [];\n\n const read = (key: string): unknown => {\n // A throwing accessor must not replace the original failure during diagnostic capture.\n try {\n return Reflect.get(value, key);\n } catch {\n omittedFields.push(key);\n\n return undefined;\n }\n };\n\n const tag = retained === undefined ? read(\"_tag\") : retained.errorTag;\n const name = read(\"name\");\n const message = read(\"message\");\n const stack = read(\"stack\");\n const reason = read(\"reason\");\n const code = read(\"code\");\n const cause = read(\"cause\");\n const errors = read(\"errors\");\n const capturedCause = cause === undefined ? undefined : nested(cause);\n const capturedReason = reason === undefined ? undefined : nested(reason);\n const capturedErrors: Array<Diagnostic> = [];\n\n if (Array.isArray(errors))\n for (const error of errors) {\n if (capturedErrors.length >= 128 || remainingNodes <= 0) break;\n capturedErrors.push(visit(error, depth + 2));\n }\n\n for (const field of retained?.omittedFields ?? []) omittedFields.push(text(field, 1_024));\n\n const context: Record<string, string> = {};\n\n for (const key of [\n \"agentId\",\n \"threadId\",\n \"runId\",\n \"submissionId\",\n \"attemptId\",\n \"turnId\",\n \"toolCallId\",\n \"toolName\",\n \"callId\",\n \"check\",\n \"operation\",\n ] as const) {\n const field = retained === undefined ? read(key) : retained.context?.[key];\n\n if (Predicate.isString(field)) context[key] = text(field, 1_024);\n }\n\n const result: Diagnostic = {\n _tag: \"Error\",\n ...(Predicate.isString(tag) ? { errorTag: text(tag, 1_024) } : {}),\n ...(Predicate.isString(name) ? { name: text(name, 1_024) } : {}),\n ...(Predicate.isString(message) ? { message: text(message) } : {}),\n ...(Predicate.isString(stack) ? { stack: text(stack) } : {}),\n ...(capturedReason === undefined ? {} : { reason: capturedReason }),\n ...(Predicate.isString(code)\n ? { code: text(code, 1_024) }\n : Predicate.isNumber(code) && Number.isFinite(code)\n ? { code }\n : {}),\n ...(capturedCause === undefined ? {} : { cause: capturedCause }),\n ...(Array.isArray(errors) ? { errors: capturedErrors } : {}),\n ...(Object.keys(context).length === 0 ? {} : { context }),\n ...(omittedFields.length === 0 ? {} : { omittedFields }),\n ...(retained?.truncated ||\n (Array.isArray(errors) && errors.length > capturedErrors.length) ||\n remainingText === 0\n ? { truncated: true }\n : {}),\n };\n\n seen.delete(value);\n\n return result;\n };\n\n return visit(value, 0);\n};\n\n/** Bound and redact a diagnostic copy; canonical identities stay in their owning records. */\nexport const captureContext = (context: Context): Context => {\n const diagnostic = capture(context);\n\n return diagnostic._tag === \"Error\" ? (diagnostic.context ?? {}) : {};\n};\n\n/**\n * Preserve the original value in-process; across JSON retain its structured diagnostic projection.\n * Decoding returns Diagnostic data, never claims to reconstruct an application error class.\n */\nexport const Value = Diagnostic.pipe(\n Schema.decodeTo(\n Schema.Unknown,\n SchemaTransformation.transform({\n decode: (diagnostic): unknown => diagnostic,\n encode: (value: unknown) => capture(value),\n }),\n ),\n);\n\n/** Original local Effect Cause; its JSON codec preserves ordered typed, defect and interrupt reasons. */\nexport const Cause = Schema.Cause(Value, Value).pipe(\n Schema.decodeTo(\n Schema.declare<EffectCause.Cause<unknown>>(EffectCause.isCause),\n SchemaTransformation.transform({ decode: (cause) => cause, encode: (cause) => cause }),\n ),\n);\n\n/** Safe summary plus optional operator-private causal evidence retained at a terminal boundary. */\nexport const Failure = Schema.Struct({\n errorTag: Schema.NonEmptyString.check(Schema.isMaxLength(256)),\n message: Text,\n diagnostic: Schema.optionalKey(Diagnostic),\n context: Schema.optionalKey(Context),\n}).pipe(strictSchema);\n\nexport type Failure = typeof Failure.Type;\n"],"mappings":";;;;AAGA,MAAa,gBAAsC,WACjD,OAAO,mBAA4C,CAAC,CAClD,CAAC,MAAM,IACN,CAAC,YACC,OAAO,MAAM,YACZ,aAAa,oBAAoB,KAAK,CAAC,CAAC,OAAO;CAAE,GAAG;CAAS,kBAAkB;AAAQ,CAAC,GAC5F,EACE,cAAc,CAAC,WACb,OAAO,KAAmB,CAAC,CAAC,OAAO,qBAAqB,YAAY,CAAC,EACzE,CACF;;;;;;;;;;;;;ACFF,MAAM,OAAO,OAAO,OAAO,MAAM,OAAO,YAAY,KAAS,CAAC;AAC9D,MAAM,OAAO,OAAO,OAAO,MAAM,OAAO,YAAY,IAAK,CAAC;AAC1D,MAAM,SAAS,OAAO,MAAM;CAAC;CAAM,OAAO;C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Ac,WAAW,IAAI,CAAC,IAAI,EAAE,cAAc;GACtD,GAAI,UAAU,aACb,MAAM,QAAQ,MAAM,KAAK,OAAO,SAAS,eAAe,UACzD,kBAAkB,IACd,EAAE,WAAW,KAAK,IAClB,CAAC;EACP;EAEA,KAAK,OAAO,KAAK;EAEjB,OAAO;CACT;CAEA,OAAO,MAAM,OAAO,CAAC;AACvB;;AAGA,MAAa,kBAAkB,YAA8B;CAC3D,MAAM,aAAa,QAAQ,OAAO;CAElC,OAAO,WAAW,SAAS,UAAW,WAAW,WAAW,CAAC,IAAK,CAAC;AACrE;;;;;AAMA,MAAa,QAAQ,WAAW,KAC9B,OAAO,SACL,OAAO,SACP,qBAAqB,UAAU;CAC7B,SAAS,eAAwB;CACjC,SAAS,UAAmB,QAAQ,KAAK;AAC3C,CAAC,CACH,CACF;;AAGA,MAAaC,UAAQ,OAAO,MAAM,OAAO,KAAK,CAAC,CAAC,KAC9C,OAAO,SACL,OAAO,QAAoCD,MAAY,OAAO,GAC9D,qBAAqB,UAAU;CAAE,SAAS,UAAU;CAAO,SAAS,UAAU;AAAM,CAAC,CACvF,CACF;;AAGA,MAAa,UAAU,OAAO,OAAO;CACnC,UAAU,OAAO,eAAe,MAAM,OAAO,YAAY,GAAG,CAAC;CAC7D,SAAS;CACT,YAAY,OAAO,YAAY,UAAU;CACzC,SAAS,OAAO,YAAYD,SAAO;AACrC,CAAC,CAAC,CAAC,KAAK,YAAY"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { Cause, Schema } from "effect";
|
|
2
|
+
declare namespace FailureDiagnostic_d_exports {
|
|
3
|
+
export { Cause$1 as Cause, Context$1 as Context, Diagnostic, Failure, Value, capture, captureContext, redactText };
|
|
4
|
+
}
|
|
5
|
+
/** Correlation only: never include inputs, tool parameters, request bodies, or credentials. */
|
|
6
|
+
declare const Context$1: Schema.declareConstructor<{
|
|
7
|
+
readonly agentId?: string | undefined;
|
|
8
|
+
readonly threadId?: string | undefined;
|
|
9
|
+
readonly runId?: string | undefined;
|
|
10
|
+
readonly submissionId?: string | undefined;
|
|
11
|
+
readonly attemptId?: string | undefined;
|
|
12
|
+
readonly turnId?: string | undefined;
|
|
13
|
+
readonly toolCallId?: string | undefined;
|
|
14
|
+
readonly toolName?: string | undefined;
|
|
15
|
+
readonly callId?: string | undefined;
|
|
16
|
+
readonly check?: string | undefined;
|
|
17
|
+
readonly operation?: string | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
readonly agentId?: string | undefined;
|
|
20
|
+
readonly threadId?: string | undefined;
|
|
21
|
+
readonly runId?: string | undefined;
|
|
22
|
+
readonly submissionId?: string | undefined;
|
|
23
|
+
readonly attemptId?: string | undefined;
|
|
24
|
+
readonly turnId?: string | undefined;
|
|
25
|
+
readonly toolCallId?: string | undefined;
|
|
26
|
+
readonly toolName?: string | undefined;
|
|
27
|
+
readonly callId?: string | undefined;
|
|
28
|
+
readonly check?: string | undefined;
|
|
29
|
+
readonly operation?: string | undefined;
|
|
30
|
+
}, readonly [Schema.Struct<{
|
|
31
|
+
readonly agentId: Schema.optionalKey<Schema.String>;
|
|
32
|
+
readonly threadId: Schema.optionalKey<Schema.String>;
|
|
33
|
+
readonly runId: Schema.optionalKey<Schema.String>;
|
|
34
|
+
readonly submissionId: Schema.optionalKey<Schema.String>;
|
|
35
|
+
readonly attemptId: Schema.optionalKey<Schema.String>;
|
|
36
|
+
readonly turnId: Schema.optionalKey<Schema.String>;
|
|
37
|
+
readonly toolCallId: Schema.optionalKey<Schema.String>;
|
|
38
|
+
readonly toolName: Schema.optionalKey<Schema.String>;
|
|
39
|
+
readonly callId: Schema.optionalKey<Schema.String>;
|
|
40
|
+
readonly check: Schema.optionalKey<Schema.String>;
|
|
41
|
+
readonly operation: Schema.optionalKey<Schema.String>;
|
|
42
|
+
}>], {
|
|
43
|
+
readonly agentId?: string | undefined;
|
|
44
|
+
readonly threadId?: string | undefined;
|
|
45
|
+
readonly runId?: string | undefined;
|
|
46
|
+
readonly submissionId?: string | undefined;
|
|
47
|
+
readonly attemptId?: string | undefined;
|
|
48
|
+
readonly turnId?: string | undefined;
|
|
49
|
+
readonly toolCallId?: string | undefined;
|
|
50
|
+
readonly toolName?: string | undefined;
|
|
51
|
+
readonly callId?: string | undefined;
|
|
52
|
+
readonly check?: string | undefined;
|
|
53
|
+
readonly operation?: string | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
type Context$1 = typeof Context$1.Type;
|
|
56
|
+
type CauseReason = {
|
|
57
|
+
readonly _tag: "Fail";
|
|
58
|
+
readonly error: Diagnostic;
|
|
59
|
+
} | {
|
|
60
|
+
readonly _tag: "Die";
|
|
61
|
+
readonly defect: Diagnostic;
|
|
62
|
+
} | {
|
|
63
|
+
readonly _tag: "Interrupt";
|
|
64
|
+
readonly fiberId?: number;
|
|
65
|
+
};
|
|
66
|
+
/** A private diagnostic projection, not a JavaScript error reconstruction or model response. */
|
|
67
|
+
type Diagnostic = {
|
|
68
|
+
readonly _tag: "Error";
|
|
69
|
+
readonly errorTag?: string;
|
|
70
|
+
readonly name?: string;
|
|
71
|
+
readonly message?: string;
|
|
72
|
+
readonly stack?: string;
|
|
73
|
+
readonly reason?: Diagnostic;
|
|
74
|
+
readonly code?: string | number;
|
|
75
|
+
readonly cause?: Diagnostic;
|
|
76
|
+
readonly errors?: ReadonlyArray<Diagnostic>;
|
|
77
|
+
readonly context?: Context$1;
|
|
78
|
+
readonly omittedFields?: ReadonlyArray<string>;
|
|
79
|
+
readonly truncated?: true;
|
|
80
|
+
} | {
|
|
81
|
+
readonly _tag: "Cause";
|
|
82
|
+
readonly reasons: ReadonlyArray<CauseReason>;
|
|
83
|
+
readonly truncated?: true;
|
|
84
|
+
} | {
|
|
85
|
+
readonly _tag: "Value";
|
|
86
|
+
readonly value: string | number | boolean | null;
|
|
87
|
+
} | {
|
|
88
|
+
readonly _tag: "Omitted";
|
|
89
|
+
readonly reason: "redacted" | "cycle" | "limit" | "unsupported";
|
|
90
|
+
};
|
|
91
|
+
/** Structured, allowlisted Error fields and ordered Effect Fail/Die/Interrupt reasons. */
|
|
92
|
+
declare const Diagnostic: Schema.Codec<Diagnostic>;
|
|
93
|
+
/** Remove common credential forms; hosts must keep arbitrary private payloads out of error text. */
|
|
94
|
+
declare const redactText: (text: string) => string;
|
|
95
|
+
/**
|
|
96
|
+
* Capture only diagnostic fields. Local values are never mutated. Cycles and exhausted limits
|
|
97
|
+
* are explicit, not silently dropped; capture visits at most 1,024 nodes, with 56 JSON levels
|
|
98
|
+
* and 128 KiB text. Inner causes have priority over outer stacks when the text budget is exhausted.
|
|
99
|
+
* Text remains operator-private. No generic serializer can identify secrets embedded in arbitrary
|
|
100
|
+
* prose: application error messages must exclude payloads, and hosts may supply stricter redaction.
|
|
101
|
+
*/
|
|
102
|
+
declare const capture: (value: unknown, options?: {
|
|
103
|
+
readonly redactText?: (text: string) => string;
|
|
104
|
+
}) => Diagnostic;
|
|
105
|
+
/** Bound and redact a diagnostic copy; canonical identities stay in their owning records. */
|
|
106
|
+
declare const captureContext: (context: Context$1) => Context$1;
|
|
107
|
+
/**
|
|
108
|
+
* Preserve the original value in-process; across JSON retain its structured diagnostic projection.
|
|
109
|
+
* Decoding returns Diagnostic data, never claims to reconstruct an application error class.
|
|
110
|
+
*/
|
|
111
|
+
declare const Value: Schema.decodeTo<Schema.Unknown, Schema.Codec<Diagnostic, Diagnostic, never, never>, never, never>;
|
|
112
|
+
/** Original local Effect Cause; its JSON codec preserves ordered typed, defect and interrupt reasons. */
|
|
113
|
+
declare const Cause$1: Schema.decodeTo<Schema.declare<Cause.Cause<unknown>, Cause.Cause<unknown>>, Schema.Cause<Schema.decodeTo<Schema.Unknown, Schema.Codec<Diagnostic, Diagnostic, never, never>, never, never>, Schema.decodeTo<Schema.Unknown, Schema.Codec<Diagnostic, Diagnostic, never, never>, never, never>>, never, never>;
|
|
114
|
+
/** Safe summary plus optional operator-private causal evidence retained at a terminal boundary. */
|
|
115
|
+
declare const Failure: Schema.declareConstructor<{
|
|
116
|
+
readonly errorTag: string;
|
|
117
|
+
readonly message: string;
|
|
118
|
+
readonly diagnostic?: Diagnostic | undefined;
|
|
119
|
+
readonly context?: {
|
|
120
|
+
readonly agentId?: string | undefined;
|
|
121
|
+
readonly threadId?: string | undefined;
|
|
122
|
+
readonly runId?: string | undefined;
|
|
123
|
+
readonly submissionId?: string | undefined;
|
|
124
|
+
readonly attemptId?: string | undefined;
|
|
125
|
+
readonly turnId?: string | undefined;
|
|
126
|
+
readonly toolCallId?: string | undefined;
|
|
127
|
+
readonly toolName?: string | undefined;
|
|
128
|
+
readonly callId?: string | undefined;
|
|
129
|
+
readonly check?: string | undefined;
|
|
130
|
+
readonly operation?: string | undefined;
|
|
131
|
+
} | undefined;
|
|
132
|
+
}, {
|
|
133
|
+
readonly errorTag: string;
|
|
134
|
+
readonly message: string;
|
|
135
|
+
readonly diagnostic?: Diagnostic | undefined;
|
|
136
|
+
readonly context?: {
|
|
137
|
+
readonly agentId?: string | undefined;
|
|
138
|
+
readonly threadId?: string | undefined;
|
|
139
|
+
readonly runId?: string | undefined;
|
|
140
|
+
readonly submissionId?: string | undefined;
|
|
141
|
+
readonly attemptId?: string | undefined;
|
|
142
|
+
readonly turnId?: string | undefined;
|
|
143
|
+
readonly toolCallId?: string | undefined;
|
|
144
|
+
readonly toolName?: string | undefined;
|
|
145
|
+
readonly callId?: string | undefined;
|
|
146
|
+
readonly check?: string | undefined;
|
|
147
|
+
readonly operation?: string | undefined;
|
|
148
|
+
} | undefined;
|
|
149
|
+
}, readonly [Schema.Struct<{
|
|
150
|
+
readonly errorTag: Schema.NonEmptyString;
|
|
151
|
+
readonly message: Schema.String;
|
|
152
|
+
readonly diagnostic: Schema.optionalKey<Schema.Codec<Diagnostic, Diagnostic, never, never>>;
|
|
153
|
+
readonly context: Schema.optionalKey<Schema.declareConstructor<{
|
|
154
|
+
readonly agentId?: string | undefined;
|
|
155
|
+
readonly threadId?: string | undefined;
|
|
156
|
+
readonly runId?: string | undefined;
|
|
157
|
+
readonly submissionId?: string | undefined;
|
|
158
|
+
readonly attemptId?: string | undefined;
|
|
159
|
+
readonly turnId?: string | undefined;
|
|
160
|
+
readonly toolCallId?: string | undefined;
|
|
161
|
+
readonly toolName?: string | undefined;
|
|
162
|
+
readonly callId?: string | undefined;
|
|
163
|
+
readonly check?: string | undefined;
|
|
164
|
+
readonly operation?: string | undefined;
|
|
165
|
+
}, {
|
|
166
|
+
readonly agentId?: string | undefined;
|
|
167
|
+
readonly threadId?: string | undefined;
|
|
168
|
+
readonly runId?: string | undefined;
|
|
169
|
+
readonly submissionId?: string | undefined;
|
|
170
|
+
readonly attemptId?: string | undefined;
|
|
171
|
+
readonly turnId?: string | undefined;
|
|
172
|
+
readonly toolCallId?: string | undefined;
|
|
173
|
+
readonly toolName?: string | undefined;
|
|
174
|
+
readonly callId?: string | undefined;
|
|
175
|
+
readonly check?: string | undefined;
|
|
176
|
+
readonly operation?: string | undefined;
|
|
177
|
+
}, readonly [Schema.Struct<{
|
|
178
|
+
readonly agentId: Schema.optionalKey<Schema.String>;
|
|
179
|
+
readonly threadId: Schema.optionalKey<Schema.String>;
|
|
180
|
+
readonly runId: Schema.optionalKey<Schema.String>;
|
|
181
|
+
readonly submissionId: Schema.optionalKey<Schema.String>;
|
|
182
|
+
readonly attemptId: Schema.optionalKey<Schema.String>;
|
|
183
|
+
readonly turnId: Schema.optionalKey<Schema.String>;
|
|
184
|
+
readonly toolCallId: Schema.optionalKey<Schema.String>;
|
|
185
|
+
readonly toolName: Schema.optionalKey<Schema.String>;
|
|
186
|
+
readonly callId: Schema.optionalKey<Schema.String>;
|
|
187
|
+
readonly check: Schema.optionalKey<Schema.String>;
|
|
188
|
+
readonly operation: Schema.optionalKey<Schema.String>;
|
|
189
|
+
}>], {
|
|
190
|
+
readonly agentId?: string | undefined;
|
|
191
|
+
readonly threadId?: string | undefined;
|
|
192
|
+
readonly runId?: string | undefined;
|
|
193
|
+
readonly submissionId?: string | undefined;
|
|
194
|
+
readonly attemptId?: string | undefined;
|
|
195
|
+
readonly turnId?: string | undefined;
|
|
196
|
+
readonly toolCallId?: string | undefined;
|
|
197
|
+
readonly toolName?: string | undefined;
|
|
198
|
+
readonly callId?: string | undefined;
|
|
199
|
+
readonly check?: string | undefined;
|
|
200
|
+
readonly operation?: string | undefined;
|
|
201
|
+
}>>;
|
|
202
|
+
}>], {
|
|
203
|
+
readonly errorTag: string;
|
|
204
|
+
readonly message: string;
|
|
205
|
+
readonly diagnostic?: Diagnostic | undefined;
|
|
206
|
+
readonly context?: {
|
|
207
|
+
readonly agentId?: string | undefined;
|
|
208
|
+
readonly threadId?: string | undefined;
|
|
209
|
+
readonly runId?: string | undefined;
|
|
210
|
+
readonly submissionId?: string | undefined;
|
|
211
|
+
readonly attemptId?: string | undefined;
|
|
212
|
+
readonly turnId?: string | undefined;
|
|
213
|
+
readonly toolCallId?: string | undefined;
|
|
214
|
+
readonly toolName?: string | undefined;
|
|
215
|
+
readonly callId?: string | undefined;
|
|
216
|
+
readonly check?: string | undefined;
|
|
217
|
+
readonly operation?: string | undefined;
|
|
218
|
+
} | undefined;
|
|
219
|
+
}>;
|
|
220
|
+
type Failure = typeof Failure.Type;
|
|
221
|
+
//#endregion
|
|
222
|
+
export { FailureDiagnostic_d_exports as a, captureContext as c, Failure as i, redactText as l, Context$1 as n, Value as o, Diagnostic as r, capture as s, Cause$1 as t };
|
|
223
|
+
//# sourceMappingURL=FailureDiagnostic-CaAkzGHL.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as Receipt, t as IdempotencyKey } from "./Receipt-BAHyigAF.mjs";
|
|
2
|
-
import { r as AnyDefinition } from "./Agent-
|
|
3
|
-
import { _ as MessagingError, d as InboxPage, f as InputMessage, g as MessageStatus, h as MessageRef, m as MessageAdmission, p as MessageAddress, t as MessagingHost, u as InboxEntry, v as PeerName } from "./MessagingHost-
|
|
2
|
+
import { r as AnyDefinition } from "./Agent-Bk-mLtov.mjs";
|
|
3
|
+
import { _ as MessagingError, d as InboxPage, f as InputMessage, g as MessageStatus, h as MessageRef, m as MessageAdmission, p as MessageAddress, t as MessagingHost, u as InboxEntry, v as PeerName } from "./MessagingHost-nwBMdRoh.mjs";
|
|
4
4
|
import { Tool, Toolkit } from "effect/unstable/ai";
|
|
5
5
|
import { Crypto, Effect, Schema } from "effect";
|
|
6
6
|
declare namespace Messaging_d_exports {
|
|
@@ -487,4 +487,4 @@ declare const retryTool: <const Name extends string, Input extends Schema.Top>(d
|
|
|
487
487
|
};
|
|
488
488
|
//#endregion
|
|
489
489
|
export { inspect as a, reply as c, retryTool as d, send as f, inboxTool as i, replyTool as l, Peer as n, inspectTool as o, sendTool as p, inbox as r, peer as s, Messaging_d_exports as t, retry as u };
|
|
490
|
-
//# sourceMappingURL=Messaging-
|
|
490
|
+
//# sourceMappingURL=Messaging-Bl4SBKpR.d.mts.map
|
|
@@ -2,8 +2,8 @@ import { u as ThreadId } from "./Identifiers-CN2s30fF.mjs";
|
|
|
2
2
|
import { s as SubagentExecutionFailure } from "./SubagentContract-DdT7Cqe6.mjs";
|
|
3
3
|
import { a as Receipt, r as Principal, t as IdempotencyKey } from "./Receipt-BAHyigAF.mjs";
|
|
4
4
|
import { r as Update } from "./AgentUpdates-DMJ-_xow.mjs";
|
|
5
|
-
import { r as AnyDefinition } from "./Agent-
|
|
6
|
-
import { u as WorkerSource } from "./Worker
|
|
5
|
+
import { r as AnyDefinition } from "./Agent-Bk-mLtov.mjs";
|
|
6
|
+
import { u as WorkerSource } from "./Worker-Bbj9uq5H.mjs";
|
|
7
7
|
import { Context, Effect, Schema } from "effect";
|
|
8
8
|
//#region src/core/Messaging.d.ts
|
|
9
9
|
/** Application-chosen fixed route name; it never authorizes a destination by itself. */
|
|
@@ -243,4 +243,4 @@ declare const PeerDeliveryLifetime: Context.Reference<number>;
|
|
|
243
243
|
declare const PeerMessageCapacity: Context.Reference<number>;
|
|
244
244
|
//#endregion
|
|
245
245
|
export { MessagingError as _, PeerDeliveryLifetime as a, PeerTarget as c, InboxPage as d, InputMessage as f, MessageStatus as g, MessageRef as h, PeerAuthorizer as i, SendPeerMessage as l, MessageAdmission as m, MessagingHost_d_exports as n, PeerMessageCapacity as o, MessageAddress as p, PeerAuthorizationRequest as r, PeerRoutes as s, MessagingHost as t, InboxEntry as u, PeerName as v };
|
|
246
|
-
//# sourceMappingURL=MessagingHost-
|
|
246
|
+
//# sourceMappingURL=MessagingHost-nwBMdRoh.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./Agent-
|
|
1
|
+
import "./Agent-Bk-mLtov.mjs";
|
|
2
2
|
import { Prompt } from "effect/unstable/ai";
|
|
3
3
|
import { Schema } from "effect";
|
|
4
4
|
//#region src/engine/internal/output-contract.d.ts
|
|
@@ -22,4 +22,4 @@ declare namespace Output_d_exports {
|
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
24
|
export { textOutput as n, Output_d_exports as t };
|
|
25
|
-
//# sourceMappingURL=Output-
|
|
25
|
+
//# sourceMappingURL=Output-B6RQ5jRU.d.mts.map
|
package/dist/{PreparedInputAdmission-KLk5rGFI.d.mts → PreparedInputAdmission-D3-BgmA9.d.mts}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { a as Receipt } from "./Receipt-BAHyigAF.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { a as FailureDiagnostic_d_exports, r as Diagnostic } from "./FailureDiagnostic-CaAkzGHL.mjs";
|
|
3
|
+
import { Dn as SubmissionStatus } from "./Records-B4S02MX1.mjs";
|
|
4
|
+
import { H as ScheduledInputRefused, V as ScheduledInputFailure, j as ScheduleStorageError } from "./Schedule-D2TVEu3W.mjs";
|
|
5
|
+
import { a as PreparedInput } from "./Subscription-nX0rz4GQ.mjs";
|
|
5
6
|
import { Context, Effect } from "effect";
|
|
6
7
|
declare namespace PreparedInputAdmission_d_exports {
|
|
7
8
|
export { PreparedInputAdmission, admitPreparedInput };
|
|
@@ -26,13 +27,16 @@ declare const admitPreparedInput: <R>(submit: Effect.Effect<Receipt, ScheduledIn
|
|
|
26
27
|
} | {
|
|
27
28
|
_tag: "Retry";
|
|
28
29
|
reason: "ambiguous" | "capacity" | "host-closed" | "storage" | "timeout" | "transport";
|
|
30
|
+
diagnostic: Diagnostic;
|
|
29
31
|
} | {
|
|
30
32
|
_tag: "Retry";
|
|
31
33
|
reason: "timeout";
|
|
34
|
+
diagnostic: Diagnostic;
|
|
32
35
|
} | {
|
|
33
36
|
_tag: "Retry";
|
|
34
37
|
reason: "storage";
|
|
38
|
+
diagnostic: Diagnostic;
|
|
35
39
|
}, ScheduleStorageError, R>;
|
|
36
40
|
//#endregion
|
|
37
41
|
export { PreparedInputAdmission_d_exports as n, admitPreparedInput as r, PreparedInputAdmission as t };
|
|
38
|
-
//# sourceMappingURL=PreparedInputAdmission-
|
|
42
|
+
//# sourceMappingURL=PreparedInputAdmission-D3-BgmA9.d.mts.map
|