stitchkit 0.70.6 → 0.72.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/agent-runtime/coding-tool-contract.d.ts +11 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-files.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-listing.d.ts +15 -0
- package/dist/agent-runtime/coding-tool-listing.d.ts.map +1 -0
- package/dist/agent-runtime/coding-tool-paths.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-refusals.d.ts +59 -0
- package/dist/agent-runtime/coding-tool-refusals.d.ts.map +1 -0
- package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tools.d.ts +3 -1
- package/dist/agent-runtime/coding-tools.d.ts.map +1 -1
- package/dist/agent-runtime/compaction.d.ts +35 -0
- package/dist/agent-runtime/compaction.d.ts.map +1 -1
- package/dist/agent-runtime/contained-files.d.ts +21 -2
- package/dist/agent-runtime/contained-files.d.ts.map +1 -1
- package/dist/agent-runtime/provider-failure.d.ts +66 -0
- package/dist/agent-runtime/provider-failure.d.ts.map +1 -0
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/runtime.d.ts +31 -1
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/schemas.d.ts +1 -0
- package/dist/agent-runtime/schemas.d.ts.map +1 -1
- package/dist/agent-runtime-coding-tools.js +438 -124
- package/dist/agent-runtime-harness.js +4 -4
- package/dist/agent-runtime-openrouter.d.ts +19 -0
- package/dist/agent-runtime-openrouter.d.ts.map +1 -1
- package/dist/agent-runtime-openrouter.js +2 -1
- package/dist/agent-runtime.d.ts +3 -2
- package/dist/agent-runtime.d.ts.map +1 -1
- package/dist/agent-runtime.js +118 -14
- package/dist/application/admission.d.ts +22 -2
- package/dist/application/admission.d.ts.map +1 -1
- package/dist/application/channel.d.ts +28 -0
- package/dist/application/channel.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-contract.d.ts +20 -0
- package/dist/application/diagnostic-journal-contract.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-lock.d.ts +17 -0
- package/dist/application/diagnostic-journal-lock.d.ts.map +1 -0
- package/dist/application/diagnostic-journal-manager.d.ts +2 -1
- package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-storage.d.ts +4 -1
- package/dist/application/diagnostic-journal-storage.d.ts.map +1 -1
- package/dist/application/diagnostic-journal.d.ts +4 -2
- package/dist/application/diagnostic-journal.d.ts.map +1 -1
- package/dist/application-opentelemetry.js +1 -1
- package/dist/application.d.ts +3 -3
- package/dist/application.d.ts.map +1 -1
- package/dist/application.js +134 -21
- package/dist/browser/resumable.d.ts +56 -0
- package/dist/browser/resumable.d.ts.map +1 -0
- package/dist/cli.js +5 -5
- package/dist/{index-cx84zg25.js → index-118v0z41.js} +1 -1
- package/dist/{index-zpyj7hsv.js → index-3cwck0rm.js} +98 -33
- package/dist/{index-ejv31h14.js → index-7qy2ex0m.js} +1 -1
- package/dist/{index-trrf7nch.js → index-ezmn6ac6.js} +3 -3
- package/dist/{index-ekkt4gy9.js → index-jqtsc9mj.js} +2 -2
- package/dist/{index-hxtm2xr2.js → index-k2zczx1g.js} +1 -1
- package/dist/{index-by57nwhc.js → index-m668wzyc.js} +10 -2
- package/dist/{index-w9m1wznn.js → index-nemjkxjp.js} +118 -1
- package/dist/{index-tnazr5tc.js → index-pz7ytdga.js} +3 -3
- package/dist/{index-1z5xxfst.js → index-rqpdar1e.js} +102 -5
- package/dist/{index-qm87g51s.js → index-s4c8wy8m.js} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +103 -14
- package/dist/node.js +2 -2
- package/dist/observability/index.js +1 -1
- package/dist/primitives/audit.d.ts +52 -0
- package/dist/primitives/audit.d.ts.map +1 -0
- package/dist/primitives/deadline.d.ts +39 -0
- package/dist/primitives/deadline.d.ts.map +1 -0
- package/dist/primitives/decimal.d.ts +10 -0
- package/dist/primitives/decimal.d.ts.map +1 -0
- package/dist/primitives/delivery.d.ts +96 -0
- package/dist/primitives/delivery.d.ts.map +1 -0
- package/dist/primitives/event.d.ts +42 -0
- package/dist/primitives/event.d.ts.map +1 -0
- package/dist/primitives/export-operation.d.ts +89 -0
- package/dist/primitives/export-operation.d.ts.map +1 -0
- package/dist/primitives/index.d.ts +12 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/lifecycle.d.ts +90 -0
- package/dist/primitives/lifecycle.d.ts.map +1 -0
- package/dist/primitives/migration-checks.d.ts +15 -0
- package/dist/primitives/migration-checks.d.ts.map +1 -0
- package/dist/primitives/money.d.ts +43 -0
- package/dist/primitives/money.d.ts.map +1 -0
- package/dist/primitives/owner-scope.d.ts +30 -0
- package/dist/primitives/owner-scope.d.ts.map +1 -0
- package/dist/primitives/permission.d.ts +28 -0
- package/dist/primitives/permission.d.ts.map +1 -0
- package/dist/primitives/quantity.d.ts +57 -0
- package/dist/primitives/quantity.d.ts.map +1 -0
- package/dist/primitives.d.ts +3 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +750 -0
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +4 -2
- package/dist/server/request.d.ts +19 -0
- package/dist/server/request.d.ts.map +1 -1
- package/dist/telegram/init-data.d.ts +134 -0
- package/dist/telegram/init-data.d.ts.map +1 -0
- package/dist/telegram/send-failure.d.ts +73 -0
- package/dist/telegram/send-failure.d.ts.map +1 -0
- package/dist/telegram.d.ts +3 -0
- package/dist/telegram.d.ts.map +1 -0
- package/dist/telegram.js +224 -0
- package/dist/tool-invoker.js +4 -4
- package/dist/tools.js +7 -7
- package/llms-full.txt +510 -10
- package/llms.txt +1 -0
- package/native/darwin-arm64.node +0 -0
- package/native/darwin-x64.node +0 -0
- package/package.json +11 -3
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
composeAgentPrompt,
|
|
4
4
|
createAgentRuntime,
|
|
5
5
|
createAgentRuntimeEventSink
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-m668wzyc.js";
|
|
7
7
|
import {
|
|
8
8
|
walkContainedFiles
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-rqpdar1e.js";
|
|
10
10
|
import {
|
|
11
11
|
AgentModelDescriptorSchema
|
|
12
12
|
} from "./index-tg3m2ec5.js";
|
|
@@ -16,8 +16,8 @@ import"./index-3xnq72rz.js";
|
|
|
16
16
|
import {
|
|
17
17
|
defineRuntimeTool
|
|
18
18
|
} from "./index-wwst0td5.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
19
|
+
import"./index-s4c8wy8m.js";
|
|
20
|
+
import"./index-nemjkxjp.js";
|
|
21
21
|
import {
|
|
22
22
|
AgentMessagePartSchema,
|
|
23
23
|
AgentSnapshotSchema
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type OpenRouterProviderSettings } from '@openrouter/ai-sdk-provider';
|
|
2
|
+
import type { LanguageModelUsage } from 'ai';
|
|
2
3
|
import { type AgentLanguageModelProvider, type AgentModelCatalog } from './agent-runtime/models.js';
|
|
4
|
+
import type { AgentUsage } from './agent-runtime/schemas.js';
|
|
3
5
|
export type { OpenRouterProviderSettings } from '@openrouter/ai-sdk-provider';
|
|
4
6
|
export type OpenRouterCatalogFetch = (input: URL, init?: RequestInit) => Promise<Response>;
|
|
5
7
|
export interface OpenRouterModelCatalogOptions {
|
|
@@ -16,4 +18,21 @@ export declare function openRouterModelCatalog(options: OpenRouterModelCatalogOp
|
|
|
16
18
|
};
|
|
17
19
|
/** Isolated OpenRouter adapter; credentials stay inside the provider instance. */
|
|
18
20
|
export declare function openRouterProvider(settings: OpenRouterProviderSettings): AgentLanguageModelProvider;
|
|
21
|
+
/**
|
|
22
|
+
* Read OpenRouter's token counts and cost out of one SDK step, with provenance.
|
|
23
|
+
*
|
|
24
|
+
* Exported, and that is the point of it existing here at all. The same function
|
|
25
|
+
* has always run inside `openRouterProvider`, which means it was reachable only
|
|
26
|
+
* by building the whole agent runtime — durable store, execution protocol and
|
|
27
|
+
* recovery included. An application that calls `generateText` directly, and only
|
|
28
|
+
* wants an honest number for its own ledger, could not reach it and derived it
|
|
29
|
+
* again; two of them did, and more than half of the two files agree line for
|
|
30
|
+
* line.
|
|
31
|
+
*
|
|
32
|
+
* What is easy to get wrong when deriving it again is not the arithmetic but the
|
|
33
|
+
* provenance: a number the provider reported, a number nobody reported and a
|
|
34
|
+
* zero are three different facts, and a value invented for a missing field is
|
|
35
|
+
* the one that reads as true and is not.
|
|
36
|
+
*/
|
|
37
|
+
export declare function normalizeOpenRouterUsage(usage: LanguageModelUsage, providerMetadata: unknown): AgentUsage;
|
|
19
38
|
//# sourceMappingURL=agent-runtime-openrouter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-runtime-openrouter.d.ts","sourceRoot":"","sources":["../src/agent-runtime-openrouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-runtime-openrouter.d.ts","sourceRoot":"","sources":["../src/agent-runtime-openrouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,IAAI,CAAC;AAE7C,OAAO,EACL,KAAK,0BAA0B,EAE/B,KAAK,iBAAiB,EAGvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG1D,YAAY,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAkD9E,MAAM,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE3F,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAyFD,+FAA+F;AAC/F,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,6BAA6B,GAAG;IAC9E,IAAI,CAAC,KAAK,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACpE,CAyGA;AAED,kFAAkF;AAClF,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,0BAA0B,GACnC,0BAA0B,CAO5B;AA0BD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,kBAAkB,EACzB,gBAAgB,EAAE,OAAO,GACxB,UAAU,CASZ"}
|
package/dist/agent-runtime.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type AgentCompactionContext, type AgentCompactionResult, type StructuredCompactionConfig, structuredCompaction, } from './agent-runtime/compaction.js';
|
|
1
|
+
export { type AgentCompactionContext, type AgentCompactionResult, type CompactableHistory, type SelectCompactableHistoryOptions, type StructuredCompactionConfig, selectCompactableHistory, structuredCompaction, } from './agent-runtime/compaction.js';
|
|
2
2
|
export { AgentContextOverflowError } from './agent-runtime/context-refusal.js';
|
|
3
3
|
export { type AgentConversationMessagePage, AgentConversationMessagePageSchema, type AgentConversationPage, AgentConversationPageSchema, type AgentConversationReader, type AgentConversationSummary, AgentConversationSummarySchema, } from './agent-runtime/conversations.js';
|
|
4
4
|
export { type AgentCoordinatedRun, type AgentInputPolicy, type AgentRunTicket, type AgentSessionCloseOptions, type AgentSessionCloseResult, type AgentSessionCoordinator, type AgentStopReason, createAgentSessionCoordinator, } from './agent-runtime/coordinator.js';
|
|
@@ -10,8 +10,9 @@ export { type AgentLanguageModelProvider, type AgentModelCapability, AgentModelC
|
|
|
10
10
|
export { type AgentObservability, type AgentRunEvent, AgentRunEventSchema, type AgentRunSinkConfig, type AgentRunSinkDrop, type AgentRunSinkError, type AgentRunStartedEvent, AgentRunStartedEventSchema, type AgentRunTerminalEvent, AgentRunTerminalEventSchema, type AgentStepFinishedEvent, AgentStepFinishedEventSchema, createAgentObservability, } from './agent-runtime/observability.js';
|
|
11
11
|
export { type AgentHistoryBudgetDecision, type AgentHistoryBudgetResult, type AgentPromptBudget, type AgentPromptSection, type AgentPromptSectionContext, type AgentTokenCount, AgentTokenCountSchema, type ComposeAgentPromptOptions, type ComposedAgentPrompt, composeAgentPrompt, type SelectAgentHistoryOptions, selectAgentHistory, } from './agent-runtime/prompt.js';
|
|
12
12
|
export { type AgentProtocol, type AgentProtocolConfig, type AgentTerminalAcceptance, type AgentTerminalAcceptanceInput, defineAgentProtocol, hasAgentTerminalOutput, } from './agent-runtime/protocol.js';
|
|
13
|
+
export { type AgentProviderFailure, type AgentProviderFailureReason, classifyProviderFailure, isToolResultFailure, } from './agent-runtime/provider-failure.js';
|
|
13
14
|
export { AgentConversationPurgedError, type AgentConversationPurgeInput, AgentConversationPurgeInputSchema, type AgentConversationPurgeResult, AgentConversationPurgeResultSchema, purgeAgentConversation, } from './agent-runtime/purge.js';
|
|
14
|
-
export { type AgentRuntime, type AgentRuntimeAdmission, type AgentRuntimeConfig, type AgentRuntimeInput, type AgentRuntimeInterruptInput, type AgentRuntimePrepareStep, type AgentRuntimeProtocolInput, type AgentRuntimeRecordIds, type AgentRuntimeRecoverOptions, type AgentRuntimeRecoveryDecision, type AgentRuntimeRecoveryInput, type AgentRuntimeRecoveryOutcome, type AgentRuntimeRunContext, type AgentRuntimeStopPolicy, createAgentRuntime, } from './agent-runtime/runtime.js';
|
|
15
|
+
export { type AgentContextUsage, type AgentRuntime, type AgentRuntimeAdmission, type AgentRuntimeConfig, type AgentRuntimeInput, type AgentRuntimeInterruptInput, type AgentRuntimePrepareStep, type AgentRuntimeProtocolInput, type AgentRuntimeRecordIds, type AgentRuntimeRecoverOptions, type AgentRuntimeRecoveryDecision, type AgentRuntimeRecoveryInput, type AgentRuntimeRecoveryOutcome, type AgentRuntimeRunContext, type AgentRuntimeStopPolicy, createAgentRuntime, } from './agent-runtime/runtime.js';
|
|
15
16
|
export type { AgentRuntimeResult } from './agent-runtime/runtime-result.js';
|
|
16
17
|
export * from './agent-runtime/schemas.js';
|
|
17
18
|
export { type AcceptInputAndAssignRun, AcceptInputAndAssignRunSchema, type AcquireAgentRun, AcquireAgentRunSchema, type AgentRecoverableDescriptor, AgentRecoverableDescriptorSchema, type AgentRecoverablePage, AgentRecoverablePageSchema, type AgentRuntimeStore, type AgentRunView, AgentRunViewSchema, AgentStoreAppliedSchema, AgentStoreConflictSchema, AgentStoreDuplicateSchema, type AgentStoreMutationResult, AgentStoreMutationResultSchema, AgentStoreNotFoundSchema, type CheckpointRunAssistant, CheckpointRunAssistantSchema, type CommitRunTerminal, CommitRunTerminalSchema, type RecoverAgentRun, RecoverAgentRunSchema, type ReplaceCompactedRange, ReplaceCompactedRangeSchema, type RequestRunInterrupt, RequestRunInterruptSchema, } from './agent-runtime/store.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-runtime.d.ts","sourceRoot":"","sources":["../src/agent-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EACL,KAAK,4BAA4B,EACjC,kCAAkC,EAClC,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC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ferredToolRepair,
|
|
28
28
|
repairedSearchCall,
|
|
29
29
|
selectAgentHistory
|
|
30
|
-
} from "./index-
|
|
30
|
+
} from "./index-m668wzyc.js";
|
|
31
31
|
import {
|
|
32
32
|
AgentModelCapabilitySchema,
|
|
33
33
|
AgentModelCatalogEntrySchema,
|
|
@@ -86,15 +86,15 @@ import {
|
|
|
86
86
|
import {
|
|
87
87
|
buildToolManifest,
|
|
88
88
|
mountAgent
|
|
89
|
-
} from "./index-
|
|
89
|
+
} from "./index-ezmn6ac6.js";
|
|
90
90
|
import"./index-3xnq72rz.js";
|
|
91
|
-
import"./index-
|
|
91
|
+
import"./index-k2zczx1g.js";
|
|
92
92
|
import {
|
|
93
93
|
defineRuntimeTool
|
|
94
94
|
} from "./index-wwst0td5.js";
|
|
95
|
-
import"./index-
|
|
96
|
-
import"./index-
|
|
97
|
-
import"./index-
|
|
95
|
+
import"./index-7qy2ex0m.js";
|
|
96
|
+
import"./index-s4c8wy8m.js";
|
|
97
|
+
import"./index-nemjkxjp.js";
|
|
98
98
|
import {
|
|
99
99
|
AgentAssistantPlaceholderSchema,
|
|
100
100
|
AgentControlPartSchema,
|
|
@@ -137,7 +137,8 @@ import {
|
|
|
137
137
|
import"./index-vj3vvpaa.js";
|
|
138
138
|
import"./index-0w9abg87.js";
|
|
139
139
|
import {
|
|
140
|
-
executableAgentRuntimeTools
|
|
140
|
+
executableAgentRuntimeTools,
|
|
141
|
+
isRecord
|
|
141
142
|
} from "./index-qyrqwr4c.js";
|
|
142
143
|
import"./index-6k1937bx.js";
|
|
143
144
|
|
|
@@ -163,13 +164,22 @@ function groupProviderTurns(messages, evidencePolicy) {
|
|
|
163
164
|
}
|
|
164
165
|
return turns;
|
|
165
166
|
}
|
|
166
|
-
function
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
function selectCompactableHistory(options) {
|
|
168
|
+
if (!Number.isSafeInteger(options.keepRecentTurns) || options.keepRecentTurns < 0) {
|
|
169
|
+
throw new TypeError("keepRecentTurns must be a non-negative safe integer");
|
|
170
|
+
}
|
|
171
|
+
const leadingSummary = options.messages[0]?.role === "summary" ? options.messages[0] : undefined;
|
|
172
|
+
const rest = leadingSummary ? options.messages.slice(1) : options.messages;
|
|
173
|
+
const turns = groupProviderTurns(rest, options.evidencePolicy);
|
|
169
174
|
const firstIncomplete = turns.findIndex((turn) => !turn.complete);
|
|
170
175
|
const completeTurns = firstIncomplete === -1 ? turns : turns.slice(0, firstIncomplete);
|
|
171
|
-
const eligibleCount = Math.max(0, completeTurns.length - keepRecentTurns);
|
|
172
|
-
|
|
176
|
+
const eligibleCount = Math.max(0, completeTurns.length - options.keepRecentTurns);
|
|
177
|
+
const compactable = completeTurns.slice(0, eligibleCount).flatMap((turn) => turn.messages);
|
|
178
|
+
return {
|
|
179
|
+
...leadingSummary !== undefined && { leadingSummary },
|
|
180
|
+
compactable,
|
|
181
|
+
retained: rest.slice(compactable.length)
|
|
182
|
+
};
|
|
173
183
|
}
|
|
174
184
|
function mutationSnapshot(result, fallback, attempts) {
|
|
175
185
|
if (result.outcome === "applied" || result.outcome === "duplicate") {
|
|
@@ -193,11 +203,14 @@ function structuredCompaction(config) {
|
|
|
193
203
|
if (!await config.threshold(snapshot)) {
|
|
194
204
|
return { outcome: "not_needed", snapshot, attempts: attempt };
|
|
195
205
|
}
|
|
196
|
-
const eligibleMessages =
|
|
206
|
+
const { leadingSummary, compactable: eligibleMessages } = selectCompactableHistory({
|
|
207
|
+
messages: snapshot.messages,
|
|
208
|
+
keepRecentTurns: config.keepRecentTurns,
|
|
209
|
+
...config.evidencePolicy !== undefined && { evidencePolicy: config.evidencePolicy }
|
|
210
|
+
});
|
|
197
211
|
if (eligibleMessages.length === 0) {
|
|
198
212
|
return { outcome: "nothing_eligible", snapshot, attempts: attempt };
|
|
199
213
|
}
|
|
200
|
-
const leadingSummary = snapshot.messages[0]?.role === "summary" ? snapshot.messages[0] : undefined;
|
|
201
214
|
const previousSummary = leadingSummary && config.readPreviousSummary ? config.schema.parse(config.readPreviousSummary(leadingSummary)) : attempt === 1 ? input.previousSummary : undefined;
|
|
202
215
|
const rawSummary = await config.summarize({
|
|
203
216
|
conversationId: input.conversationId,
|
|
@@ -698,15 +711,105 @@ function defineAgentProtocol(config) {
|
|
|
698
711
|
}
|
|
699
712
|
};
|
|
700
713
|
}
|
|
714
|
+
// src/agent-runtime/provider-failure.ts
|
|
715
|
+
var BY_STATUS = {
|
|
716
|
+
402: "insufficient-credits",
|
|
717
|
+
404: "model-unavailable",
|
|
718
|
+
408: "timeout",
|
|
719
|
+
413: "context-overflow",
|
|
720
|
+
429: "rate-limited"
|
|
721
|
+
};
|
|
722
|
+
var BY_MESSAGE = [
|
|
723
|
+
[/insufficient|not enough credit|payment required|quota exceeded/i, "insufficient-credits"],
|
|
724
|
+
[/rate.?limit|too many requests|slow down/i, "rate-limited"],
|
|
725
|
+
[
|
|
726
|
+
/no endpoints found|model not found|unknown model|no allowed providers/i,
|
|
727
|
+
"model-unavailable"
|
|
728
|
+
],
|
|
729
|
+
[/context length|maximum context|too many tokens|prompt is too long/i, "context-overflow"],
|
|
730
|
+
[/timed? ?out|deadline exceeded|etimedout/i, "timeout"],
|
|
731
|
+
[/abort|cancell?ed/i, "cancelled"]
|
|
732
|
+
];
|
|
733
|
+
var RETRYABLE = new Set([
|
|
734
|
+
"rate-limited",
|
|
735
|
+
"timeout",
|
|
736
|
+
"insufficient-credits"
|
|
737
|
+
]);
|
|
738
|
+
function statusOf(value) {
|
|
739
|
+
if (!isRecord(value))
|
|
740
|
+
return;
|
|
741
|
+
for (const key of ["statusCode", "status", "code"]) {
|
|
742
|
+
const candidate = value[key];
|
|
743
|
+
if (typeof candidate === "number" && candidate >= 400 && candidate < 600)
|
|
744
|
+
return candidate;
|
|
745
|
+
}
|
|
746
|
+
const nested = value.cause ?? value.response ?? value.error;
|
|
747
|
+
return nested === value ? undefined : statusOf(nested);
|
|
748
|
+
}
|
|
749
|
+
function messageOf(value) {
|
|
750
|
+
if (value instanceof Error)
|
|
751
|
+
return value.message;
|
|
752
|
+
if (typeof value === "string")
|
|
753
|
+
return value;
|
|
754
|
+
if (isRecord(value) && typeof value.message === "string")
|
|
755
|
+
return value.message;
|
|
756
|
+
return "";
|
|
757
|
+
}
|
|
758
|
+
function classifyProviderFailure(error) {
|
|
759
|
+
const status = statusOf(error);
|
|
760
|
+
const byStatus = status === undefined ? undefined : BY_STATUS[status];
|
|
761
|
+
if (byStatus) {
|
|
762
|
+
return {
|
|
763
|
+
reason: byStatus,
|
|
764
|
+
status,
|
|
765
|
+
retryable: RETRYABLE.has(byStatus),
|
|
766
|
+
evidence: "status"
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
const message = messageOf(error);
|
|
770
|
+
for (const [pattern, reason] of BY_MESSAGE) {
|
|
771
|
+
if (pattern.test(message)) {
|
|
772
|
+
return {
|
|
773
|
+
reason,
|
|
774
|
+
...status !== undefined && { status },
|
|
775
|
+
retryable: RETRYABLE.has(reason),
|
|
776
|
+
evidence: "message"
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
return {
|
|
781
|
+
reason: "unknown",
|
|
782
|
+
...status !== undefined && { status },
|
|
783
|
+
retryable: false,
|
|
784
|
+
evidence: "none"
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
function isToolResultFailure(output) {
|
|
788
|
+
const parsed = typeof output === "string" ? parseJson(output) : output;
|
|
789
|
+
if (!isRecord(parsed))
|
|
790
|
+
return false;
|
|
791
|
+
if ("error" in parsed)
|
|
792
|
+
return true;
|
|
793
|
+
return isRecord(parsed.value) && "error" in parsed.value;
|
|
794
|
+
}
|
|
795
|
+
function parseJson(value) {
|
|
796
|
+
try {
|
|
797
|
+
return JSON.parse(value);
|
|
798
|
+
} catch {
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
701
802
|
export {
|
|
702
803
|
validateAgentModelSnapshot,
|
|
703
804
|
structuredCompaction,
|
|
805
|
+
selectCompactableHistory,
|
|
704
806
|
selectAgentHistory,
|
|
705
807
|
searchAgentModelCatalog,
|
|
706
808
|
runStateForTerminalReason,
|
|
707
809
|
purgeAgentConversation,
|
|
708
810
|
projectAgentHistoryDetailed,
|
|
709
811
|
projectAgentHistory,
|
|
812
|
+
isToolResultFailure,
|
|
710
813
|
isAssistantHistoryEvidence,
|
|
711
814
|
hasAgentTerminalOutput,
|
|
712
815
|
defineModelRegistry,
|
|
@@ -721,6 +824,7 @@ export {
|
|
|
721
824
|
createAgentRuntime,
|
|
722
825
|
createAgentObservability,
|
|
723
826
|
composeAgentPrompt,
|
|
827
|
+
classifyProviderFailure,
|
|
724
828
|
agentDurableEventId,
|
|
725
829
|
advanceAgentRuntimeEventCursor,
|
|
726
830
|
RequestRunInterruptSchema,
|
|
@@ -5,6 +5,23 @@ export declare const BoundedRateBudgetSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
5
5
|
intervalMs: z.ZodNumber;
|
|
6
6
|
}, z.core.$strict>>;
|
|
7
7
|
export type BoundedRateBudget = z.infer<typeof BoundedRateBudgetSchema>;
|
|
8
|
+
export declare const BoundedAdmissionPerKeyLimitsSchema: z.ZodReadonly<z.ZodObject<{
|
|
9
|
+
maxConcurrent: z.ZodNumber;
|
|
10
|
+
rate: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
11
|
+
limit: z.ZodNumber;
|
|
12
|
+
intervalMs: z.ZodNumber;
|
|
13
|
+
}, z.core.$strict>>>;
|
|
14
|
+
}, z.core.$strict>>;
|
|
15
|
+
export type BoundedAdmissionPerKeyLimits = z.infer<typeof BoundedAdmissionPerKeyLimitsSchema>;
|
|
16
|
+
/**
|
|
17
|
+
* A ceiling declared per key rather than once for all keys.
|
|
18
|
+
*
|
|
19
|
+
* Resolved on a key's first admission and cached with its record, so a resolver that reads
|
|
20
|
+
* configuration is called once per live key rather than once per acquire. Eviction under
|
|
21
|
+
* `maxKeys` drops the record and the cached ceiling together, which is also how a changed
|
|
22
|
+
* configuration is adopted: evict the key, and the next admission resolves it again.
|
|
23
|
+
*/
|
|
24
|
+
export type BoundedAdmissionPerKeyLimitResolver = (key: string) => BoundedAdmissionPerKeyLimits;
|
|
8
25
|
export declare const BoundedAdmissionPolicySchema: z.ZodReadonly<z.ZodObject<{
|
|
9
26
|
global: z.ZodObject<{
|
|
10
27
|
maxConcurrent: z.ZodNumber;
|
|
@@ -13,14 +30,17 @@ export declare const BoundedAdmissionPolicySchema: z.ZodReadonly<z.ZodObject<{
|
|
|
13
30
|
intervalMs: z.ZodNumber;
|
|
14
31
|
}, z.core.$strict>>>;
|
|
15
32
|
}, z.core.$strict>;
|
|
16
|
-
perKey: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
perKey: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
17
34
|
maxConcurrent: z.ZodNumber;
|
|
18
35
|
maxKeys: z.ZodNumber;
|
|
19
36
|
rate: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
|
|
20
37
|
limit: z.ZodNumber;
|
|
21
38
|
intervalMs: z.ZodNumber;
|
|
22
39
|
}, z.core.$strict>>>;
|
|
23
|
-
}, z.core.$strict
|
|
40
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
41
|
+
maxKeys: z.ZodNumber;
|
|
42
|
+
limits: z.ZodCustom<BoundedAdmissionPerKeyLimitResolver, BoundedAdmissionPerKeyLimitResolver>;
|
|
43
|
+
}, z.core.$strict>]>>;
|
|
24
44
|
}, z.core.$strict>>;
|
|
25
45
|
export type BoundedAdmissionPolicy = z.infer<typeof BoundedAdmissionPolicySchema>;
|
|
26
46
|
export declare const BoundedAdmissionStateSchema: z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admission.d.ts","sourceRoot":"","sources":["../../src/application/admission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAA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Q,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,2BAA2B;IAC1C,gFAAgF;IAChF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,sBAAsB,CAAC;IAC9C,GAAG,CAAC,CAAC,EACH,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,IAAI,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAC7D,OAAO,CAAC,EAAE,0BAA0B,GACnC,OAAO,CAAC,CAAC,CAAC,CAAC;IACd,aAAa,IAAI,wBAAwB,CAAC;IAC1C,KAAK,CAAC,OAAO,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACpF,KAAK,IAAI,2BAA2B,CAAC;IACrC,WAAW,IAAI,wBAAwB,CAAC;CACzC;AAED,qBAAa,4BAA6B,SAAQ,KAAK;aAEnC,MAAM,EAAE,6BAA6B;aACrC,YAAY,CAAC,EAAE,MAAM;IAFvC,YACkB,MAAM,EAAE,6BAA6B,EACrC,YAAY,CAAC,EAAE,MAAM,YAAA,EAItC;CACF;AAED,qBAAa,yBAA0B,SAAQ,KAAK;aACtB,MAAM,EAAE,WAAW,GAAG,WAAW;IAA7D,YAA4B,MAAM,EAAE,WAAW,GAAG,WAAW,EAK5D;CACF;AAaD,uFAAuF;AACvF,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,GAAG,gBAAgB,CAgTvF"}
|
|
@@ -80,6 +80,7 @@ export declare const CreditWindowSnapshotSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
80
80
|
acquired: z.ZodNumber;
|
|
81
81
|
refused: z.ZodNumber;
|
|
82
82
|
replenishedBytes: z.ZodNumber;
|
|
83
|
+
waiting: z.ZodNumber;
|
|
83
84
|
}, z.core.$strict>>;
|
|
84
85
|
export type CreditWindowSnapshot = z.infer<typeof CreditWindowSnapshotSchema>;
|
|
85
86
|
export interface CreditLease {
|
|
@@ -94,8 +95,35 @@ export type CreditAcquireResult = {
|
|
|
94
95
|
readonly outcome: 'refused';
|
|
95
96
|
readonly reason: 'closed' | 'larger-than-window' | 'insufficient-credit';
|
|
96
97
|
};
|
|
98
|
+
/**
|
|
99
|
+
* A waiting acquire's refusals.
|
|
100
|
+
*
|
|
101
|
+
* `insufficient-credit` is absent by construction: waiting is what the caller asked for instead
|
|
102
|
+
* of that answer. What remains are the conditions no amount of waiting changes — a closed window
|
|
103
|
+
* and a request larger than the window — plus the two ways a wait ends on the caller's terms.
|
|
104
|
+
*/
|
|
105
|
+
export type CreditWaitRefusalReason = 'closed' | 'larger-than-window' | 'timed-out' | 'aborted';
|
|
106
|
+
export type CreditWaitResult = {
|
|
107
|
+
readonly outcome: 'leased';
|
|
108
|
+
readonly lease: CreditLease;
|
|
109
|
+
} | {
|
|
110
|
+
readonly outcome: 'refused';
|
|
111
|
+
readonly reason: CreditWaitRefusalReason;
|
|
112
|
+
};
|
|
113
|
+
export interface CreditAcquireWaitOptions {
|
|
114
|
+
readonly signal?: AbortSignal;
|
|
115
|
+
/** Caller wait budget. Absent means wait until credit, close or abort. */
|
|
116
|
+
readonly timeoutMs?: number;
|
|
117
|
+
}
|
|
97
118
|
export interface CreditWindow {
|
|
119
|
+
/** Non-blocking: grants or refuses against the credit available right now. */
|
|
98
120
|
acquire(bytes: number): CreditAcquireResult;
|
|
121
|
+
/**
|
|
122
|
+
* Waiting: resolves when the consumer replenishes enough credit, or refuses with a named
|
|
123
|
+
* reason. Waiters are served in arrival order, so a large request ahead of a small one delays
|
|
124
|
+
* it rather than being overtaken — predictable ordering is worth more here than throughput.
|
|
125
|
+
*/
|
|
126
|
+
acquire(bytes: number, options: CreditAcquireWaitOptions): Promise<CreditWaitResult>;
|
|
99
127
|
close(): CreditWindowSnapshot;
|
|
100
128
|
getSnapshot(): Cre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AAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACrF,KAAK,IAAI,oBAAoB,CAAC;IAC9B,WAAW,IAAI,oBAAoB,CAAC;CACrC;AAOD,yFAAyF;AACzF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CA4J3F"}
|
|
@@ -7,6 +7,11 @@ export declare const DiagnosticJournalLimitsSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
7
7
|
maxFiles: z.ZodNumber;
|
|
8
8
|
}, z.core.$strict>>;
|
|
9
9
|
export type DiagnosticJournalLimits = z.infer<typeof DiagnosticJournalLimitsSchema>;
|
|
10
|
+
export declare const DiagnosticJournalLockPolicySchema: z.ZodEnum<{
|
|
11
|
+
"reclaim-stale": "reclaim-stale";
|
|
12
|
+
refuse: "refuse";
|
|
13
|
+
}>;
|
|
14
|
+
export type DiagnosticJournalLockPolicy = z.infer<typeof DiagnosticJournalLockPolicySchema>;
|
|
10
15
|
export declare const DiagnosticJournalStateSchema: z.ZodEnum<{
|
|
11
16
|
closed: "closed";
|
|
12
17
|
draining: "draining";
|
|
@@ -44,6 +49,13 @@ export declare const DiagnosticJournalStatusSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
44
49
|
maxFileBytes: z.ZodNumber;
|
|
45
50
|
maxFiles: z.ZodNumber;
|
|
46
51
|
}, z.core.$strict>>;
|
|
52
|
+
lock: z.ZodReadonly<z.ZodObject<{
|
|
53
|
+
policy: z.ZodEnum<{
|
|
54
|
+
"reclaim-stale": "reclaim-stale";
|
|
55
|
+
refuse: "refuse";
|
|
56
|
+
}>;
|
|
57
|
+
reclaimedStale: z.ZodBoolean;
|
|
58
|
+
}, z.core.$strict>>;
|
|
47
59
|
received: z.ZodNumber;
|
|
48
60
|
accepted: z.ZodNumber;
|
|
49
61
|
refused: z.ZodNumber;
|
|
@@ -148,6 +160,14 @@ export interface DiagnosticJournalConfig<SCHEMA extends z.ZodType> {
|
|
|
148
160
|
readonly limits: DiagnosticJournalLimits;
|
|
149
161
|
/** Created file and lock permissions. Default `0o600`. */
|
|
150
162
|
readonly mode?: number;
|
|
163
|
+
/**
|
|
164
|
+
* What to do about a lock that is already present. Default `refuse`.
|
|
165
|
+
*
|
|
166
|
+
* `reclaim-stale` reclaims it only when the recorded owner is provably gone — a liveness
|
|
167
|
+
* check, never an age heuristic, because a slow writer and a dead one are indistinguishable
|
|
168
|
+
* by time and the lock exists for exactly that case.
|
|
169
|
+
*/
|
|
170
|
+
readonly lock?: DiagnosticJournalLockPolicy;
|
|
151
171
|
/** Diagnostics are isolated and are never written back into this journal. */
|
|
152
172
|
readonly onFailure?: (failure: DiagnosticJournalFailure) => void | Promise<void>;
|
|
153
173
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostic-journal-contract.d.ts","sourceRoot":"","sources":["../../src/application/diagnostic-journal-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,6BAA6B;;;;;;mBAS7B,CAAC;AACd,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,4BAA4B;;;;;EAAmD,CAAC;AAC7F,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,oCAAoC;;;;;;;EAO/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC;AAcF,eAAO,MAAM,mCAAmC;;;;EAAyC,CAAC;AAC1F,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,eAAO,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AK,CAAC,OAAO,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACpF,SAAS,IAAI,uBAAuB,CAAC;IACrC,kGAAkG;IAClG,KAAK,CAAC,OAAO,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;CACtF;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAE3E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { open } from 'node:fs/promises';
|
|
2
|
+
import type { DiagnosticJournalLockPolicy } from './diagnostic-journal-contract.js';
|
|
3
|
+
type FileHandle = Awaited<ReturnType<typeof open>>;
|
|
4
|
+
export interface AcquiredDiagnosticJournalLock {
|
|
5
|
+
readonly handle: FileHandle;
|
|
6
|
+
readonly reclaimedStale: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Take the journal's exclusive lock under the configured policy.
|
|
10
|
+
*
|
|
11
|
+
* `refuse` is the default and rethrows the `EEXIST` a present lock produces. `reclaim-stale`
|
|
12
|
+
* rethrows that same error unless the recorded owner is provably gone, so it is a strict superset
|
|
13
|
+
* of `refuse`: every refusal a caller sees today it still sees, with the identical error.
|
|
14
|
+
*/
|
|
15
|
+
export declare function acquireDiagnosticJournalLock(lockPath: string, mode: number, policy: DiagnosticJournalLockPolicy): Promise<AcquiredDiagnosticJournalLock>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=diagnostic-journal-lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostic-journal-lock.d.ts","sourceRoot":"","sources":["../../src/application/diagnostic-journal-lock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAU,MAAM,kBAAkB,CAAC;AAGhD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAEjF,KAAK,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;AAEnD,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CAClC;AAqED;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,6BAA6B,CAAC,CAiBxC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { type DiagnosticJournal, type DiagnosticJournalFailure, type DiagnosticJournalLimits } from './diagnostic-journal-contract.js';
|
|
2
|
+
import { type DiagnosticJournal, type DiagnosticJournalFailure, type DiagnosticJournalLimits, type DiagnosticJournalStatus } from './diagnostic-journal-contract.js';
|
|
3
3
|
import { type DiagnosticJournalStorage } from './diagnostic-journal-storage.js';
|
|
4
4
|
interface DiagnosticJournalManagerConfig<SCHEMA extends z.ZodType> {
|
|
5
5
|
readonly eventSchema: SCHEMA;
|
|
6
6
|
readonly epoch: string;
|
|
7
7
|
readonly limits: DiagnosticJournalLimits;
|
|
8
|
+
readonly lock: DiagnosticJournalStatus['lock'];
|
|
8
9
|
readonly onFailure?: (failure: DiagnosticJournalFailure) => void | Promise<void>;
|
|
9
10
|
}
|
|
10
11
|
export declare function createDiagnosticJournalManager<SCHEMA extends z.ZodType>(config: DiagnosticJournalManagerConfig<SCHEMA>, storage: DiagnosticJournalStorage): DiagnosticJournal<z.input<SCHEMA>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostic-journal-manager.d.ts","sourceRoot":"","sources":["../../src/application/diagnostic-journal-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,wBAAwB,EAG7B,KAAK,uBAAuB,
|
|
1
|
+
{"version":3,"file":"diagnostic-journal-manager.d.ts","sourceRoot":"","sources":["../../src/application/diagnostic-journal-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,wBAAwB,EAG7B,KAAK,uBAAuB,EAI5B,KAAK,uBAAuB,EAK7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,8BAA8B,CAAC;AAEtC,UAAU,8BAA8B,CAAC,MAAM,SAAS,CAAC,CAAC,OAAO;IAC/D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAC/C,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClF;AAiBD,wBAAgB,8BAA8B,CAAC,MAAM,SAAS,CAAC,CAAC,OAAO,EACrE,MAAM,EAAE,8BAA8B,CAAC,MAAM,CAAC,EAC9C,OAAO,EAAE,wBAAwB,GAChC,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAgOpC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DiagnosticJournalFailurePhase } from './diagnostic-journal-contract.js';
|
|
1
|
+
import type { DiagnosticJournalFailurePhase, DiagnosticJournalLockPolicy } from './diagnostic-journal-contract.js';
|
|
2
2
|
export interface DiagnosticJournalStorageSnapshot {
|
|
3
3
|
readonly currentFileBytes: number;
|
|
4
4
|
readonly retainedFiles: number;
|
|
@@ -9,6 +9,8 @@ export interface DiagnosticJournalStorageAppendResult extends DiagnosticJournalS
|
|
|
9
9
|
readonly rotated: boolean;
|
|
10
10
|
}
|
|
11
11
|
export interface DiagnosticJournalStorage {
|
|
12
|
+
/** This storage took its lock by reclaiming one whose owner was provably gone. */
|
|
13
|
+
readonly reclaimedStale: boolean;
|
|
12
14
|
append(bytes: Uint8Array): Promise<DiagnosticJournalStorageAppendResult>;
|
|
13
15
|
snapshot(): DiagnosticJournalStorageSnapshot;
|
|
14
16
|
close(): Promise<void>;
|
|
@@ -22,6 +24,7 @@ interface RotatingStorageConfig {
|
|
|
22
24
|
readonly maxFileBytes: number;
|
|
23
25
|
readonly maxFiles: number;
|
|
24
26
|
readonly mode: number;
|
|
27
|
+
readonly lock: DiagnosticJournalLockPolicy;
|
|
25
28
|
}
|
|
26
29
|
/** One exclusive local writer. The lock is deliberately not a cross-crash lease. */
|
|
27
30
|
export declare function createRotatingDiagnosticJournalStorage(config: RotatingStorageConfig): Promise<DiagnosticJournalStorage>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostic-journal-storage.d.ts","sourceRoot":"","sources":["../../src/application/diagnostic-journal-storage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"diagnostic-journal-storage.d.ts","sourceRoot":"","sources":["../../src/application/diagnostic-journal-storage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,+BAA+B,CAAC;AAGvC,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,oCACf,SAAQ,gCAAgC;IACxC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,kFAAkF;IAClF,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;IACzE,QAAQ,IAAI,gCAAgC,CAAC;IAC7C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,qBAAa,6BAA8B,SAAQ,KAAK;aAEpC,KAAK,EAAE,6BAA6B;IADtD,YACkB,KAAK,EAAE,6BAA6B,EACpD,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,YAAY,EAIvB;CACF;AAED,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAAC;CAC5C;AA4CD,oFAAoF;AACpF,wBAAsB,sCAAsC,CAC1D,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,wBAAwB,CAAC,CAuJnC"}
|
|
@@ -4,8 +4,10 @@ import { type DiagnosticJournal, type DiagnosticJournalConfig } from './diagnost
|
|
|
4
4
|
* One process-local ordered JSONL diagnostic journal.
|
|
5
5
|
*
|
|
6
6
|
* `flush()` observes completed append calls, not an fsync or durable-delivery receipt. One live
|
|
7
|
-
* manager exclusively owns the injected path; an abrupt process death
|
|
8
|
-
*
|
|
7
|
+
* manager exclusively owns the injected path; an abrupt process death leaves its `.lock` file
|
|
8
|
+
* behind. By default an operator removes it after proving the previous owner is gone; `lock:
|
|
9
|
+
* 'reclaim-stale'` makes the journal prove that itself, which is what an unattended service
|
|
10
|
+
* restarted by its supervisor needs.
|
|
9
11
|
*/
|
|
10
12
|
export declare function createDiagnosticJournal<SCHEMA extends z.ZodType>(config: DiagnosticJournalConfig<SCHEMA>): Promise<DiagnosticJournal<z.input<SCHEMA>>>;
|
|
11
13
|
//# sourceMappingURL=diagnostic-journal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostic-journal.d.ts","sourceRoot":"","sources":["../../src/application/diagnostic-journal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,
|
|
1
|
+
{"version":3,"file":"diagnostic-journal.d.ts","sourceRoot":"","sources":["../../src/application/diagnostic-journal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAI7B,MAAM,+BAA+B,CAAC;AAIvC;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAAC,MAAM,SAAS,CAAC,CAAC,OAAO,EACpE,MAAM,EAAE,uBAAuB,CAAC,MAAM,CAAC,GACtC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAoB7C"}
|
package/dist/application.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { type ActivityId, ActivityIdSchema, type ActivityLiveState, ActivityLiveStateSchema, type ActivityProjection, type ActivityProjectionConfig, type ActivityProjectionSubscriberError, type ActivitySnapshot, ActivitySnapshotSchema, type ActivityStageId, ActivityStageIdSchema, type ActivityStageSnapshot, ActivityStageSnapshotSchema, type ActivityToken, ActivityTokenBrand, type ActivityTransition, createActivityProjection, } from './application/activity.js';
|
|
2
|
-
export { type BoundedAdmission, type BoundedAdmissionClock, type BoundedAdmissionConfig, type BoundedAdmissionDrainOptions, type BoundedAdmissionDrainResult, type BoundedAdmissionForceResult, type BoundedAdmissionLeaseResult, type BoundedAdmissionPolicy, BoundedAdmissionPolicySchema, BoundedAdmissionRefusalError, type BoundedAdmissionRefusalReason, BoundedAdmissionRefusalReasonSchema, type BoundedAdmissionRefusedResult, type BoundedAdmissionResult, type BoundedAdmissionSnapshot, BoundedAdmissionSnapshotSchema, type BoundedAdmissionState, BoundedAdmissionStateSchema, type BoundedOperationLease, type BoundedOperationRunContext, type BoundedOperationRunOptions, BoundedOperationWaitError, type BoundedRateBudget, BoundedRateBudgetSchema, createBoundedAdmission, } from './application/admission.js';
|
|
3
|
-
export { type BoundedChannel, type BoundedChannelCloseOptions, type BoundedChannelConfig, type BoundedChannelOfferResult, type BoundedChannelPolicy, BoundedChannelPolicySchema, BoundedChannelReaderError, type BoundedChannelSnapshot, BoundedChannelSnapshotSchema, type BoundedChannelState, BoundedChannelStateSchema, type CreditAcquireResult, type CreditLease, type CreditWindow, type CreditWindowSnapshot, CreditWindowSnapshotSchema, createBoundedChannel, createCreditWindow, } from './application/channel.js';
|
|
2
|
+
export { type BoundedAdmission, type BoundedAdmissionClock, type BoundedAdmissionConfig, type BoundedAdmissionDrainOptions, type BoundedAdmissionDrainResult, type BoundedAdmissionForceResult, type BoundedAdmissionLeaseResult, type BoundedAdmissionPerKeyLimitResolver, type BoundedAdmissionPerKeyLimits, BoundedAdmissionPerKeyLimitsSchema, type BoundedAdmissionPolicy, BoundedAdmissionPolicySchema, BoundedAdmissionRefusalError, type BoundedAdmissionRefusalReason, BoundedAdmissionRefusalReasonSchema, type BoundedAdmissionRefusedResult, type BoundedAdmissionResult, type BoundedAdmissionSnapshot, BoundedAdmissionSnapshotSchema, type BoundedAdmissionState, BoundedAdmissionStateSchema, type BoundedOperationLease, type BoundedOperationRunContext, type BoundedOperationRunOptions, BoundedOperationWaitError, type BoundedRateBudget, BoundedRateBudgetSchema, createBoundedAdmission, } from './application/admission.js';
|
|
3
|
+
export { type BoundedChannel, type BoundedChannelCloseOptions, type BoundedChannelConfig, type BoundedChannelOfferResult, type BoundedChannelPolicy, BoundedChannelPolicySchema, BoundedChannelReaderError, type BoundedChannelSnapshot, BoundedChannelSnapshotSchema, type BoundedChannelState, BoundedChannelStateSchema, type CreditAcquireResult, type CreditAcquireWaitOptions, type CreditLease, type CreditWaitRefusalReason, type CreditWaitResult, type CreditWindow, type CreditWindowSnapshot, CreditWindowSnapshotSchema, createBoundedChannel, createCreditWindow, } from './application/channel.js';
|
|
4
4
|
export { createDiagnosticJournal } from './application/diagnostic-journal.js';
|
|
5
|
-
export { type DiagnosticJournal, type DiagnosticJournalCloseResult, DiagnosticJournalCloseResultSchema, type DiagnosticJournalConfig, type DiagnosticJournalFailure, type DiagnosticJournalFailurePhase, DiagnosticJournalFailurePhaseSchema, type DiagnosticJournalFrame, DiagnosticJournalFrameSchema, type DiagnosticJournalLimits, DiagnosticJournalLimitsSchema, type DiagnosticJournalRefusalReason, DiagnosticJournalRefusalReasonSchema, type DiagnosticJournalState, DiagnosticJournalStateSchema, type DiagnosticJournalStatus, DiagnosticJournalStatusSchema, type DiagnosticJournalSubmitResult, DiagnosticJournalSubmitResultSchema, type DiagnosticJournalWaitOptions, type DiagnosticJournalWaitResult, DiagnosticJournalWaitResultSchema, } from './application/diagnostic-journal-contract.js';
|
|
5
|
+
export { type DiagnosticJournal, type DiagnosticJournalCloseResult, DiagnosticJournalCloseResultSchema, type DiagnosticJournalConfig, type DiagnosticJournalFailure, type DiagnosticJournalFailurePhase, DiagnosticJournalFailurePhaseSchema, type DiagnosticJournalFrame, DiagnosticJournalFrameSchema, type DiagnosticJournalLimits, DiagnosticJournalLimitsSchema, type DiagnosticJournalLockPolicy, DiagnosticJournalLockPolicySchema, type DiagnosticJournalRefusalReason, DiagnosticJournalRefusalReasonSchema, type DiagnosticJournalState, DiagnosticJournalStateSchema, type DiagnosticJournalStatus, DiagnosticJournalStatusSchema, type DiagnosticJournalSubmitResult, DiagnosticJournalSubmitResultSchema, type DiagnosticJournalWaitOptions, type DiagnosticJournalWaitResult, DiagnosticJournalWaitResultSchema, } from './application/diagnostic-journal-contract.js';
|
|
6
6
|
export { type ApplicationEventSink, type ApplicationEventSinkConfig, type ApplicationLifecycleEvent, ApplicationLifecycleEventSchema, applicationLifecycleEvent, createApplicationEventSink, } from './application/events.js';
|
|
7
7
|
export { type ApplicationHealthHandlerOptions, ApplicationHealthHandlerOptionsSchema, type ApplicationOperationalHandlers, type ApplicationOperationalHandlersOptions, ApplicationOperationalHandlersOptionsSchema, createApplicationHealthHandler, createApplicationOperationalHandlers, } from './application/health.js';
|
|
8
8
|
export { type ApplicationAdmission, ApplicationAdmissionError, type ApplicationConfig, type ApplicationHandle, type ApplicationOperationLease, type ApplicationResourceFailure, type ApplicationResourcePhase, type ApplicationShutdownBudget, ApplicationShutdownBudgetSchema, type ApplicationShutdownOptions, ApplicationShutdownOptionsSchema, createApplication, } from './application/kernel.js';
|