@weiliang0121/capix-protocol 0.1.0 → 0.2.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 +14 -12
- package/dist/acceptance.d.ts +3 -0
- package/dist/acceptance.js +2 -0
- package/dist/index.d.ts +2 -5
- package/dist/index.js +1 -1
- package/dist/transcript.d.ts +43 -0
- package/package.json +9 -25
- package/dist/content/changes.d.ts +0 -35
- package/dist/content/changes.js +0 -1
- package/dist/content/index.d.ts +0 -4
- package/dist/content/index.js +0 -2
- package/dist/content/memory.d.ts +0 -13
- package/dist/content/memory.js +0 -1
- package/dist/content/message.d.ts +0 -4
- package/dist/content/message.js +0 -1
- package/dist/content/transcript.d.ts +0 -32
- package/dist/conversation/activity.d.ts +0 -36
- package/dist/conversation/activity.js +0 -1
- package/dist/conversation/conversation.d.ts +0 -11
- package/dist/conversation/conversation.js +0 -1
- package/dist/conversation/delivery.d.ts +0 -99
- package/dist/conversation/delivery.js +0 -1
- package/dist/conversation/files.d.ts +0 -30
- package/dist/conversation/files.js +0 -1
- package/dist/conversation/generation.d.ts +0 -4
- package/dist/conversation/generation.js +0 -1
- package/dist/conversation/index.d.ts +0 -10
- package/dist/conversation/index.js +0 -2
- package/dist/conversation/preview.d.ts +0 -46
- package/dist/conversation/preview.js +0 -1
- package/dist/conversation/recovery.d.ts +0 -29
- package/dist/conversation/recovery.js +0 -1
- package/dist/conversation/service.d.ts +0 -75
- package/dist/conversation/service.js +0 -1
- package/dist/conversation/settings.d.ts +0 -6
- package/dist/conversation/settings.js +0 -1
- package/dist/conversation/task.d.ts +0 -11
- package/dist/conversation/task.js +0 -1
- package/dist/invocation/changes.d.ts +0 -28
- package/dist/invocation/changes.js +0 -1
- package/dist/invocation/errors.d.ts +0 -1
- package/dist/invocation/errors.js +0 -1
- package/dist/invocation/index.d.ts +0 -3
- package/dist/invocation/index.js +0 -2
- package/dist/invocation/types.d.ts +0 -16
- package/dist/invocation/types.js +0 -2
- package/dist/observer/archive.d.ts +0 -9
- package/dist/observer/archive.js +0 -2
- package/dist/observer/changes.d.ts +0 -4
- package/dist/observer/changes.js +0 -1
- package/dist/observer/execution.d.ts +0 -10
- package/dist/observer/execution.js +0 -1
- package/dist/observer/index.d.ts +0 -8
- package/dist/observer/index.js +0 -2
- package/dist/observer/interaction.d.ts +0 -31
- package/dist/observer/interaction.js +0 -1
- package/dist/observer/memory.d.ts +0 -13
- package/dist/observer/memory.js +0 -1
- package/dist/observer/overview.d.ts +0 -45
- package/dist/observer/overview.js +0 -1
- package/dist/observer/selection.d.ts +0 -19
- package/dist/observer/selection.js +0 -1
- package/dist/observer/stream.d.ts +0 -56
- package/dist/observer/stream.js +0 -1
- package/dist/recording/changes.d.ts +0 -43
- package/dist/recording/changes.js +0 -1
- package/dist/recording/index.d.ts +0 -7
- package/dist/recording/index.js +0 -2
- package/dist/recording/invocation.d.ts +0 -10
- package/dist/recording/invocation.js +0 -2
- package/dist/recording/memory.d.ts +0 -18
- package/dist/recording/memory.js +0 -1
- package/dist/recording/resource.d.ts +0 -10
- package/dist/recording/resource.js +0 -1
- package/dist/recording/transcript.d.ts +0 -19
- package/dist/recording/transcript.js +0 -1
- package/dist/recording/types.d.ts +0 -190
- package/dist/recording/types.js +0 -2
- package/dist/recording/validate.d.ts +0 -4
- package/dist/recording/validate.js +0 -2
- /package/dist/{content/transcript.js → transcript.js} +0 -0
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import type { MemoryContent } from '../content/memory.js';
|
|
2
|
-
import type { MessageLocator } from '../content/transcript.js';
|
|
3
|
-
import type { CallableRecord, InvocationBoundaryRecord } from '../recording/types.js';
|
|
4
|
-
import type { ResourceRecord } from '../recording/resource.js';
|
|
5
|
-
import type { TranscriptRecord } from '../recording/transcript.js';
|
|
6
|
-
import type { MemoryRecord } from '../recording/memory.js';
|
|
7
|
-
import type { ConversationAdmission } from './delivery.js';
|
|
8
|
-
import type { ConversationSubmissionBaseline } from './preview.js';
|
|
9
|
-
export interface ConversationServiceInfo {
|
|
10
|
-
readonly conversationId: string;
|
|
11
|
-
readonly transcriptId: string;
|
|
12
|
-
readonly mode: 'demo' | 'live';
|
|
13
|
-
readonly answerMode?: 'material' | 'tools';
|
|
14
|
-
readonly model: string;
|
|
15
|
-
readonly admission: ConversationAdmission;
|
|
16
|
-
readonly active?: ConversationSubmissionBaseline;
|
|
17
|
-
}
|
|
18
|
-
export interface ConversationCallSummary {
|
|
19
|
-
readonly id: string;
|
|
20
|
-
readonly contextId: string;
|
|
21
|
-
readonly name?: string;
|
|
22
|
-
readonly status: 'running' | 'succeeded' | 'failed';
|
|
23
|
-
readonly startedAt?: string;
|
|
24
|
-
readonly input?: MessageLocator;
|
|
25
|
-
readonly answer?: MessageLocator;
|
|
26
|
-
}
|
|
27
|
-
export type ConversationRecordingState = {
|
|
28
|
-
readonly status: 'idle';
|
|
29
|
-
readonly recorderId?: never;
|
|
30
|
-
} | {
|
|
31
|
-
readonly status: 'recording' | 'stopping' | 'stopped';
|
|
32
|
-
readonly recorderId: string;
|
|
33
|
-
};
|
|
34
|
-
export interface ConversationInspection {
|
|
35
|
-
readonly transcriptId: string;
|
|
36
|
-
readonly memories: {
|
|
37
|
-
readonly id: string;
|
|
38
|
-
readonly sequence: number;
|
|
39
|
-
readonly items: readonly (MemoryContent & {
|
|
40
|
-
readonly id: string;
|
|
41
|
-
})[];
|
|
42
|
-
};
|
|
43
|
-
readonly view: {
|
|
44
|
-
readonly revision: number;
|
|
45
|
-
readonly sources: Readonly<Record<'messages' | 'memories', {
|
|
46
|
-
readonly id: string;
|
|
47
|
-
readonly scope: string;
|
|
48
|
-
}>>;
|
|
49
|
-
readonly members: readonly ({
|
|
50
|
-
readonly source: 'messages';
|
|
51
|
-
readonly key: number;
|
|
52
|
-
} | {
|
|
53
|
-
readonly source: 'memories';
|
|
54
|
-
readonly key: string;
|
|
55
|
-
})[];
|
|
56
|
-
};
|
|
57
|
-
readonly recording: ConversationRecordingState & {
|
|
58
|
-
readonly revision: number;
|
|
59
|
-
readonly integrity: 'intact' | 'incomplete';
|
|
60
|
-
readonly calls: readonly ConversationCallSummary[];
|
|
61
|
-
readonly omitted: number;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
export interface ConversationCallDetail {
|
|
65
|
-
readonly recorderId: string;
|
|
66
|
-
readonly revision: number;
|
|
67
|
-
readonly integrity: 'intact' | 'incomplete';
|
|
68
|
-
readonly root: CallableRecord;
|
|
69
|
-
readonly calls: readonly CallableRecord[];
|
|
70
|
-
readonly resources: readonly ResourceRecord[];
|
|
71
|
-
readonly transcripts: readonly TranscriptRecord[];
|
|
72
|
-
readonly memories: readonly MemoryRecord[];
|
|
73
|
-
readonly boundaries: readonly InvocationBoundaryRecord[];
|
|
74
|
-
readonly truncated: boolean;
|
|
75
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { InvocationFailureFact } from './errors.js';
|
|
2
|
-
import type { CallableKind, InvocationProcessStage, InvocationProcessAction, InvocationRelationIdentity, InvocationRelationPhase } from './types.js';
|
|
3
|
-
export type InvocationEvent = Readonly<{
|
|
4
|
-
type: 'invocation';
|
|
5
|
-
contextId: string;
|
|
6
|
-
parentContextId?: string;
|
|
7
|
-
kind: CallableKind;
|
|
8
|
-
sequence: number;
|
|
9
|
-
occurredAt: string;
|
|
10
|
-
change: Readonly<{
|
|
11
|
-
kind: 'started';
|
|
12
|
-
}> | Readonly<{
|
|
13
|
-
kind: 'process';
|
|
14
|
-
processSequence: number;
|
|
15
|
-
round: number;
|
|
16
|
-
stage: InvocationProcessStage;
|
|
17
|
-
action: InvocationProcessAction;
|
|
18
|
-
}> | Readonly<{
|
|
19
|
-
kind: 'relation';
|
|
20
|
-
identity: InvocationRelationIdentity;
|
|
21
|
-
phase: InvocationRelationPhase;
|
|
22
|
-
status?: 'succeeded' | 'failed';
|
|
23
|
-
failure?: InvocationFailureFact;
|
|
24
|
-
}> | Readonly<{
|
|
25
|
-
kind: 'finished';
|
|
26
|
-
status: 'succeeded' | 'failed';
|
|
27
|
-
}>;
|
|
28
|
-
}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { RuntimeErrorDetail, RuntimeErrorValue, InvocationFailureFact } from '@weiliang0121/capix-contracts';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
package/dist/invocation/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export { callableKinds, type CallableKind } from '@weiliang0121/capix-contracts';
|
|
2
|
-
export type LegacyInvocationLevel = 'runtime' | 'execution' | 'operation' | 'attempt';
|
|
3
|
-
export declare const invocationProcessStages: readonly ["execute", "receive", "handling", "control"];
|
|
4
|
-
export declare const invocationProcessActions: readonly ["start", "return", "throw", "continue", "unhandled", "stop"];
|
|
5
|
-
export type InvocationProcessStage = (typeof invocationProcessStages)[number];
|
|
6
|
-
export type InvocationProcessAction = (typeof invocationProcessActions)[number];
|
|
7
|
-
export interface InvocationRelationIdentity {
|
|
8
|
-
readonly parentContextId: string;
|
|
9
|
-
readonly childContextId: string;
|
|
10
|
-
readonly parentRound: number;
|
|
11
|
-
readonly key?: string;
|
|
12
|
-
}
|
|
13
|
-
export type InvocationRelationPhase = 'attached' | 'returned' | 'receiving' | 'accepted' | 'handled' | 'failed';
|
|
14
|
-
export interface InvocationOrigin {
|
|
15
|
-
readonly contextId: string;
|
|
16
|
-
}
|
package/dist/invocation/types.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
2
|
-
import{callableKinds}from"@weiliang0121/capix-contracts";const invocationProcessStages=["execute","receive","handling","control"],invocationProcessActions=["start","return","throw","continue","unhandled","stop"];export{callableKinds,invocationProcessActions,invocationProcessStages};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface RecordingArchive {
|
|
2
|
-
readonly sourceId: string;
|
|
3
|
-
readonly rootIds: readonly string[];
|
|
4
|
-
readonly revision: number;
|
|
5
|
-
readonly state: 'open' | 'sealed' | 'incomplete';
|
|
6
|
-
}
|
|
7
|
-
export type RecordingArchiveOrigin = Omit<RecordingArchive, 'rootIds'>;
|
|
8
|
-
export declare function validateRecordingArchiveOrigin(value: unknown): asserts value is RecordingArchiveOrigin;
|
|
9
|
-
export declare function validateRecordingArchives(value: unknown): asserts value is readonly RecordingArchive[];
|
package/dist/observer/archive.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
2
|
-
var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function validateRecordingArchiveOrigin(value){if(!value||typeof value!="object")throw new Error("\u5386\u53F2\u8BB0\u5F55\u6765\u6E90\u683C\u5F0F\u65E0\u6548\u3002");const source=value;if(typeof source.sourceId!="string"||!source.sourceId||!Number.isSafeInteger(source.revision)||source.revision<0||!["open","sealed","incomplete"].includes(source.state))throw new Error("\u5386\u53F2\u8BB0\u5F55\u6765\u6E90\u683C\u5F0F\u65E0\u6548\u3002")}__name(validateRecordingArchiveOrigin,"validateRecordingArchiveOrigin");function validateRecordingArchives(value){if(!Array.isArray(value))throw new Error("\u5386\u53F2\u8BB0\u5F55\u6765\u6E90\u683C\u5F0F\u65E0\u6548\u3002");const sources=new Set,roots=new Set;for(const archive of value){validateRecordingArchiveOrigin(archive);const source=archive;if(sources.has(source.sourceId)||!Array.isArray(source.rootIds)||source.rootIds.some(id=>typeof id!="string"||!id||roots.has(id)))throw new Error("\u5386\u53F2\u8BB0\u5F55\u6765\u6E90\u5F52\u5C5E\u65E0\u6548\u3002");sources.add(source.sourceId);for(const id of source.rootIds){if(roots.has(id))throw new Error("\u5386\u53F2\u8BB0\u5F55\u6765\u6E90\u5F52\u5C5E\u65E0\u6548\u3002");roots.add(id)}}}__name(validateRecordingArchives,"validateRecordingArchives");export{validateRecordingArchiveOrigin,validateRecordingArchives};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { TranscriptEvent, MemoryEvent } from '../content/changes.js';
|
|
2
|
-
import type { RecordChangeEvent } from '../recording/changes.js';
|
|
3
|
-
import type { InvocationEvent } from '../invocation/changes.js';
|
|
4
|
-
export type ObserverChange = TranscriptEvent | MemoryEvent | RecordChangeEvent | InvocationEvent;
|
package/dist/observer/changes.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { SelectionObservation } from './selection.js';
|
|
2
|
-
import type { OperationRecord } from '../recording/types.js';
|
|
3
|
-
export interface ExecutionObservation extends Omit<SelectionObservation, 'executions'> {
|
|
4
|
-
executions: (SelectionObservation['executions'][number] & {
|
|
5
|
-
response?: {
|
|
6
|
-
index?: number;
|
|
7
|
-
};
|
|
8
|
-
memoryStatus?: OperationRecord['status'];
|
|
9
|
-
})[];
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
package/dist/observer/index.d.ts
DELETED
package/dist/observer/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
2
|
-
export*from"./overview.js";export*from"./execution.js";export*from"./memory.js";export*from"./selection.js";export*from"./changes.js";export*from"./stream.js";export*from"./archive.js";export*from"./interaction.js";
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { RuntimeErrorValue } from '../invocation/errors.js';
|
|
2
|
-
export interface CallInteractionLinks {
|
|
3
|
-
readonly callId: string;
|
|
4
|
-
readonly interactionIds: readonly string[];
|
|
5
|
-
}
|
|
6
|
-
export interface InteractionObservation {
|
|
7
|
-
readonly id: string;
|
|
8
|
-
readonly contract: string;
|
|
9
|
-
readonly revision: number;
|
|
10
|
-
readonly delivery: 'prepared' | 'started';
|
|
11
|
-
readonly retained: 'persistent' | 'memory';
|
|
12
|
-
readonly model: string;
|
|
13
|
-
readonly purpose: string;
|
|
14
|
-
readonly result: {
|
|
15
|
-
readonly kind: 'pending';
|
|
16
|
-
} | {
|
|
17
|
-
readonly kind: 'received';
|
|
18
|
-
readonly feedbackId: string;
|
|
19
|
-
} | {
|
|
20
|
-
readonly kind: 'unavailable';
|
|
21
|
-
readonly error: RuntimeErrorValue;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export type InteractionUpdate = {
|
|
25
|
-
readonly type: 'snapshot';
|
|
26
|
-
readonly value: InteractionObservation;
|
|
27
|
-
} | {
|
|
28
|
-
readonly type: 'error';
|
|
29
|
-
readonly error: string;
|
|
30
|
-
readonly code?: string;
|
|
31
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { MessageLocator } from '../content/transcript.js';
|
|
2
|
-
import type { MemoryRecord } from '../recording/memory.js';
|
|
3
|
-
import type { MemoryResultSource } from '../content/memory.js';
|
|
4
|
-
export interface MemoryObservation {
|
|
5
|
-
readonly items: readonly {
|
|
6
|
-
id: string;
|
|
7
|
-
topic: string;
|
|
8
|
-
content: string;
|
|
9
|
-
sources: readonly MessageLocator[];
|
|
10
|
-
sourceResults?: readonly MemoryResultSource[];
|
|
11
|
-
records: readonly MemoryRecord[];
|
|
12
|
-
}[];
|
|
13
|
-
}
|
package/dist/observer/memory.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { RecordingArchive, RecordingArchiveOrigin } from './archive.js';
|
|
2
|
-
import type { CallableKind } from '../invocation/types.js';
|
|
3
|
-
import type { ExecutionRecord } from '../recording/types.js';
|
|
4
|
-
import type { ExecutionObservation } from './execution.js';
|
|
5
|
-
import type { MemoryRecord } from '../recording/memory.js';
|
|
6
|
-
import type { TranscriptRangeLocator } from '../content/transcript.js';
|
|
7
|
-
export interface SourceResponse {
|
|
8
|
-
path: string;
|
|
9
|
-
content: string;
|
|
10
|
-
}
|
|
11
|
-
export type { ObservationUpdate } from './stream.js';
|
|
12
|
-
export interface InvocationSummary {
|
|
13
|
-
id: string;
|
|
14
|
-
contextId: string;
|
|
15
|
-
recordType: CallableKind;
|
|
16
|
-
parentId?: string;
|
|
17
|
-
name: string;
|
|
18
|
-
label: string;
|
|
19
|
-
source: string;
|
|
20
|
-
status: ExecutionRecord['status'];
|
|
21
|
-
offsetMs: number;
|
|
22
|
-
durationMs?: number;
|
|
23
|
-
}
|
|
24
|
-
type ObservedExecution = ExecutionObservation['executions'][number];
|
|
25
|
-
export interface ExecutionSummary extends ObservedExecution {
|
|
26
|
-
readonly archive?: RecordingArchiveOrigin;
|
|
27
|
-
durationMs?: number;
|
|
28
|
-
observedOffsetMs: number;
|
|
29
|
-
calls: InvocationSummary[];
|
|
30
|
-
transcriptRange?: TranscriptRangeLocator;
|
|
31
|
-
availableMemoryIds: string[];
|
|
32
|
-
memoryChanges: {
|
|
33
|
-
id: string;
|
|
34
|
-
memoryId: string;
|
|
35
|
-
operationId?: string;
|
|
36
|
-
action: MemoryRecord['value']['action'];
|
|
37
|
-
change: string;
|
|
38
|
-
}[];
|
|
39
|
-
}
|
|
40
|
-
export interface ObserverOverview {
|
|
41
|
-
readonly archives?: readonly RecordingArchive[];
|
|
42
|
-
transcriptId: string;
|
|
43
|
-
messages: ExecutionObservation['messages'];
|
|
44
|
-
executions: ExecutionSummary[];
|
|
45
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ExecutionRecord, OperationRecord } from '../recording/types.js';
|
|
2
|
-
export interface SelectionObservation {
|
|
3
|
-
transcriptId: string;
|
|
4
|
-
messages: {
|
|
5
|
-
index: number;
|
|
6
|
-
count: number;
|
|
7
|
-
}[];
|
|
8
|
-
executions: {
|
|
9
|
-
id: string;
|
|
10
|
-
startedAt: string;
|
|
11
|
-
status: ExecutionRecord['status'];
|
|
12
|
-
inputIndex: number;
|
|
13
|
-
selections: {
|
|
14
|
-
operationId: string;
|
|
15
|
-
status: OperationRecord['status'];
|
|
16
|
-
indexes?: readonly number[];
|
|
17
|
-
}[];
|
|
18
|
-
}[];
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { ObserverOverview } from './overview.js';
|
|
2
|
-
import type { MemoryObservation } from './memory.js';
|
|
3
|
-
import type { RecordEntry } from '../recording/changes.js';
|
|
4
|
-
import type { ObserverChange } from './changes.js';
|
|
5
|
-
import type { InvocationEvent } from '../invocation/changes.js';
|
|
6
|
-
import type { TranscriptEvent } from '../content/changes.js';
|
|
7
|
-
export type TranscriptNotice = Omit<TranscriptEvent, 'change'> & {
|
|
8
|
-
readonly change: Readonly<{
|
|
9
|
-
kind: 'messages-appended';
|
|
10
|
-
start: number;
|
|
11
|
-
end: number;
|
|
12
|
-
}> | Extract<TranscriptEvent['change'], {
|
|
13
|
-
kind: 'segment-started';
|
|
14
|
-
}>;
|
|
15
|
-
};
|
|
16
|
-
export type ObservationChange = Exclude<ObserverChange, TranscriptEvent> | TranscriptNotice;
|
|
17
|
-
export interface ObservationBaseline {
|
|
18
|
-
readonly type: 'baseline';
|
|
19
|
-
readonly scopeId: string;
|
|
20
|
-
readonly sequence: number;
|
|
21
|
-
readonly overview: ObserverOverview;
|
|
22
|
-
readonly memory: MemoryObservation;
|
|
23
|
-
readonly transcript: {
|
|
24
|
-
readonly id: string;
|
|
25
|
-
readonly revision: number;
|
|
26
|
-
readonly starts: readonly number[];
|
|
27
|
-
};
|
|
28
|
-
readonly memories: {
|
|
29
|
-
readonly id: string;
|
|
30
|
-
readonly sequence: number;
|
|
31
|
-
};
|
|
32
|
-
readonly recorder: {
|
|
33
|
-
readonly id: string;
|
|
34
|
-
readonly revision: number;
|
|
35
|
-
};
|
|
36
|
-
readonly entries: readonly RecordEntry[];
|
|
37
|
-
readonly invocations: readonly InvocationEvent[];
|
|
38
|
-
}
|
|
39
|
-
export interface ObservationDelta {
|
|
40
|
-
readonly type: 'delta';
|
|
41
|
-
readonly scopeId: string;
|
|
42
|
-
readonly sequence: number;
|
|
43
|
-
readonly changes: readonly ObservationChange[];
|
|
44
|
-
}
|
|
45
|
-
export type ObservationFrame = ObservationBaseline | ObservationDelta;
|
|
46
|
-
export interface ObservationSourceIncomplete {
|
|
47
|
-
readonly type: 'error';
|
|
48
|
-
readonly code: 'SOURCE_INCOMPLETE';
|
|
49
|
-
readonly sourceId: string;
|
|
50
|
-
readonly error: string;
|
|
51
|
-
}
|
|
52
|
-
export type ObservationUpdate = ObservationFrame | ObservationSourceIncomplete | {
|
|
53
|
-
type: 'error';
|
|
54
|
-
error: string;
|
|
55
|
-
code?: string;
|
|
56
|
-
};
|
package/dist/observer/stream.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { BaseRecord, ProcessRecord, RelationChangeRecord } from './types.js';
|
|
2
|
-
import type { RuntimeErrorValue, InvocationFailureFact } from '../invocation/errors.js';
|
|
3
|
-
export type RecordKind = 'invocation' | 'runtime' | 'runtime-call' | 'execution' | 'operation' | 'attempt' | 'invocation-boundary' | 'transcript' | 'memory' | 'resource' | 'custom';
|
|
4
|
-
export interface RecordEntry {
|
|
5
|
-
readonly kind: RecordKind;
|
|
6
|
-
readonly data: BaseRecord;
|
|
7
|
-
}
|
|
8
|
-
export type RecordMutation = Readonly<{
|
|
9
|
-
kind: 'added';
|
|
10
|
-
entry: RecordEntry;
|
|
11
|
-
parent?: Readonly<{
|
|
12
|
-
id: string;
|
|
13
|
-
childId: string;
|
|
14
|
-
}>;
|
|
15
|
-
}> | Readonly<{
|
|
16
|
-
kind: 'process-appended';
|
|
17
|
-
id: string;
|
|
18
|
-
process: ProcessRecord;
|
|
19
|
-
}> | Readonly<{
|
|
20
|
-
kind: 'relation-appended';
|
|
21
|
-
id: string;
|
|
22
|
-
relation: RelationChangeRecord;
|
|
23
|
-
}> | Readonly<{
|
|
24
|
-
kind: 'finished';
|
|
25
|
-
id: string;
|
|
26
|
-
status: 'succeeded' | 'failed';
|
|
27
|
-
result: Readonly<{
|
|
28
|
-
output?: unknown;
|
|
29
|
-
resultOf?: number;
|
|
30
|
-
error?: RuntimeErrorValue;
|
|
31
|
-
failure?: InvocationFailureFact;
|
|
32
|
-
}>;
|
|
33
|
-
}> | Readonly<{
|
|
34
|
-
kind: 'replaced';
|
|
35
|
-
entry: RecordEntry;
|
|
36
|
-
}>;
|
|
37
|
-
export type RecordChangeEvent = Readonly<{
|
|
38
|
-
type: 'record';
|
|
39
|
-
recorderId: string;
|
|
40
|
-
revision: number;
|
|
41
|
-
occurredAt: string;
|
|
42
|
-
change: RecordMutation;
|
|
43
|
-
}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
package/dist/recording/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { InvocationValue, ProcessRecord } from './types.js';
|
|
2
|
-
type OutputProcess = Extract<ProcessRecord, {
|
|
3
|
-
type: 'return';
|
|
4
|
-
output: unknown;
|
|
5
|
-
}>;
|
|
6
|
-
export declare function outputProcess(value: Pick<InvocationValue, 'processes'>, sequence: number, before?: number): OutputProcess;
|
|
7
|
-
export declare function hasOutput(value: InvocationValue): boolean;
|
|
8
|
-
export declare function finalOutputProcess(value: Pick<InvocationValue, 'processes'>, sequence: number): OutputProcess;
|
|
9
|
-
export declare function readOutput<Input, Output>(value: InvocationValue<Input, Output>): Output | undefined;
|
|
10
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
2
|
-
var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function outputProcess(value,sequence,before=value.processes.length+1){const process=value.processes[sequence-1];if(!Number.isSafeInteger(sequence)||sequence<1||sequence>=before||!process||process.sequence!==sequence||process.type!=="return"||!Object.hasOwn(process,"output")||Object.hasOwn(process,"resultOf"))throw new Error("Invalid local result reference");return process}__name(outputProcess,"outputProcess");function hasOutput(value){return Object.hasOwn(value,"output")||Object.hasOwn(value,"resultOf")}__name(hasOutput,"hasOutput");function finalOutputProcess(value,sequence){const last=value.processes.at(-1);if(!last||last.type!=="return"||sequence!==("resultOf"in last?last.resultOf:last.sequence))throw new Error("Final result must reference the last returned output");return outputProcess(value,sequence)}__name(finalOutputProcess,"finalOutputProcess");function readOutput(value){if(Object.hasOwn(value,"resultOf")){if(Object.hasOwn(value,"output"))throw new Error("Output and local result reference are mutually exclusive");return finalOutputProcess(value,value.resultOf).output}return value.output}__name(readOutput,"readOutput");export{finalOutputProcess,hasOutput,outputProcess,readOutput};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { MemoryContent, MemoryResultSource } from '../content/memory.js';
|
|
2
|
-
import type { BaseRecord } from './types.js';
|
|
3
|
-
export interface MemoryRecordValue {
|
|
4
|
-
readonly action: 'create' | 'update';
|
|
5
|
-
readonly change: string;
|
|
6
|
-
readonly sourceIndexes: readonly number[];
|
|
7
|
-
readonly sourceResults?: readonly MemoryResultSource[];
|
|
8
|
-
readonly result: MemoryContent;
|
|
9
|
-
}
|
|
10
|
-
export interface MemoryRecord extends BaseRecord<MemoryRecordValue> {
|
|
11
|
-
readonly memoryId: string;
|
|
12
|
-
readonly memoriesId: string;
|
|
13
|
-
readonly sequence: number;
|
|
14
|
-
readonly contextId?: string;
|
|
15
|
-
readonly callId?: string;
|
|
16
|
-
readonly executionId?: string;
|
|
17
|
-
readonly operationId?: string;
|
|
18
|
-
}
|
package/dist/recording/memory.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { BaseRecord } from './types.js';
|
|
2
|
-
export interface ResourceRecord<Detail = unknown> extends BaseRecord<Detail> {
|
|
3
|
-
readonly parentId: string;
|
|
4
|
-
readonly access: string;
|
|
5
|
-
readonly supplyId: string;
|
|
6
|
-
readonly sequence: number;
|
|
7
|
-
readonly occurredAt: string;
|
|
8
|
-
readonly phase: 'bound' | 'available' | 'unavailable' | 'started' | 'returned' | 'threw';
|
|
9
|
-
readonly interactionId?: string;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { BaseRecord } from './types.js';
|
|
2
|
-
export type TranscriptChange = {
|
|
3
|
-
readonly action: 'append';
|
|
4
|
-
readonly start: number;
|
|
5
|
-
readonly end: number;
|
|
6
|
-
} | {
|
|
7
|
-
readonly action: 'segment';
|
|
8
|
-
readonly previousStart: number;
|
|
9
|
-
readonly start: number;
|
|
10
|
-
readonly end: number;
|
|
11
|
-
};
|
|
12
|
-
export interface TranscriptRecord extends BaseRecord<TranscriptChange> {
|
|
13
|
-
readonly transcriptId: string;
|
|
14
|
-
readonly revision: number;
|
|
15
|
-
readonly occurredAt: string;
|
|
16
|
-
readonly contextId?: string;
|
|
17
|
-
readonly callId?: string;
|
|
18
|
-
readonly executionId?: string;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! MIT License | Copyright (c) 2026 wei.liang | See LICENSE */
|