@botbotgo/agent-harness 0.0.290 → 0.0.291
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 +20 -20
- package/README.zh.md +14 -14
- package/dist/acp.d.ts +5 -5
- package/dist/acp.js +3 -3
- package/dist/api.d.ts +20 -21
- package/dist/api.js +38 -50
- package/dist/cli.js +47 -43
- package/dist/config/agents/orchestra.yaml +3 -3
- package/dist/config/knowledge/knowledge-runtime.yaml +4 -4
- package/dist/config/runtime/runtime-memory.yaml +7 -7
- package/dist/config/runtime/workspace.yaml +7 -7
- package/dist/contracts/core.d.ts +1 -1
- package/dist/contracts/runtime.d.ts +35 -40
- package/dist/contracts/workspace.d.ts +2 -2
- package/dist/flow/build-flow-graph.js +20 -33
- package/dist/flow/export-sequence-mermaid.js +4 -4
- package/dist/flow/types.d.ts +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/init-project.js +10 -10
- package/dist/knowledge/module.js +37 -45
- package/dist/mcp.d.ts +9 -9
- package/dist/mcp.js +6 -6
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/persistence/file-store.d.ts +69 -69
- package/dist/persistence/file-store.js +224 -221
- package/dist/persistence/sqlite-request-context-store.d.ts +22 -0
- package/dist/persistence/sqlite-request-context-store.js +64 -0
- package/dist/persistence/sqlite-request-queue-store.d.ts +41 -0
- package/dist/persistence/sqlite-request-queue-store.js +120 -0
- package/dist/persistence/sqlite-store.d.ts +72 -72
- package/dist/persistence/sqlite-store.js +361 -361
- package/dist/persistence/types.d.ts +84 -84
- package/dist/protocol/a2a/http.js +79 -74
- package/dist/protocol/ag-ui/http.d.ts +7 -7
- package/dist/protocol/ag-ui/http.js +20 -20
- package/dist/resource/resource-impl.js +1 -1
- package/dist/runtime/adapter/compat/deepagent-compat.d.ts +2 -2
- package/dist/runtime/adapter/flow/invocation-flow.d.ts +6 -5
- package/dist/runtime/adapter/flow/invocation-flow.js +6 -5
- package/dist/runtime/adapter/flow/stream-runtime.d.ts +3 -3
- package/dist/runtime/adapter/flow/stream-runtime.js +5 -4
- package/dist/runtime/adapter/invocation-result.d.ts +6 -5
- package/dist/runtime/adapter/invocation-result.js +5 -4
- package/dist/runtime/adapter/middleware-assembly.js +3 -2
- package/dist/runtime/adapter/tool/tool-hitl.js +1 -1
- package/dist/runtime/adapter/upstream-configurable-keys.d.ts +2 -0
- package/dist/runtime/adapter/upstream-configurable-keys.js +2 -0
- package/dist/runtime/agent-runtime-adapter.d.ts +11 -8
- package/dist/runtime/agent-runtime-adapter.js +36 -32
- package/dist/runtime/harness/events/events.d.ts +8 -8
- package/dist/runtime/harness/events/events.js +25 -19
- package/dist/runtime/harness/events/listener-runtime.d.ts +5 -4
- package/dist/runtime/harness/events/listener-runtime.js +7 -3
- package/dist/runtime/harness/events/runtime-event-operations.d.ts +7 -7
- package/dist/runtime/harness/events/runtime-event-operations.js +5 -5
- package/dist/runtime/harness/events/streaming.d.ts +8 -7
- package/dist/runtime/harness/events/streaming.js +20 -19
- package/dist/runtime/harness/events/timeline.js +6 -6
- package/dist/runtime/harness/index.d.ts +1 -1
- package/dist/runtime/harness/index.js +1 -1
- package/dist/runtime/harness/run/helpers.d.ts +14 -11
- package/dist/runtime/harness/run/helpers.js +10 -7
- package/dist/runtime/harness/run/inspection.d.ts +3 -2
- package/dist/runtime/harness/run/inspection.js +7 -7
- package/dist/runtime/harness/run/operator-overview.d.ts +2 -2
- package/dist/runtime/harness/run/operator-overview.js +18 -17
- package/dist/runtime/harness/run/queue-diagnostics.js +6 -6
- package/dist/runtime/harness/run/recovery.d.ts +15 -15
- package/dist/runtime/harness/run/recovery.js +53 -50
- package/dist/runtime/harness/run/resources.d.ts +2 -2
- package/dist/runtime/harness/run/resources.js +8 -8
- package/dist/runtime/harness/run/resume.d.ts +3 -3
- package/dist/runtime/harness/run/resume.js +4 -4
- package/dist/runtime/harness/run/routing.d.ts +4 -4
- package/dist/runtime/harness/run/routing.js +8 -8
- package/dist/runtime/harness/run/run-lifecycle.d.ts +12 -12
- package/dist/runtime/harness/run/run-lifecycle.js +26 -26
- package/dist/runtime/harness/run/run-operations.d.ts +45 -45
- package/dist/runtime/harness/run/run-operations.js +79 -78
- package/dist/runtime/harness/run/run-queue.d.ts +8 -8
- package/dist/runtime/harness/run/run-queue.js +16 -16
- package/dist/runtime/harness/run/run-slot-acquisition.d.ts +32 -32
- package/dist/runtime/harness/run/run-slot-acquisition.js +41 -41
- package/dist/runtime/harness/run/{thread-records.d.ts → session-records.d.ts} +6 -13
- package/dist/runtime/harness/run/{thread-records.js → session-records.js} +14 -60
- package/dist/runtime/harness/run/start-run.d.ts +36 -36
- package/dist/runtime/harness/run/start-run.js +55 -36
- package/dist/runtime/harness/run/startup-runtime.d.ts +9 -9
- package/dist/runtime/harness/run/startup-runtime.js +22 -20
- package/dist/runtime/harness/run/stream-run.d.ts +18 -18
- package/dist/runtime/harness/run/stream-run.js +52 -52
- package/dist/runtime/harness/runtime-defaults.d.ts +2 -2
- package/dist/runtime/harness/runtime-defaults.js +7 -7
- package/dist/runtime/harness/system/health-monitor.d.ts +3 -3
- package/dist/runtime/harness/system/health-monitor.js +18 -18
- package/dist/runtime/harness/system/mem0-ingestion-sync.d.ts +6 -6
- package/dist/runtime/harness/system/mem0-ingestion-sync.js +36 -27
- package/dist/runtime/harness/system/runtime-memory-candidates.js +2 -2
- package/dist/runtime/harness/system/runtime-memory-manager.d.ts +13 -13
- package/dist/runtime/harness/system/runtime-memory-manager.js +41 -38
- package/dist/runtime/harness/system/runtime-memory-policy.d.ts +1 -1
- package/dist/runtime/harness/system/runtime-memory-policy.js +1 -1
- package/dist/runtime/harness/system/runtime-memory-records.d.ts +4 -2
- package/dist/runtime/harness/system/runtime-memory-records.js +21 -8
- package/dist/runtime/harness/system/runtime-memory-sync.d.ts +6 -6
- package/dist/runtime/harness/system/runtime-memory-sync.js +47 -44
- package/dist/runtime/harness/system/{thread-memory-sync.d.ts → session-memory-sync.d.ts} +7 -7
- package/dist/runtime/harness/system/{thread-memory-sync.js → session-memory-sync.js} +28 -28
- package/dist/runtime/harness.d.ts +33 -45
- package/dist/runtime/harness.js +273 -291
- package/dist/runtime/maintenance/checkpoint-maintenance.js +2 -2
- package/dist/runtime/maintenance/file-checkpoint-saver.d.ts +1 -1
- package/dist/runtime/maintenance/file-checkpoint-saver.js +6 -6
- package/dist/runtime/maintenance/runtime-record-maintenance.d.ts +1 -1
- package/dist/runtime/maintenance/runtime-record-maintenance.js +33 -33
- package/dist/runtime/maintenance/sqlite-checkpoint-saver.d.ts +1 -1
- package/dist/runtime/maintenance/sqlite-checkpoint-saver.js +30 -10
- package/dist/runtime/support/harness-support.d.ts +2 -2
- package/dist/runtime/support/harness-support.js +7 -7
- package/dist/runtime/support/runtime-adapter-options.d.ts +2 -2
- package/dist/runtime/support/runtime-adapter-options.js +3 -3
- package/dist/runtime/support/runtime-factories.d.ts +2 -2
- package/dist/runtime/support/runtime-factories.js +10 -10
- package/dist/workspace/agent-binding-compiler.js +3 -3
- package/dist/workspace/object-loader.js +1 -1
- package/dist/workspace/support/workspace-ref-utils.d.ts +4 -3
- package/dist/workspace/support/workspace-ref-utils.js +5 -4
- package/package.json +1 -1
- package/dist/persistence/sqlite-run-context-store.d.ts +0 -22
- package/dist/persistence/sqlite-run-context-store.js +0 -64
- package/dist/persistence/sqlite-run-queue-store.d.ts +0 -41
- package/dist/persistence/sqlite-run-queue-store.js +0 -120
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import type { ArtifactListing, ArtifactRecord, HarnessEvent, InternalApprovalRecord,
|
|
2
|
-
import type { ApprovalFilter, PersistedSessionListSummary,
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
state:
|
|
1
|
+
import type { ArtifactListing, ArtifactRecord, HarnessEvent, InternalApprovalRecord, RequestSummary, RequestState, SessionRequestRecord, SessionSummary, TranscriptMessage } from "../contracts/types.js";
|
|
2
|
+
import type { ApprovalFilter, PersistedSessionListSummary, PersistedRequestInput, PersistedRequestControlRecord, PersistedRunInspection, PersistedRequestQueueRecord, PersistenceLifecycle as Lifecycle, PersistenceRequestMeta as RequestMeta, RuntimePersistence, RecoveryIntent, PersistenceSessionMeta as SessionMeta, RequestSummaryFilter, SessionSummaryFilter } from "./types.js";
|
|
3
|
+
type RequestIndexRecord = {
|
|
4
|
+
requestId: string;
|
|
5
|
+
sessionId: string;
|
|
6
|
+
state: RequestState;
|
|
7
7
|
resumable: boolean;
|
|
8
8
|
updatedAt: string;
|
|
9
9
|
};
|
|
10
10
|
export declare class FilePersistence implements RuntimePersistence {
|
|
11
|
-
private readonly
|
|
12
|
-
constructor(
|
|
11
|
+
private readonly runtimeRoot;
|
|
12
|
+
constructor(runtimeRoot: string);
|
|
13
13
|
private artifactsRoot;
|
|
14
|
-
private
|
|
15
|
-
private
|
|
14
|
+
private sessionIndexPath;
|
|
15
|
+
private requestIndexPath;
|
|
16
16
|
private approvalIndexPath;
|
|
17
|
-
private
|
|
18
|
-
private
|
|
17
|
+
private requestQueuePath;
|
|
18
|
+
private requestControlPath;
|
|
19
19
|
private traceItemsPath;
|
|
20
20
|
initialize(): Promise<void>;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
sessionDir(sessionId: string): string;
|
|
22
|
+
requestDir(sessionId: string, requestId: string): string;
|
|
23
|
+
createSession(input: {
|
|
24
|
+
sessionId: string;
|
|
25
25
|
agentId: string;
|
|
26
|
-
|
|
27
|
-
status:
|
|
26
|
+
requestId: string;
|
|
27
|
+
status: RequestState;
|
|
28
28
|
createdAt: string;
|
|
29
29
|
}): Promise<void>;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
createRequest(input: {
|
|
31
|
+
sessionId: string;
|
|
32
|
+
requestId: string;
|
|
33
33
|
agentId: string;
|
|
34
34
|
executionMode: string;
|
|
35
35
|
adapterKind?: string;
|
|
@@ -37,74 +37,74 @@ export declare class FilePersistence implements RuntimePersistence {
|
|
|
37
37
|
startedAt?: string;
|
|
38
38
|
currentAgentId?: string;
|
|
39
39
|
delegationChain?: string[];
|
|
40
|
-
runtimeSnapshot?:
|
|
40
|
+
runtimeSnapshot?: RequestSummary["runtimeSnapshot"];
|
|
41
41
|
}): Promise<void>;
|
|
42
|
-
|
|
42
|
+
setRequestState(sessionId: string, requestId: string, state: RequestState, checkpointRef?: string | null): Promise<void>;
|
|
43
43
|
appendEvent(event: HarnessEvent): Promise<void>;
|
|
44
|
-
listSessions(filter?:
|
|
45
|
-
listSessionSummaries(filter?:
|
|
46
|
-
|
|
47
|
-
private
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
getSession(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
listSessions(filter?: SessionSummaryFilter): Promise<SessionSummary[]>;
|
|
45
|
+
listSessionSummaries(filter?: SessionSummaryFilter): Promise<PersistedSessionListSummary[]>;
|
|
46
|
+
listRequestIndexes(): Promise<RequestIndexRecord[]>;
|
|
47
|
+
private readRequestSummary;
|
|
48
|
+
listRequests(filter?: RequestSummaryFilter): Promise<RequestSummary[]>;
|
|
49
|
+
getRequest(requestId: string): Promise<RequestSummary | null>;
|
|
50
|
+
getSession(sessionId: string): Promise<SessionSummary | null>;
|
|
51
|
+
getSessionMeta(sessionId: string): Promise<SessionMeta | null>;
|
|
52
|
+
listSessionRequests(sessionId: string): Promise<SessionRequestRecord[]>;
|
|
53
|
+
listRequestEvents(sessionId: string, requestId: string): Promise<HarnessEvent[]>;
|
|
54
54
|
listApprovals(filter?: ApprovalFilter): Promise<InternalApprovalRecord[]>;
|
|
55
55
|
getApproval(approvalId: string): Promise<InternalApprovalRecord | null>;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
getRequestApprovals(sessionId: string, requestId: string): Promise<InternalApprovalRecord[]>;
|
|
57
|
+
getRequestMeta(sessionId: string, requestId: string): Promise<RequestMeta>;
|
|
58
|
+
getRequestLifecycle(sessionId: string, requestId: string): Promise<Lifecycle>;
|
|
59
|
+
getRequestInspection(sessionId: string, requestId: string): Promise<PersistedRunInspection>;
|
|
60
|
+
updateRequestInspection(sessionId: string, requestId: string, patch: {
|
|
61
61
|
endedAt?: string | null;
|
|
62
62
|
lastActivityAt?: string;
|
|
63
63
|
currentAgentId?: string | null;
|
|
64
64
|
delegationChain?: string[];
|
|
65
|
-
runtimeSnapshot?:
|
|
65
|
+
runtimeSnapshot?: RequestSummary["runtimeSnapshot"] | null;
|
|
66
66
|
}): Promise<void>;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
appendRequestTraceItem(sessionId: string, requestId: string, item: unknown): Promise<void>;
|
|
68
|
+
listRequestTraceItems(sessionId: string, requestId: string): Promise<unknown[]>;
|
|
69
|
+
deleteSession(sessionId: string): Promise<boolean>;
|
|
70
|
+
saveRequestInput(sessionId: string, requestId: string, request: PersistedRequestInput): Promise<void>;
|
|
71
|
+
getRequestInput(sessionId: string, requestId: string): Promise<PersistedRequestInput | null>;
|
|
72
|
+
clearRequestInput(sessionId: string, requestId: string): Promise<void>;
|
|
73
73
|
createApproval(record: InternalApprovalRecord): Promise<void>;
|
|
74
|
-
resolveApproval(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
resolveApproval(sessionId: string, requestId: string, approvalId: string, status: InternalApprovalRecord["status"]): Promise<InternalApprovalRecord>;
|
|
75
|
+
createRequestArtifact(sessionId: string, requestId: string, artifact: ArtifactRecord, content: unknown): Promise<ArtifactRecord>;
|
|
76
|
+
listRequestArtifacts(sessionId: string, requestId: string): Promise<ArtifactListing>;
|
|
77
|
+
readRequestArtifact(sessionId: string, requestId: string, artifactPath: string): Promise<unknown>;
|
|
78
|
+
appendSessionMessage(sessionId: string, message: TranscriptMessage): Promise<void>;
|
|
79
|
+
listSessionMessages(sessionId: string, limit?: number): Promise<TranscriptMessage[]>;
|
|
80
|
+
saveRequestRecoveryIntent(sessionId: string, requestId: string, intent: RecoveryIntent): Promise<void>;
|
|
81
|
+
getRequestRecoveryIntent(sessionId: string, requestId: string): Promise<RecoveryIntent | null>;
|
|
82
|
+
clearRequestRecoveryIntent(sessionId: string, requestId: string): Promise<void>;
|
|
83
|
+
enqueueRequest(input: {
|
|
84
|
+
sessionId: string;
|
|
85
|
+
requestId: string;
|
|
86
86
|
priority?: number;
|
|
87
87
|
queueKey?: string | null;
|
|
88
88
|
availableAt?: string;
|
|
89
89
|
}): Promise<void>;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
getQueuedRequest(requestId: string): Promise<PersistedRequestQueueRecord | null>;
|
|
91
|
+
claimQueuedRequest(input: {
|
|
92
|
+
sessionId: string;
|
|
93
|
+
requestId: string;
|
|
94
94
|
workerId: string;
|
|
95
95
|
claimedAt?: string;
|
|
96
96
|
leaseExpiresAt: string;
|
|
97
|
-
}): Promise<
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
}): Promise<PersistedRequestQueueRecord>;
|
|
98
|
+
renewRequestLease(input: {
|
|
99
|
+
requestId: string;
|
|
100
100
|
workerId: string;
|
|
101
101
|
heartbeatAt?: string;
|
|
102
102
|
leaseExpiresAt: string;
|
|
103
103
|
}): Promise<void>;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
releaseRequestClaim(requestId: string): Promise<void>;
|
|
105
|
+
listExpiredClaimedRequests(cutoffIso: string): Promise<PersistedRequestQueueRecord[]>;
|
|
106
|
+
getRequestControl(requestId: string): Promise<PersistedRequestControlRecord | null>;
|
|
107
|
+
requestRequestCancel(requestId: string, reason?: string): Promise<PersistedRequestControlRecord>;
|
|
108
|
+
clearRequestCancel(requestId: string): Promise<void>;
|
|
109
109
|
}
|
|
110
110
|
export {};
|