@useorgx/openclaw-plugin 0.4.8 → 0.4.9
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/dashboard/dist/assets/B5NEElEI.css +1 -0
- package/dashboard/dist/assets/BhapSNAs.js +215 -0
- package/dashboard/dist/assets/{BNeJ0kpF.js → iFdvE7lx.js} +1 -1
- package/dashboard/dist/assets/{CUV9IHHi.js → jRJsmpYM.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dist/activity-store.js +4 -18
- package/dist/agent-context-store.js +5 -25
- package/dist/agent-run-store.js +5 -25
- package/dist/agent-suite.js +1 -8
- package/dist/auth/flows.d.ts +47 -0
- package/dist/auth/flows.js +169 -0
- package/dist/auth-store.js +6 -26
- package/dist/byok-store.js +5 -19
- package/dist/cli/orgx.d.ts +66 -0
- package/dist/cli/orgx.js +91 -0
- package/dist/config/refresh.d.ts +32 -0
- package/dist/config/refresh.js +55 -0
- package/dist/config/resolution.d.ts +37 -0
- package/dist/config/resolution.js +178 -0
- package/dist/contracts/shared-types.d.ts +147 -0
- package/dist/contracts/shared-types.js +3 -0
- package/dist/contracts/types.d.ts +1 -134
- package/dist/contracts/types.js +5 -0
- package/dist/entities/auto-assignment.d.ts +36 -0
- package/dist/entities/auto-assignment.js +115 -0
- package/dist/entity-comment-store.js +5 -25
- package/dist/hash-utils.d.ts +2 -0
- package/dist/hash-utils.js +12 -0
- package/dist/http/helpers/activity-headline.d.ts +10 -0
- package/dist/http/helpers/activity-headline.js +192 -0
- package/dist/http/helpers/artifact-fallback.d.ts +13 -0
- package/dist/http/helpers/artifact-fallback.js +148 -0
- package/dist/http/helpers/auto-continue-engine.d.ts +298 -0
- package/dist/http/helpers/auto-continue-engine.js +1218 -0
- package/dist/http/helpers/autopilot-operations.d.ts +157 -0
- package/dist/http/helpers/autopilot-operations.js +403 -0
- package/dist/http/helpers/autopilot-runtime.d.ts +42 -0
- package/dist/http/helpers/autopilot-runtime.js +319 -0
- package/dist/http/helpers/autopilot-slice-utils.d.ts +38 -0
- package/dist/http/helpers/autopilot-slice-utils.js +476 -0
- package/dist/http/helpers/decision-mapper.d.ts +12 -0
- package/dist/http/helpers/decision-mapper.js +44 -0
- package/dist/http/helpers/dispatch-lifecycle.d.ts +102 -0
- package/dist/http/helpers/dispatch-lifecycle.js +604 -0
- package/dist/http/helpers/hash-utils.d.ts +1 -0
- package/dist/http/helpers/hash-utils.js +1 -0
- package/dist/http/helpers/kickoff-context.d.ts +12 -0
- package/dist/http/helpers/kickoff-context.js +154 -0
- package/dist/http/helpers/mission-control.d.ts +94 -0
- package/dist/http/helpers/mission-control.js +894 -0
- package/dist/http/helpers/openclaw-cli.d.ts +37 -0
- package/dist/http/helpers/openclaw-cli.js +283 -0
- package/dist/http/helpers/runtime-sse.d.ts +20 -0
- package/dist/http/helpers/runtime-sse.js +110 -0
- package/dist/http/helpers/value-utils.d.ts +6 -0
- package/dist/http/helpers/value-utils.js +67 -0
- package/dist/http/index.d.ts +88 -0
- package/dist/http/index.js +2353 -0
- package/dist/http/router.d.ts +23 -0
- package/dist/http/router.js +23 -0
- package/dist/http/routes/agent-control.d.ts +79 -0
- package/dist/http/routes/agent-control.js +684 -0
- package/dist/http/routes/agent-suite.d.ts +29 -0
- package/dist/http/routes/agent-suite.js +198 -0
- package/dist/http/routes/agents-catalog.d.ts +40 -0
- package/dist/http/routes/agents-catalog.js +83 -0
- package/dist/http/routes/billing.d.ts +23 -0
- package/dist/http/routes/billing.js +55 -0
- package/dist/http/routes/debug.d.ts +14 -0
- package/dist/http/routes/debug.js +21 -0
- package/dist/http/routes/decision-actions.d.ts +13 -0
- package/dist/http/routes/decision-actions.js +66 -0
- package/dist/http/routes/delegation.d.ts +19 -0
- package/dist/http/routes/delegation.js +32 -0
- package/dist/http/routes/entities.d.ts +47 -0
- package/dist/http/routes/entities.js +152 -0
- package/dist/http/routes/entity-dynamic.d.ts +25 -0
- package/dist/http/routes/entity-dynamic.js +191 -0
- package/dist/http/routes/health.d.ts +22 -0
- package/dist/http/routes/health.js +49 -0
- package/dist/http/routes/live-legacy.d.ts +110 -0
- package/dist/http/routes/live-legacy.js +598 -0
- package/dist/http/routes/live-misc.d.ts +69 -0
- package/dist/http/routes/live-misc.js +206 -0
- package/dist/http/routes/live-snapshot.d.ts +90 -0
- package/dist/http/routes/live-snapshot.js +297 -0
- package/dist/http/routes/mission-control-actions.d.ts +83 -0
- package/dist/http/routes/mission-control-actions.js +541 -0
- package/dist/http/routes/mission-control-read.d.ts +28 -0
- package/dist/http/routes/mission-control-read.js +67 -0
- package/dist/http/routes/onboarding.d.ts +34 -0
- package/dist/http/routes/onboarding.js +101 -0
- package/dist/http/routes/run-control.d.ts +24 -0
- package/dist/http/routes/run-control.js +86 -0
- package/dist/http/routes/runtime-hooks.d.ts +69 -0
- package/dist/http/routes/runtime-hooks.js +437 -0
- package/dist/http/routes/settings-byok.d.ts +23 -0
- package/dist/http/routes/settings-byok.js +163 -0
- package/dist/http/routes/summary.d.ts +18 -0
- package/dist/http/routes/summary.js +42 -0
- package/dist/http/routes/work-artifacts.d.ts +9 -0
- package/dist/http/routes/work-artifacts.js +36 -0
- package/dist/http/shared-state.d.ts +16 -0
- package/dist/http/shared-state.js +1 -0
- package/dist/http-handler.d.ts +1 -88
- package/dist/http-handler.js +1 -10605
- package/dist/index.js +108 -2243
- package/dist/json-utils.d.ts +1 -0
- package/dist/json-utils.js +8 -0
- package/dist/next-up-queue-store.js +4 -18
- package/dist/runtime-instance-store.js +5 -31
- package/dist/services/background.d.ts +23 -0
- package/dist/services/background.js +23 -0
- package/dist/services/instrumentation.d.ts +29 -0
- package/dist/services/instrumentation.js +136 -0
- package/dist/snapshot-store.js +5 -25
- package/dist/stores/json-store.d.ts +11 -0
- package/dist/stores/json-store.js +42 -0
- package/dist/sync/outbox-replay.d.ts +55 -0
- package/dist/sync/outbox-replay.js +514 -0
- package/dist/tools/core-tools.d.ts +76 -0
- package/dist/tools/core-tools.js +1005 -0
- package/package.json +1 -1
- package/dashboard/dist/assets/BzkiMPmM.js +0 -215
- package/dashboard/dist/assets/Ie7d9Iq2.css +0 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
function asRecord(value) {
|
|
2
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
3
|
+
return null;
|
|
4
|
+
return value;
|
|
5
|
+
}
|
|
6
|
+
function flattenActivityMetadata(value) {
|
|
7
|
+
const record = asRecord(value);
|
|
8
|
+
if (!record)
|
|
9
|
+
return null;
|
|
10
|
+
const nested = asRecord(record.metadata);
|
|
11
|
+
if (!nested)
|
|
12
|
+
return record;
|
|
13
|
+
return { ...record, ...nested };
|
|
14
|
+
}
|
|
15
|
+
function metadataString(metadata, keys) {
|
|
16
|
+
if (!metadata)
|
|
17
|
+
return null;
|
|
18
|
+
for (const key of keys) {
|
|
19
|
+
const value = metadata[key];
|
|
20
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
21
|
+
return value.trim();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
function metadataNumber(metadata, keys) {
|
|
27
|
+
if (!metadata)
|
|
28
|
+
return null;
|
|
29
|
+
for (const key of keys) {
|
|
30
|
+
const value = metadata[key];
|
|
31
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
32
|
+
return value;
|
|
33
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
34
|
+
const parsed = Number(value.trim());
|
|
35
|
+
if (Number.isFinite(parsed))
|
|
36
|
+
return parsed;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
function resolveArtifactIdFromActivityItem(item) {
|
|
42
|
+
const metadata = flattenActivityMetadata(item.metadata);
|
|
43
|
+
if (!metadata)
|
|
44
|
+
return null;
|
|
45
|
+
const rawId = metadataString(metadata, ["artifact_id", "artifactId", "work_artifact_id"]);
|
|
46
|
+
return rawId && rawId.length > 0 ? rawId : null;
|
|
47
|
+
}
|
|
48
|
+
function resolveArtifactHref(value) {
|
|
49
|
+
if (!value)
|
|
50
|
+
return null;
|
|
51
|
+
const trimmed = value.trim();
|
|
52
|
+
if (!trimmed)
|
|
53
|
+
return null;
|
|
54
|
+
if (/^https?:\/\//i.test(trimmed))
|
|
55
|
+
return trimmed;
|
|
56
|
+
return `/orgx/api/live/filesystem/open?path=${encodeURIComponent(trimmed)}`;
|
|
57
|
+
}
|
|
58
|
+
export function createLocalArtifactDetailFallbackBuilder(deps) {
|
|
59
|
+
return (artifactId, warning) => {
|
|
60
|
+
let cursor = null;
|
|
61
|
+
const maxPages = 8;
|
|
62
|
+
for (let pageIndex = 0; pageIndex < maxPages; pageIndex += 1) {
|
|
63
|
+
const page = deps.listActivityPage({ limit: 500, cursor });
|
|
64
|
+
const activities = Array.isArray(page.activities) ? page.activities : [];
|
|
65
|
+
for (const item of activities) {
|
|
66
|
+
const matchId = resolveArtifactIdFromActivityItem(item);
|
|
67
|
+
if (!matchId || matchId !== artifactId)
|
|
68
|
+
continue;
|
|
69
|
+
const metadata = flattenActivityMetadata(item.metadata) ?? {};
|
|
70
|
+
const rawPath = metadataString(metadata, [
|
|
71
|
+
"url",
|
|
72
|
+
"path",
|
|
73
|
+
"file_path",
|
|
74
|
+
"filepath",
|
|
75
|
+
"artifact_path",
|
|
76
|
+
"output_path",
|
|
77
|
+
"external_url",
|
|
78
|
+
"artifact_url",
|
|
79
|
+
]) ?? null;
|
|
80
|
+
const artifactHref = resolveArtifactHref(rawPath);
|
|
81
|
+
const artifactType = metadataString(metadata, ["artifact_type", "artifactType", "type"]) ?? "report";
|
|
82
|
+
const artifactName = metadataString(metadata, ["artifact_name", "artifactName", "name", "title"]) ??
|
|
83
|
+
item.title?.trim() ??
|
|
84
|
+
`Artifact ${artifactId.slice(0, 8)}`;
|
|
85
|
+
const status = metadataString(metadata, ["artifact_status", "status", "state"]) ??
|
|
86
|
+
(typeof metadata.event === "string" && metadata.event.includes("buffered")
|
|
87
|
+
? "buffered"
|
|
88
|
+
: "draft");
|
|
89
|
+
const entityType = metadataString(metadata, ["entity_type", "entityType"]) ??
|
|
90
|
+
(metadataString(metadata, ["initiative_id", "initiativeId"])
|
|
91
|
+
? "initiative"
|
|
92
|
+
: "task");
|
|
93
|
+
const entityId = metadataString(metadata, [
|
|
94
|
+
"entity_id",
|
|
95
|
+
"entityId",
|
|
96
|
+
"task_id",
|
|
97
|
+
"taskId",
|
|
98
|
+
"workstream_id",
|
|
99
|
+
"workstreamId",
|
|
100
|
+
"initiative_id",
|
|
101
|
+
"initiativeId",
|
|
102
|
+
"run_id",
|
|
103
|
+
"runId",
|
|
104
|
+
]) ?? "local";
|
|
105
|
+
const description = metadataString(metadata, ["description", "summary", "message"]) ??
|
|
106
|
+
item.summary ??
|
|
107
|
+
item.description ??
|
|
108
|
+
null;
|
|
109
|
+
const version = Math.max(1, Math.round(metadataNumber(metadata, ["version", "artifact_version"]) ?? 1));
|
|
110
|
+
const createdAt = item.timestamp ?? new Date().toISOString();
|
|
111
|
+
const updatedAt = item.timestamp ?? createdAt;
|
|
112
|
+
return {
|
|
113
|
+
artifact: {
|
|
114
|
+
id: artifactId,
|
|
115
|
+
name: artifactName,
|
|
116
|
+
description,
|
|
117
|
+
artifact_url: artifactHref ?? "",
|
|
118
|
+
artifact_type: artifactType,
|
|
119
|
+
status,
|
|
120
|
+
version,
|
|
121
|
+
entity_type: entityType,
|
|
122
|
+
entity_id: entityId,
|
|
123
|
+
metadata: {
|
|
124
|
+
...metadata,
|
|
125
|
+
local_fallback: true,
|
|
126
|
+
local_warning: warning,
|
|
127
|
+
local_activity_event_id: item.id,
|
|
128
|
+
local_activity_type: item.type,
|
|
129
|
+
local_activity_timestamp: item.timestamp,
|
|
130
|
+
local_source_path: rawPath,
|
|
131
|
+
},
|
|
132
|
+
created_at: createdAt,
|
|
133
|
+
updated_at: updatedAt,
|
|
134
|
+
catalog: null,
|
|
135
|
+
cached_metadata: null,
|
|
136
|
+
},
|
|
137
|
+
relationships: [],
|
|
138
|
+
localFallback: true,
|
|
139
|
+
warning,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
if (!page.nextCursor)
|
|
143
|
+
break;
|
|
144
|
+
cursor = page.nextCursor;
|
|
145
|
+
}
|
|
146
|
+
return null;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import type { OrgXClient } from "../../api.js";
|
|
2
|
+
import { type RuntimeHookPayload, type RuntimeInstanceRecord, type RuntimeSourceClient } from "../../runtime-instance-store.js";
|
|
3
|
+
import { type MissionControlNode } from "./mission-control.js";
|
|
4
|
+
export interface CreateAutoContinueEngineDeps {
|
|
5
|
+
client: OrgXClient;
|
|
6
|
+
filename: string;
|
|
7
|
+
safeErrorMessage: (err: unknown) => string;
|
|
8
|
+
pidAlive: (pid: number) => boolean;
|
|
9
|
+
stopProcess: (pid: number) => Promise<{
|
|
10
|
+
stopped: boolean;
|
|
11
|
+
wasRunning: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
resolveOrgxAgentForDomain: (domain: string) => {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
checkSpawnGuardSafe: (input: {
|
|
18
|
+
domain: string;
|
|
19
|
+
taskId?: string | null;
|
|
20
|
+
initiativeId: string | null;
|
|
21
|
+
correlationId: string;
|
|
22
|
+
runId?: string | null;
|
|
23
|
+
targetLabel?: string | null;
|
|
24
|
+
}) => Promise<unknown | null>;
|
|
25
|
+
syncParentRollupsForTask: (input: {
|
|
26
|
+
initiativeId: string | null;
|
|
27
|
+
taskId: string | null;
|
|
28
|
+
workstreamId?: string | null;
|
|
29
|
+
milestoneId?: string | null;
|
|
30
|
+
correlationId?: string | null;
|
|
31
|
+
}) => Promise<void>;
|
|
32
|
+
emitActivitySafe: (input: {
|
|
33
|
+
initiativeId: string | null;
|
|
34
|
+
runId?: string | null;
|
|
35
|
+
correlationId?: string | null;
|
|
36
|
+
phase: "intent" | "execution" | "blocked" | "review" | "handoff" | "completed";
|
|
37
|
+
level?: "info" | "warn" | "error";
|
|
38
|
+
message: string;
|
|
39
|
+
progressPct?: number;
|
|
40
|
+
nextStep?: string;
|
|
41
|
+
metadata?: Record<string, unknown>;
|
|
42
|
+
}) => Promise<void>;
|
|
43
|
+
requestDecisionSafe: (input: {
|
|
44
|
+
initiativeId: string | null;
|
|
45
|
+
correlationId?: string | null;
|
|
46
|
+
title: string;
|
|
47
|
+
summary?: string | null;
|
|
48
|
+
urgency?: "low" | "medium" | "high" | "urgent";
|
|
49
|
+
options?: string[];
|
|
50
|
+
blocking?: boolean;
|
|
51
|
+
}) => Promise<void>;
|
|
52
|
+
registerArtifactSafe: (input: {
|
|
53
|
+
initiativeId: string;
|
|
54
|
+
runId: string;
|
|
55
|
+
agentId: string;
|
|
56
|
+
agentName?: string | null;
|
|
57
|
+
workstreamId: string;
|
|
58
|
+
artifact: {
|
|
59
|
+
name: string;
|
|
60
|
+
artifact_type?: string | null;
|
|
61
|
+
description?: string | null;
|
|
62
|
+
url?: string | null;
|
|
63
|
+
milestone_id?: string | null;
|
|
64
|
+
task_ids?: string[] | null;
|
|
65
|
+
};
|
|
66
|
+
}) => Promise<{
|
|
67
|
+
ok: boolean;
|
|
68
|
+
id: string | null;
|
|
69
|
+
}>;
|
|
70
|
+
applyAgentStatusUpdatesSafe: (input: {
|
|
71
|
+
initiativeId: string;
|
|
72
|
+
runId: string;
|
|
73
|
+
correlationId: string;
|
|
74
|
+
taskUpdates: Array<{
|
|
75
|
+
task_id: string;
|
|
76
|
+
status: string;
|
|
77
|
+
reason?: string | null;
|
|
78
|
+
}>;
|
|
79
|
+
milestoneUpdates: Array<{
|
|
80
|
+
milestone_id: string;
|
|
81
|
+
status: string;
|
|
82
|
+
reason?: string | null;
|
|
83
|
+
}>;
|
|
84
|
+
}) => Promise<{
|
|
85
|
+
applied: number;
|
|
86
|
+
buffered: boolean;
|
|
87
|
+
}>;
|
|
88
|
+
upsertRuntimeInstanceFromHook: (payload: RuntimeHookPayload) => RuntimeInstanceRecord;
|
|
89
|
+
broadcastRuntimeSse: (event: string, payload: RuntimeInstanceRecord) => void;
|
|
90
|
+
clearSnapshotResponseCache: () => void;
|
|
91
|
+
resolveByokEnvOverrides: () => Record<string, string | undefined>;
|
|
92
|
+
randomUUID?: () => string;
|
|
93
|
+
}
|
|
94
|
+
export declare function createAutoContinueEngine(deps: CreateAutoContinueEngineDeps): {
|
|
95
|
+
autoContinueRuns: Map<string, {
|
|
96
|
+
initiativeId: string;
|
|
97
|
+
agentId: string;
|
|
98
|
+
agentName: string | null;
|
|
99
|
+
includeVerification: boolean;
|
|
100
|
+
allowedWorkstreamIds: string[] | null;
|
|
101
|
+
stopAfterSlice: boolean;
|
|
102
|
+
tokenBudget: number;
|
|
103
|
+
tokensUsed: number;
|
|
104
|
+
status: "stopped" | "running" | "stopping";
|
|
105
|
+
stopReason: ("error" | "blocked" | "completed" | "stopped" | "budget_exhausted") | null;
|
|
106
|
+
stopRequested: boolean;
|
|
107
|
+
startedAt: string;
|
|
108
|
+
stoppedAt: string | null;
|
|
109
|
+
updatedAt: string;
|
|
110
|
+
lastError: string | null;
|
|
111
|
+
lastTaskId: string | null;
|
|
112
|
+
lastRunId: string | null;
|
|
113
|
+
activeTaskId: string | null;
|
|
114
|
+
activeRunId: string | null;
|
|
115
|
+
activeTaskTokenEstimate: number | null;
|
|
116
|
+
}>;
|
|
117
|
+
autoContinueSliceRuns: Map<string, {
|
|
118
|
+
runId: string;
|
|
119
|
+
initiativeId: string;
|
|
120
|
+
initiativeTitle: string | null;
|
|
121
|
+
workstreamId: string;
|
|
122
|
+
workstreamTitle: string | null;
|
|
123
|
+
agentId: string;
|
|
124
|
+
agentName: string | null;
|
|
125
|
+
domain: string;
|
|
126
|
+
requiredSkills: string[];
|
|
127
|
+
sourceClient: RuntimeSourceClient;
|
|
128
|
+
pid: number | null;
|
|
129
|
+
status: "error" | "blocked" | "completed" | "running";
|
|
130
|
+
startedAt: string;
|
|
131
|
+
finishedAt: string | null;
|
|
132
|
+
updatedAt: string;
|
|
133
|
+
tokenEstimate: number | null;
|
|
134
|
+
outputPath: string;
|
|
135
|
+
logPath: string;
|
|
136
|
+
taskIds: string[];
|
|
137
|
+
milestoneIds: string[];
|
|
138
|
+
lastError: string | null;
|
|
139
|
+
}>;
|
|
140
|
+
localInitiativeStatusOverrides: Map<string, {
|
|
141
|
+
status: string;
|
|
142
|
+
updatedAt: string;
|
|
143
|
+
}>;
|
|
144
|
+
writeRuntimeEvent: (input: {
|
|
145
|
+
sourceClient: RuntimeSourceClient;
|
|
146
|
+
event: RuntimeHookPayload["event"];
|
|
147
|
+
runId: string;
|
|
148
|
+
initiativeId: string;
|
|
149
|
+
workstreamId: string | null;
|
|
150
|
+
taskId: string | null;
|
|
151
|
+
agentId: string | null;
|
|
152
|
+
agentName: string | null;
|
|
153
|
+
phase: string | null;
|
|
154
|
+
message?: string | null;
|
|
155
|
+
progressPct?: number | null;
|
|
156
|
+
metadata?: Record<string, unknown> | null;
|
|
157
|
+
timestamp?: string | null;
|
|
158
|
+
}) => RuntimeInstanceRecord;
|
|
159
|
+
autoContinueTickMs: number;
|
|
160
|
+
defaultAutoContinueTokenBudget: () => number;
|
|
161
|
+
setLocalInitiativeStatusOverride: (initiativeId: string, status: string) => void;
|
|
162
|
+
clearLocalInitiativeStatusOverride: (initiativeId: string) => void;
|
|
163
|
+
applyLocalInitiativeOverrides: (rows: Record<string, unknown>[]) => Record<string, unknown>[];
|
|
164
|
+
applyLocalInitiativeOverrideToGraph: <T extends {
|
|
165
|
+
initiative: {
|
|
166
|
+
id: string;
|
|
167
|
+
status: string;
|
|
168
|
+
};
|
|
169
|
+
nodes: MissionControlNode[];
|
|
170
|
+
}>(graph: T) => T;
|
|
171
|
+
updateInitiativeAutoContinueState: (input: {
|
|
172
|
+
initiativeId: string;
|
|
173
|
+
run: {
|
|
174
|
+
initiativeId: string;
|
|
175
|
+
agentId: string;
|
|
176
|
+
agentName: string | null;
|
|
177
|
+
includeVerification: boolean;
|
|
178
|
+
allowedWorkstreamIds: string[] | null;
|
|
179
|
+
stopAfterSlice: boolean;
|
|
180
|
+
tokenBudget: number;
|
|
181
|
+
tokensUsed: number;
|
|
182
|
+
status: "stopped" | "running" | "stopping";
|
|
183
|
+
stopReason: ("error" | "blocked" | "completed" | "stopped" | "budget_exhausted") | null;
|
|
184
|
+
stopRequested: boolean;
|
|
185
|
+
startedAt: string;
|
|
186
|
+
stoppedAt: string | null;
|
|
187
|
+
updatedAt: string;
|
|
188
|
+
lastError: string | null;
|
|
189
|
+
lastTaskId: string | null;
|
|
190
|
+
lastRunId: string | null;
|
|
191
|
+
activeTaskId: string | null;
|
|
192
|
+
activeRunId: string | null;
|
|
193
|
+
activeTaskTokenEstimate: number | null;
|
|
194
|
+
};
|
|
195
|
+
}) => Promise<void>;
|
|
196
|
+
stopAutoContinueRun: (input: {
|
|
197
|
+
run: {
|
|
198
|
+
initiativeId: string;
|
|
199
|
+
agentId: string;
|
|
200
|
+
agentName: string | null;
|
|
201
|
+
includeVerification: boolean;
|
|
202
|
+
allowedWorkstreamIds: string[] | null;
|
|
203
|
+
stopAfterSlice: boolean;
|
|
204
|
+
tokenBudget: number;
|
|
205
|
+
tokensUsed: number;
|
|
206
|
+
status: "stopped" | "running" | "stopping";
|
|
207
|
+
stopReason: ("error" | "blocked" | "completed" | "stopped" | "budget_exhausted") | null;
|
|
208
|
+
stopRequested: boolean;
|
|
209
|
+
startedAt: string;
|
|
210
|
+
stoppedAt: string | null;
|
|
211
|
+
updatedAt: string;
|
|
212
|
+
lastError: string | null;
|
|
213
|
+
lastTaskId: string | null;
|
|
214
|
+
lastRunId: string | null;
|
|
215
|
+
activeTaskId: string | null;
|
|
216
|
+
activeRunId: string | null;
|
|
217
|
+
activeTaskTokenEstimate: number | null;
|
|
218
|
+
};
|
|
219
|
+
reason: "error" | "blocked" | "completed" | "stopped" | "budget_exhausted";
|
|
220
|
+
error?: string | null;
|
|
221
|
+
}) => Promise<void>;
|
|
222
|
+
tickAutoContinueRun: (run: {
|
|
223
|
+
initiativeId: string;
|
|
224
|
+
agentId: string;
|
|
225
|
+
agentName: string | null;
|
|
226
|
+
includeVerification: boolean;
|
|
227
|
+
allowedWorkstreamIds: string[] | null;
|
|
228
|
+
stopAfterSlice: boolean;
|
|
229
|
+
tokenBudget: number;
|
|
230
|
+
tokensUsed: number;
|
|
231
|
+
status: "stopped" | "running" | "stopping";
|
|
232
|
+
stopReason: ("error" | "blocked" | "completed" | "stopped" | "budget_exhausted") | null;
|
|
233
|
+
stopRequested: boolean;
|
|
234
|
+
startedAt: string;
|
|
235
|
+
stoppedAt: string | null;
|
|
236
|
+
updatedAt: string;
|
|
237
|
+
lastError: string | null;
|
|
238
|
+
lastTaskId: string | null;
|
|
239
|
+
lastRunId: string | null;
|
|
240
|
+
activeTaskId: string | null;
|
|
241
|
+
activeRunId: string | null;
|
|
242
|
+
activeTaskTokenEstimate: number | null;
|
|
243
|
+
}) => Promise<void>;
|
|
244
|
+
tickAllAutoContinue: () => Promise<void>;
|
|
245
|
+
isInitiativeActiveStatus: (status: string | null | undefined) => boolean;
|
|
246
|
+
runningAutoContinueForWorkstream: (initiativeId: string, workstreamId: string) => {
|
|
247
|
+
initiativeId: string;
|
|
248
|
+
agentId: string;
|
|
249
|
+
agentName: string | null;
|
|
250
|
+
includeVerification: boolean;
|
|
251
|
+
allowedWorkstreamIds: string[] | null;
|
|
252
|
+
stopAfterSlice: boolean;
|
|
253
|
+
tokenBudget: number;
|
|
254
|
+
tokensUsed: number;
|
|
255
|
+
status: "stopped" | "running" | "stopping";
|
|
256
|
+
stopReason: ("error" | "blocked" | "completed" | "stopped" | "budget_exhausted") | null;
|
|
257
|
+
stopRequested: boolean;
|
|
258
|
+
startedAt: string;
|
|
259
|
+
stoppedAt: string | null;
|
|
260
|
+
updatedAt: string;
|
|
261
|
+
lastError: string | null;
|
|
262
|
+
lastTaskId: string | null;
|
|
263
|
+
lastRunId: string | null;
|
|
264
|
+
activeTaskId: string | null;
|
|
265
|
+
activeRunId: string | null;
|
|
266
|
+
activeTaskTokenEstimate: number | null;
|
|
267
|
+
} | null;
|
|
268
|
+
startAutoContinueRun: (input: {
|
|
269
|
+
initiativeId: string;
|
|
270
|
+
agentId: string;
|
|
271
|
+
agentName?: string | null;
|
|
272
|
+
tokenBudget: unknown;
|
|
273
|
+
includeVerification: boolean;
|
|
274
|
+
allowedWorkstreamIds: string[] | null;
|
|
275
|
+
stopAfterSlice?: boolean;
|
|
276
|
+
}) => Promise<{
|
|
277
|
+
initiativeId: string;
|
|
278
|
+
agentId: string;
|
|
279
|
+
agentName: string | null;
|
|
280
|
+
includeVerification: boolean;
|
|
281
|
+
allowedWorkstreamIds: string[] | null;
|
|
282
|
+
stopAfterSlice: boolean;
|
|
283
|
+
tokenBudget: number;
|
|
284
|
+
tokensUsed: number;
|
|
285
|
+
status: "stopped" | "running" | "stopping";
|
|
286
|
+
stopReason: ("error" | "blocked" | "completed" | "stopped" | "budget_exhausted") | null;
|
|
287
|
+
stopRequested: boolean;
|
|
288
|
+
startedAt: string;
|
|
289
|
+
stoppedAt: string | null;
|
|
290
|
+
updatedAt: string;
|
|
291
|
+
lastError: string | null;
|
|
292
|
+
lastTaskId: string | null;
|
|
293
|
+
lastRunId: string | null;
|
|
294
|
+
activeTaskId: string | null;
|
|
295
|
+
activeRunId: string | null;
|
|
296
|
+
activeTaskTokenEstimate: number | null;
|
|
297
|
+
}>;
|
|
298
|
+
};
|