@sift-wiki/conductor 0.0.0 → 0.2.0-beta.1
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 +105 -1
- package/THIRD_PARTY_NOTICES.md +38 -0
- package/dist/adapters/claudeAgent.d.ts +23 -0
- package/dist/adapters/claudeAgent.js +164 -0
- package/dist/adapters/claudeAgent.js.map +1 -0
- package/dist/adapters/claudeParser.d.ts +5 -0
- package/dist/adapters/claudeParser.js +120 -0
- package/dist/adapters/claudeParser.js.map +1 -0
- package/dist/adapters/codexAgent.d.ts +28 -0
- package/dist/adapters/codexAgent.js +152 -0
- package/dist/adapters/codexAgent.js.map +1 -0
- package/dist/adapters/codexParser.d.ts +5 -0
- package/dist/adapters/codexParser.js +106 -0
- package/dist/adapters/codexParser.js.map +1 -0
- package/dist/adapters/config.d.ts +29 -0
- package/dist/adapters/config.js +286 -0
- package/dist/adapters/config.js.map +1 -0
- package/dist/adapters/doctor.d.ts +12 -0
- package/dist/adapters/doctor.js +20 -0
- package/dist/adapters/doctor.js.map +1 -0
- package/dist/adapters/errors.d.ts +7 -0
- package/dist/adapters/errors.js +19 -0
- package/dist/adapters/errors.js.map +1 -0
- package/dist/adapters/fakeAgent.d.ts +11 -0
- package/dist/adapters/fakeAgent.js +149 -0
- package/dist/adapters/fakeAgent.js.map +1 -0
- package/dist/adapters/httpAgent.d.ts +19 -0
- package/dist/adapters/httpAgent.js +164 -0
- package/dist/adapters/httpAgent.js.map +1 -0
- package/dist/adapters/output.d.ts +16 -0
- package/dist/adapters/output.js +48 -0
- package/dist/adapters/output.js.map +1 -0
- package/dist/adapters/processAgent.d.ts +21 -0
- package/dist/adapters/processAgent.js +166 -0
- package/dist/adapters/processAgent.js.map +1 -0
- package/dist/adapters/provider/discovery.d.ts +31 -0
- package/dist/adapters/provider/discovery.js +102 -0
- package/dist/adapters/provider/discovery.js.map +1 -0
- package/dist/adapters/provider/json.d.ts +4 -0
- package/dist/adapters/provider/json.js +21 -0
- package/dist/adapters/provider/json.js.map +1 -0
- package/dist/adapters/provider/lineStream.d.ts +8 -0
- package/dist/adapters/provider/lineStream.js +28 -0
- package/dist/adapters/provider/lineStream.js.map +1 -0
- package/dist/adapters/provider/outputSchemaFile.d.ts +5 -0
- package/dist/adapters/provider/outputSchemaFile.js +16 -0
- package/dist/adapters/provider/outputSchemaFile.js.map +1 -0
- package/dist/adapters/provider/prompt.d.ts +2 -0
- package/dist/adapters/provider/prompt.js +52 -0
- package/dist/adapters/provider/prompt.js.map +1 -0
- package/dist/adapters/provider/result.d.ts +23 -0
- package/dist/adapters/provider/result.js +116 -0
- package/dist/adapters/provider/result.js.map +1 -0
- package/dist/adapters/provider/runProvider.d.ts +16 -0
- package/dist/adapters/provider/runProvider.js +110 -0
- package/dist/adapters/provider/runProvider.js.map +1 -0
- package/dist/adapters/provider/setup.d.ts +50 -0
- package/dist/adapters/provider/setup.js +180 -0
- package/dist/adapters/provider/setup.js.map +1 -0
- package/dist/adapters/provider/store.d.ts +19 -0
- package/dist/adapters/provider/store.js +92 -0
- package/dist/adapters/provider/store.js.map +1 -0
- package/dist/adapters/provider/types.d.ts +58 -0
- package/dist/adapters/provider/types.js +2 -0
- package/dist/adapters/provider/types.js.map +1 -0
- package/dist/adapters/provider/version.d.ts +2 -0
- package/dist/adapters/provider/version.js +25 -0
- package/dist/adapters/provider/version.js.map +1 -0
- package/dist/adapters/types.d.ts +40 -0
- package/dist/adapters/types.js +2 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/bridge/handler.d.ts +15 -0
- package/dist/bridge/handler.js +125 -0
- package/dist/bridge/handler.js.map +1 -0
- package/dist/bridge/localBridge.d.ts +49 -0
- package/dist/bridge/localBridge.js +157 -0
- package/dist/bridge/localBridge.js.map +1 -0
- package/dist/bridge/server.d.ts +11 -0
- package/dist/bridge/server.js +86 -0
- package/dist/bridge/server.js.map +1 -0
- package/dist/bridge/sessionRegistry.d.ts +23 -0
- package/dist/bridge/sessionRegistry.js +65 -0
- package/dist/bridge/sessionRegistry.js.map +1 -0
- package/dist/cli.d.ts +23 -0
- package/dist/cli.js +245 -0
- package/dist/cli.js.map +1 -0
- package/dist/conductorClient.d.ts +443 -0
- package/dist/conductorClient.js +281 -0
- package/dist/conductorClient.js.map +1 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.js +54 -0
- package/dist/config.js.map +1 -0
- package/dist/daemon.d.ts +52 -0
- package/dist/daemon.js +324 -0
- package/dist/daemon.js.map +1 -0
- package/dist/desktop/adapterSetupView.d.ts +16 -0
- package/dist/desktop/adapterSetupView.js +13 -0
- package/dist/desktop/adapterSetupView.js.map +1 -0
- package/dist/desktop/app/contracts.d.ts +71 -0
- package/dist/desktop/app/contracts.js +19 -0
- package/dist/desktop/app/contracts.js.map +1 -0
- package/dist/desktop/app/controller.d.ts +58 -0
- package/dist/desktop/app/controller.js +161 -0
- package/dist/desktop/app/controller.js.map +1 -0
- package/dist/desktop/app/runtimeController.d.ts +22 -0
- package/dist/desktop/app/runtimeController.js +44 -0
- package/dist/desktop/app/runtimeController.js.map +1 -0
- package/dist/desktop/manifest.d.ts +17 -0
- package/dist/desktop/manifest.js +24 -0
- package/dist/desktop/manifest.js.map +1 -0
- package/dist/desktop/pairing.d.ts +13 -0
- package/dist/desktop/pairing.js +20 -0
- package/dist/desktop/pairing.js.map +1 -0
- package/dist/desktop/recovery.d.ts +33 -0
- package/dist/desktop/recovery.js +71 -0
- package/dist/desktop/recovery.js.map +1 -0
- package/dist/desktop/workBoardView.d.ts +41 -0
- package/dist/desktop/workBoardView.js +133 -0
- package/dist/desktop/workBoardView.js.map +1 -0
- package/dist/desktop/workGovernanceView.d.ts +70 -0
- package/dist/desktop/workGovernanceView.js +159 -0
- package/dist/desktop/workGovernanceView.js.map +1 -0
- package/dist/localApi/authorizedPairing.d.ts +12 -0
- package/dist/localApi/authorizedPairing.js +18 -0
- package/dist/localApi/authorizedPairing.js.map +1 -0
- package/dist/localApi/contracts.d.ts +253 -0
- package/dist/localApi/contracts.js +173 -0
- package/dist/localApi/contracts.js.map +1 -0
- package/dist/localApi/server.d.ts +20 -0
- package/dist/localApi/server.js +412 -0
- package/dist/localApi/server.js.map +1 -0
- package/dist/localApi/workConsole.d.ts +74 -0
- package/dist/localApi/workConsole.js +342 -0
- package/dist/localApi/workConsole.js.map +1 -0
- package/dist/localApi/workContracts.d.ts +213 -0
- package/dist/localApi/workContracts.js +130 -0
- package/dist/localApi/workContracts.js.map +1 -0
- package/dist/localApp/platform.d.ts +2 -0
- package/dist/localApp/platform.js +57 -0
- package/dist/localApp/platform.js.map +1 -0
- package/dist/localApp/service.d.ts +25 -0
- package/dist/localApp/service.js +114 -0
- package/dist/localApp/service.js.map +1 -0
- package/dist/pairing.d.ts +27 -0
- package/dist/pairing.js +45 -0
- package/dist/pairing.js.map +1 -0
- package/dist/redaction.d.ts +2 -0
- package/dist/redaction.js +34 -0
- package/dist/redaction.js.map +1 -0
- package/dist/release/validateDistribution.d.ts +51 -0
- package/dist/release/validateDistribution.js +54 -0
- package/dist/release/validateDistribution.js.map +1 -0
- package/dist/runtime/localLogSpool.d.ts +47 -0
- package/dist/runtime/localLogSpool.js +105 -0
- package/dist/runtime/localLogSpool.js.map +1 -0
- package/dist/runtime/localRunQueue.d.ts +31 -0
- package/dist/runtime/localRunQueue.js +76 -0
- package/dist/runtime/localRunQueue.js.map +1 -0
- package/dist/runtime/localSessionCache.d.ts +26 -0
- package/dist/runtime/localSessionCache.js +35 -0
- package/dist/runtime/localSessionCache.js.map +1 -0
- package/dist/runtime/process.d.ts +27 -0
- package/dist/runtime/process.js +128 -0
- package/dist/runtime/process.js.map +1 -0
- package/dist/runtime/runEnvironment.d.ts +12 -0
- package/dist/runtime/runEnvironment.js +59 -0
- package/dist/runtime/runEnvironment.js.map +1 -0
- package/dist/runtime/runEventRetryBuffer.d.ts +42 -0
- package/dist/runtime/runEventRetryBuffer.js +118 -0
- package/dist/runtime/runEventRetryBuffer.js.map +1 -0
- package/dist/runtime/runtimeService.d.ts +27 -0
- package/dist/runtime/runtimeService.js +112 -0
- package/dist/runtime/runtimeService.js.map +1 -0
- package/dist/runtime/sleep.d.ts +2 -0
- package/dist/runtime/sleep.js +21 -0
- package/dist/runtime/sleep.js.map +1 -0
- package/dist/runtime/taskExecution.d.ts +16 -0
- package/dist/runtime/taskExecution.js +74 -0
- package/dist/runtime/taskExecution.js.map +1 -0
- package/dist/runtime/wakeEnvelope.d.ts +76 -0
- package/dist/runtime/wakeEnvelope.js +60 -0
- package/dist/runtime/wakeEnvelope.js.map +1 -0
- package/dist/types.d.ts +121 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/userAuth/service.d.ts +26 -0
- package/dist/userAuth/service.js +170 -0
- package/dist/userAuth/service.js.map +1 -0
- package/dist/userAuth/store.d.ts +42 -0
- package/dist/userAuth/store.js +160 -0
- package/dist/userAuth/store.js.map +1 -0
- package/dist/userAuth/types.d.ts +63 -0
- package/dist/userAuth/types.js +29 -0
- package/dist/userAuth/types.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/dist/workTypes.d.ts +313 -0
- package/dist/workTypes.js +106 -0
- package/dist/workTypes.js.map +1 -0
- package/dist-web/assets/index-CWfnzdLn.css +1 -0
- package/dist-web/assets/index-D5X9InfE.js +72 -0
- package/dist-web/index.html +15 -0
- package/docs/provider-setup.md +81 -0
- package/docs/quickstart.md +62 -0
- package/docs/troubleshooting.md +63 -0
- package/package.json +75 -6
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { AdapterDoctorEntry } from "../adapters/doctor.js";
|
|
2
|
+
import type { LocalRuntimeSession } from "../runtime/localSessionCache.js";
|
|
3
|
+
import type { RuntimeServiceStatus } from "../runtime/runtimeService.js";
|
|
4
|
+
import type { ClaimedJob, RunEvent } from "../types.js";
|
|
5
|
+
import type { WorkActivity, WorkApproval, WorkArtifact, WorkPolicy, WorkRoutine } from "../workTypes.js";
|
|
6
|
+
export type WorkGovernanceView = {
|
|
7
|
+
approvals: Array<{
|
|
8
|
+
id: string;
|
|
9
|
+
taskId: string;
|
|
10
|
+
label: string;
|
|
11
|
+
stateLabel: string;
|
|
12
|
+
decisionNote?: string | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
routines: Array<{
|
|
15
|
+
id: string;
|
|
16
|
+
title: string;
|
|
17
|
+
stateLabel: string;
|
|
18
|
+
scheduleLabel: string;
|
|
19
|
+
nextRunAt: string;
|
|
20
|
+
}>;
|
|
21
|
+
policies: Array<{
|
|
22
|
+
id: string;
|
|
23
|
+
scopeLabel: string;
|
|
24
|
+
budgetLabel: string;
|
|
25
|
+
timeLimitLabel?: string | undefined;
|
|
26
|
+
stateLabel: string;
|
|
27
|
+
}>;
|
|
28
|
+
artifacts: Array<{
|
|
29
|
+
id: string;
|
|
30
|
+
taskId: string;
|
|
31
|
+
title: string;
|
|
32
|
+
type: string;
|
|
33
|
+
stateLabel: string;
|
|
34
|
+
reviewLabel: string;
|
|
35
|
+
openTarget?: string | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
activity: Array<{
|
|
38
|
+
id: string;
|
|
39
|
+
summary: string;
|
|
40
|
+
occurredAt: string;
|
|
41
|
+
taskId?: string | undefined;
|
|
42
|
+
runId?: string | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
progress: Array<{
|
|
45
|
+
runId: string;
|
|
46
|
+
taskId?: string | undefined;
|
|
47
|
+
stateLabel: string;
|
|
48
|
+
summary: string;
|
|
49
|
+
occurredAt?: string | undefined;
|
|
50
|
+
}>;
|
|
51
|
+
runtimeHealth: {
|
|
52
|
+
stateLabel: string;
|
|
53
|
+
readyAdapters: number;
|
|
54
|
+
adapterIssues: number;
|
|
55
|
+
activeLocalRuns: number;
|
|
56
|
+
needsAttention: boolean;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export declare function buildWorkGovernanceView(input: {
|
|
60
|
+
approvals: WorkApproval[];
|
|
61
|
+
routines: WorkRoutine[];
|
|
62
|
+
policies: WorkPolicy[];
|
|
63
|
+
artifacts: WorkArtifact[];
|
|
64
|
+
activity: WorkActivity[];
|
|
65
|
+
runs: ClaimedJob[];
|
|
66
|
+
runEvents: RunEvent[];
|
|
67
|
+
runtimeStatus: RuntimeServiceStatus;
|
|
68
|
+
adapters: AdapterDoctorEntry[];
|
|
69
|
+
localSessions: LocalRuntimeSession[];
|
|
70
|
+
}): WorkGovernanceView;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export function buildWorkGovernanceView(input) {
|
|
2
|
+
return {
|
|
3
|
+
approvals: input.approvals.map((approval) => ({
|
|
4
|
+
id: approval.id,
|
|
5
|
+
taskId: approval.taskId,
|
|
6
|
+
label: approval.type.replaceAll("_", " "),
|
|
7
|
+
stateLabel: approvalStateLabel(approval.status),
|
|
8
|
+
decisionNote: approval.decisionNote,
|
|
9
|
+
})),
|
|
10
|
+
routines: input.routines.map((routine) => ({
|
|
11
|
+
id: routine.id,
|
|
12
|
+
title: routine.title,
|
|
13
|
+
stateLabel: routineStateLabel(routine.status),
|
|
14
|
+
scheduleLabel: intervalLabel(routine.intervalMinutes),
|
|
15
|
+
nextRunAt: routine.nextRunAt,
|
|
16
|
+
})),
|
|
17
|
+
policies: input.policies.map((policy) => ({
|
|
18
|
+
id: policy.id,
|
|
19
|
+
scopeLabel: `${capitalize(policy.scopeType)} policy`,
|
|
20
|
+
budgetLabel: formatMicros(policy.limitAmount),
|
|
21
|
+
timeLimitLabel: policy.maxRunMinutes === undefined ? undefined : `${String(policy.maxRunMinutes)} minute limit`,
|
|
22
|
+
stateLabel: policy.isActive
|
|
23
|
+
? policy.hardStopEnabled ? "Stops work at the limit" : "Warns at the limit"
|
|
24
|
+
: "Paused",
|
|
25
|
+
})),
|
|
26
|
+
artifacts: input.artifacts.map((artifact) => ({
|
|
27
|
+
id: artifact.id,
|
|
28
|
+
taskId: artifact.taskId,
|
|
29
|
+
title: artifact.title,
|
|
30
|
+
type: artifact.type,
|
|
31
|
+
stateLabel: artifactStateLabel(artifact),
|
|
32
|
+
reviewLabel: reviewStateLabel(artifact.reviewState),
|
|
33
|
+
openTarget: artifact.url ?? artifact.brainRecordId,
|
|
34
|
+
})),
|
|
35
|
+
activity: [...input.activity]
|
|
36
|
+
.sort((left, right) => right.occurredAt.localeCompare(left.occurredAt))
|
|
37
|
+
.map((event) => ({
|
|
38
|
+
id: event.id,
|
|
39
|
+
summary: activitySummary(event.action),
|
|
40
|
+
occurredAt: event.occurredAt,
|
|
41
|
+
taskId: event.taskId,
|
|
42
|
+
runId: event.runId,
|
|
43
|
+
})),
|
|
44
|
+
progress: progressViews(input.runs, input.runEvents),
|
|
45
|
+
runtimeHealth: runtimeHealth(input),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function progressViews(runs, events) {
|
|
49
|
+
return runs.map((run) => {
|
|
50
|
+
const latest = events
|
|
51
|
+
.filter((event) => event.runId === run.runId && event.eventType !== "log")
|
|
52
|
+
.sort((left, right) => right.sequence - left.sequence)[0];
|
|
53
|
+
const summary = latest?.payload["summary"];
|
|
54
|
+
return {
|
|
55
|
+
runId: run.runId,
|
|
56
|
+
taskId: run.taskRecordId ?? run.wakeEnvelope?.task.id,
|
|
57
|
+
stateLabel: runStateLabel(run.status, latest?.eventType),
|
|
58
|
+
summary: typeof summary === "string" ? summary : run.objective,
|
|
59
|
+
occurredAt: latest?.occurredAt,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function runtimeHealth(input) {
|
|
64
|
+
const readyAdapters = input.adapters.filter((adapter) => adapter.status === "ready").length;
|
|
65
|
+
const adapterIssues = input.adapters.length - readyAdapters;
|
|
66
|
+
const activeLocalRuns = input.localSessions.filter((session) => session.status === "starting" || session.status === "running").length;
|
|
67
|
+
return {
|
|
68
|
+
stateLabel: runtimeStateLabel(input.runtimeStatus.state),
|
|
69
|
+
readyAdapters,
|
|
70
|
+
adapterIssues,
|
|
71
|
+
activeLocalRuns,
|
|
72
|
+
needsAttention: input.runtimeStatus.state === "failed" || adapterIssues > 0,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function activitySummary(action) {
|
|
76
|
+
const summaries = {
|
|
77
|
+
"task.created": "Task added",
|
|
78
|
+
"task.checked_out": "Local agent started work",
|
|
79
|
+
"task.comment_added": "Update posted",
|
|
80
|
+
"artifact.registered": "Result attached",
|
|
81
|
+
"approval.requested": "Review requested",
|
|
82
|
+
"approval.approved": "Review approved",
|
|
83
|
+
"approval.revision_requested": "Changes requested",
|
|
84
|
+
"wake.dispatched": "Sent to this computer",
|
|
85
|
+
"wake.finished": "Local run finished",
|
|
86
|
+
"run.usage_reported": "Usage updated",
|
|
87
|
+
};
|
|
88
|
+
return summaries[action] ?? action.replaceAll(/[._]/gu, " ");
|
|
89
|
+
}
|
|
90
|
+
function approvalStateLabel(status) {
|
|
91
|
+
if (status === "pending")
|
|
92
|
+
return "Waiting for review";
|
|
93
|
+
if (status === "approved")
|
|
94
|
+
return "Approved";
|
|
95
|
+
if (status === "revision_requested")
|
|
96
|
+
return "Changes requested";
|
|
97
|
+
return "Rejected";
|
|
98
|
+
}
|
|
99
|
+
function routineStateLabel(status) {
|
|
100
|
+
if (status === "active")
|
|
101
|
+
return "Running automatically";
|
|
102
|
+
if (status === "paused")
|
|
103
|
+
return "Paused";
|
|
104
|
+
return "Archived";
|
|
105
|
+
}
|
|
106
|
+
function intervalLabel(minutes) {
|
|
107
|
+
if (minutes % 1_440 === 0)
|
|
108
|
+
return `Every ${String(minutes / 1_440)} day(s)`;
|
|
109
|
+
if (minutes % 60 === 0)
|
|
110
|
+
return `Every ${String(minutes / 60)} hour(s)`;
|
|
111
|
+
return `Every ${String(minutes)} minute(s)`;
|
|
112
|
+
}
|
|
113
|
+
function artifactStateLabel(artifact) {
|
|
114
|
+
if (artifact.status === "failed")
|
|
115
|
+
return "Unavailable";
|
|
116
|
+
if (artifact.url !== undefined || artifact.brainRecordId !== undefined)
|
|
117
|
+
return "Ready to open";
|
|
118
|
+
return "Still preparing";
|
|
119
|
+
}
|
|
120
|
+
function reviewStateLabel(state) {
|
|
121
|
+
if (state === "pending")
|
|
122
|
+
return "Waiting for review";
|
|
123
|
+
if (state === "approved")
|
|
124
|
+
return "Approved";
|
|
125
|
+
if (state === "revision_requested")
|
|
126
|
+
return "Changes requested";
|
|
127
|
+
if (state === "rejected")
|
|
128
|
+
return "Rejected";
|
|
129
|
+
return "No review needed";
|
|
130
|
+
}
|
|
131
|
+
function runStateLabel(status, eventType) {
|
|
132
|
+
if (eventType === "failed" || status === "failed")
|
|
133
|
+
return "Needs attention";
|
|
134
|
+
if (eventType === "cancelled" || status === "cancelled")
|
|
135
|
+
return "Cancelled";
|
|
136
|
+
if (eventType === "completed" || status === "completed")
|
|
137
|
+
return "Completed";
|
|
138
|
+
if (status === "processing")
|
|
139
|
+
return "Working locally";
|
|
140
|
+
return "Waiting to start";
|
|
141
|
+
}
|
|
142
|
+
function runtimeStateLabel(state) {
|
|
143
|
+
if (state === "running")
|
|
144
|
+
return "Conductor is online";
|
|
145
|
+
if (state === "starting")
|
|
146
|
+
return "Conductor is starting";
|
|
147
|
+
if (state === "stopping")
|
|
148
|
+
return "Conductor is stopping";
|
|
149
|
+
if (state === "failed")
|
|
150
|
+
return "Conductor needs attention";
|
|
151
|
+
return "Conductor is offline";
|
|
152
|
+
}
|
|
153
|
+
function formatMicros(value) {
|
|
154
|
+
return `$${(value / 1_000_000).toFixed(2)} monthly limit`;
|
|
155
|
+
}
|
|
156
|
+
function capitalize(value) {
|
|
157
|
+
return `${value.slice(0, 1).toUpperCase()}${value.slice(1)}`;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=workGovernanceView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workGovernanceView.js","sourceRoot":"","sources":["../../src/desktop/workGovernanceView.ts"],"names":[],"mappings":"AAkEA,MAAM,UAAU,uBAAuB,CAAC,K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;QAAE,OAAO,2BAA2B,CAAC;IAC3D,OAAO,sBAAsB,CAAC;AAChC,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAC5D,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ConductorHttpClient } from "../conductorClient.js";
|
|
2
|
+
import type { DesktopConductorApi } from "../desktop/app/contracts.js";
|
|
3
|
+
import type { ConductorUserAuthorizationService } from "../userAuth/service.js";
|
|
4
|
+
export declare class AuthorizedPairingService {
|
|
5
|
+
private readonly input;
|
|
6
|
+
constructor(input: {
|
|
7
|
+
authorization: Pick<ConductorUserAuthorizationService, "status" | "credential">;
|
|
8
|
+
controller: Pick<DesktopConductorApi, "pair">;
|
|
9
|
+
createClient?: ((apiBaseUrl: string, workspaceId: string) => Pick<ConductorHttpClient, "createPairingCode">) | undefined;
|
|
10
|
+
});
|
|
11
|
+
pair(displayName: string): Promise<import("../pairing.js").SafeStatus>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ConductorHttpClient } from "../conductorClient.js";
|
|
2
|
+
export class AuthorizedPairingService {
|
|
3
|
+
input;
|
|
4
|
+
constructor(input) {
|
|
5
|
+
this.input = input;
|
|
6
|
+
}
|
|
7
|
+
async pair(displayName) {
|
|
8
|
+
const status = await this.input.authorization.status();
|
|
9
|
+
if (status.state !== "authorized") {
|
|
10
|
+
throw new Error("Sign in to Sift before connecting this computer automatically.");
|
|
11
|
+
}
|
|
12
|
+
const client = (this.input.createClient ?? ((apiBaseUrl, workspaceId) => new ConductorHttpClient({ apiBaseUrl, userWorkspaceId: workspaceId })))(status.apiBaseUrl, status.workspaceId);
|
|
13
|
+
const credential = await this.input.authorization.credential();
|
|
14
|
+
const pairing = await client.createPairingCode(credential, displayName);
|
|
15
|
+
return this.input.controller.pair({ apiBaseUrl: status.apiBaseUrl, code: pairing.code, displayName });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=authorizedPairing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorizedPairing.js","sourceRoot":"","sources":["../../src/localApi/authorizedPairing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D,MAAM,OAAO,wBAAwB;IACN;IAA7B,YAA6B,KAI5B;QAJ4B,UAAK,GAAL,KAAK,CAIjC;IAAG,CAAC;IAEL,KAAK,CAAC,IAAI,CAAC,WAAmB;QAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;QACvD,IAAI,MAAM,CAAC,KAAK,KAAK,YAAY,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;QACpF,CAAC;QACD,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,EAAE,CAAC,IAAI,mBAAmB,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QACxL,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;QAC/D,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QACxE,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IACxG,CAAC;CACF"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ProviderAgentView, ProviderInstallPlan } from "../adapters/provider/setup.js";
|
|
3
|
+
import type { ProviderAccessProfile, ProviderType } from "../adapters/provider/types.js";
|
|
4
|
+
import type { DesktopConductorApi, DesktopPairRequest, ProviderDraft, ProviderDraftStatus, SelectedFolder } from "../desktop/app/contracts.js";
|
|
5
|
+
import type { RuntimeServiceStatus } from "../runtime/runtimeService.js";
|
|
6
|
+
import { type UserAuthorizationStatus } from "../userAuth/types.js";
|
|
7
|
+
import type { WorkConsoleSnapshot, createTaskRequestSchema, updateTaskRequestSchema, commentTaskRequestSchema, dispatchTaskRequestSchema, approvalDecisionRequestSchema } from "./workContracts.js";
|
|
8
|
+
export type LocalPairingStatus = {
|
|
9
|
+
paired: false;
|
|
10
|
+
} | {
|
|
11
|
+
paired: true;
|
|
12
|
+
apiBaseUrl: string;
|
|
13
|
+
conductorId?: string | undefined;
|
|
14
|
+
displayName: string;
|
|
15
|
+
protocolVersion: string;
|
|
16
|
+
};
|
|
17
|
+
export type LocalHealth = {
|
|
18
|
+
ok: true;
|
|
19
|
+
version: string;
|
|
20
|
+
protocolVersion: string;
|
|
21
|
+
};
|
|
22
|
+
export type LocalSessionStatus = {
|
|
23
|
+
authenticated: true;
|
|
24
|
+
csrfToken: string;
|
|
25
|
+
expiresAt: string;
|
|
26
|
+
};
|
|
27
|
+
export type ConductorLocalApi = {
|
|
28
|
+
health(): Promise<LocalHealth>;
|
|
29
|
+
pairedStatus(): Promise<LocalPairingStatus>;
|
|
30
|
+
pair(input: DesktopPairRequest): Promise<LocalPairingStatus>;
|
|
31
|
+
pairAuthorized(displayName: string): Promise<LocalPairingStatus>;
|
|
32
|
+
logout(): Promise<LocalPairingStatus>;
|
|
33
|
+
listAgents(): Promise<ProviderAgentView[]>;
|
|
34
|
+
selectFolder(): Promise<SelectedFolder | undefined>;
|
|
35
|
+
inspectDraft(input: ProviderDraft): Promise<ProviderDraftStatus>;
|
|
36
|
+
login(input: ProviderDraft): Promise<{
|
|
37
|
+
ok: boolean;
|
|
38
|
+
message: string;
|
|
39
|
+
}>;
|
|
40
|
+
verifyAndAdd(input: ProviderDraft): Promise<ProviderAgentView>;
|
|
41
|
+
updateAgent(input: {
|
|
42
|
+
localKey: string;
|
|
43
|
+
displayName: string;
|
|
44
|
+
accessProfile: ProviderAccessProfile;
|
|
45
|
+
folderToken?: string | undefined;
|
|
46
|
+
}): Promise<ProviderAgentView>;
|
|
47
|
+
pauseAgent(localKey: string, paused: boolean): Promise<ProviderAgentView>;
|
|
48
|
+
removeAgent(localKey: string): Promise<void>;
|
|
49
|
+
installPlan(provider: ProviderType): Promise<ProviderInstallPlan>;
|
|
50
|
+
openOfficialProviderPage(provider: ProviderType): Promise<void>;
|
|
51
|
+
runtimeStatus(): Promise<RuntimeServiceStatus>;
|
|
52
|
+
startRuntime(): Promise<RuntimeServiceStatus>;
|
|
53
|
+
stopRuntime(): Promise<RuntimeServiceStatus>;
|
|
54
|
+
clearLocalDiagnostics(): Promise<void>;
|
|
55
|
+
userAuthorizationStatus(): Promise<UserAuthorizationStatus>;
|
|
56
|
+
beginUserAuthorization(input?: {
|
|
57
|
+
apiBaseUrl?: string | undefined;
|
|
58
|
+
deviceLabel?: string | undefined;
|
|
59
|
+
}): Promise<UserAuthorizationStatus>;
|
|
60
|
+
signOutUser(): Promise<UserAuthorizationStatus>;
|
|
61
|
+
workSnapshot(input: {
|
|
62
|
+
projectId?: string | undefined;
|
|
63
|
+
taskId?: string | undefined;
|
|
64
|
+
}): Promise<WorkConsoleSnapshot>;
|
|
65
|
+
createTask(input: z.infer<typeof createTaskRequestSchema>): Promise<unknown>;
|
|
66
|
+
updateTask(input: z.infer<typeof updateTaskRequestSchema>): Promise<unknown>;
|
|
67
|
+
commentTask(input: z.infer<typeof commentTaskRequestSchema>): Promise<unknown>;
|
|
68
|
+
dispatchTask(input: z.infer<typeof dispatchTaskRequestSchema>): Promise<unknown>;
|
|
69
|
+
decideApproval(input: z.infer<typeof approvalDecisionRequestSchema>): Promise<unknown>;
|
|
70
|
+
cancelRun(runId: string): Promise<unknown>;
|
|
71
|
+
};
|
|
72
|
+
export declare const localPairingStatusSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
73
|
+
paired: z.ZodLiteral<false>;
|
|
74
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
75
|
+
paired: z.ZodLiteral<true>;
|
|
76
|
+
apiBaseUrl: z.ZodURL;
|
|
77
|
+
conductorId: z.ZodOptional<z.ZodString>;
|
|
78
|
+
displayName: z.ZodString;
|
|
79
|
+
protocolVersion: z.ZodString;
|
|
80
|
+
}, z.core.$strict>], "paired">;
|
|
81
|
+
export declare const localHealthSchema: z.ZodObject<{
|
|
82
|
+
ok: z.ZodLiteral<true>;
|
|
83
|
+
version: z.ZodString;
|
|
84
|
+
protocolVersion: z.ZodString;
|
|
85
|
+
}, z.core.$strict>;
|
|
86
|
+
export declare const runtimeServiceStatusSchema: z.ZodObject<{
|
|
87
|
+
state: z.ZodEnum<{
|
|
88
|
+
failed: "failed";
|
|
89
|
+
starting: "starting";
|
|
90
|
+
running: "running";
|
|
91
|
+
stopping: "stopping";
|
|
92
|
+
stopped: "stopped";
|
|
93
|
+
}>;
|
|
94
|
+
startedAt: z.ZodOptional<z.ZodString>;
|
|
95
|
+
stoppedAt: z.ZodOptional<z.ZodString>;
|
|
96
|
+
lastResult: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
97
|
+
status: z.ZodLiteral<"idle">;
|
|
98
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
99
|
+
status: z.ZodLiteral<"completed">;
|
|
100
|
+
runId: z.ZodString;
|
|
101
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
102
|
+
status: z.ZodLiteral<"cancelled">;
|
|
103
|
+
runId: z.ZodString;
|
|
104
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
105
|
+
status: z.ZodLiteral<"failed">;
|
|
106
|
+
runId: z.ZodString;
|
|
107
|
+
}, z.core.$strict>], "status">>;
|
|
108
|
+
lastErrorMessage: z.ZodOptional<z.ZodString>;
|
|
109
|
+
}, z.core.$strict>;
|
|
110
|
+
export declare const providerAgentViewSchema: z.ZodObject<{
|
|
111
|
+
localKey: z.ZodString;
|
|
112
|
+
displayName: z.ZodString;
|
|
113
|
+
provider: z.ZodEnum<{
|
|
114
|
+
codex: "codex";
|
|
115
|
+
"claude-code": "claude-code";
|
|
116
|
+
}>;
|
|
117
|
+
workspaceName: z.ZodString;
|
|
118
|
+
accessProfile: z.ZodEnum<{
|
|
119
|
+
inspect: "inspect";
|
|
120
|
+
workspace: "workspace";
|
|
121
|
+
}>;
|
|
122
|
+
enabled: z.ZodBoolean;
|
|
123
|
+
status: z.ZodEnum<{
|
|
124
|
+
error: "error";
|
|
125
|
+
ready: "ready";
|
|
126
|
+
}>;
|
|
127
|
+
message: z.ZodString;
|
|
128
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
129
|
+
remediation: z.ZodOptional<z.ZodEnum<{
|
|
130
|
+
install: "install";
|
|
131
|
+
login: "login";
|
|
132
|
+
upgrade: "upgrade";
|
|
133
|
+
"select-folder": "select-folder";
|
|
134
|
+
resume: "resume";
|
|
135
|
+
retry: "retry";
|
|
136
|
+
}>>;
|
|
137
|
+
providerVersion: z.ZodOptional<z.ZodString>;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
export declare const selectedFolderSchema: z.ZodObject<{
|
|
140
|
+
token: z.ZodString;
|
|
141
|
+
name: z.ZodString;
|
|
142
|
+
}, z.core.$strict>;
|
|
143
|
+
export declare const providerDraftStatusSchema: z.ZodObject<{
|
|
144
|
+
status: z.ZodEnum<{
|
|
145
|
+
error: "error";
|
|
146
|
+
ready: "ready";
|
|
147
|
+
}>;
|
|
148
|
+
message: z.ZodString;
|
|
149
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
150
|
+
remediation: z.ZodOptional<z.ZodEnum<{
|
|
151
|
+
install: "install";
|
|
152
|
+
login: "login";
|
|
153
|
+
upgrade: "upgrade";
|
|
154
|
+
"select-folder": "select-folder";
|
|
155
|
+
resume: "resume";
|
|
156
|
+
retry: "retry";
|
|
157
|
+
}>>;
|
|
158
|
+
providerVersion: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, z.core.$strict>;
|
|
160
|
+
export declare const providerInstallPlanSchema: z.ZodObject<{
|
|
161
|
+
provider: z.ZodEnum<{
|
|
162
|
+
codex: "codex";
|
|
163
|
+
"claude-code": "claude-code";
|
|
164
|
+
}>;
|
|
165
|
+
title: z.ZodString;
|
|
166
|
+
source: z.ZodString;
|
|
167
|
+
command: z.ZodOptional<z.ZodString>;
|
|
168
|
+
officialUrl: z.ZodURL;
|
|
169
|
+
}, z.core.$strict>;
|
|
170
|
+
export declare const providerLoginResultSchema: z.ZodObject<{
|
|
171
|
+
ok: z.ZodBoolean;
|
|
172
|
+
message: z.ZodString;
|
|
173
|
+
}, z.core.$strict>;
|
|
174
|
+
export declare const localSessionStatusSchema: z.ZodObject<{
|
|
175
|
+
authenticated: z.ZodLiteral<true>;
|
|
176
|
+
csrfToken: z.ZodString;
|
|
177
|
+
expiresAt: z.ZodISODateTime;
|
|
178
|
+
}, z.core.$strict>;
|
|
179
|
+
export declare const localPairRequestSchema: z.ZodObject<{
|
|
180
|
+
apiBaseUrl: z.ZodURL;
|
|
181
|
+
code: z.ZodString;
|
|
182
|
+
displayName: z.ZodString;
|
|
183
|
+
}, z.core.$strict>;
|
|
184
|
+
export declare const localAuthorizedPairRequestSchema: z.ZodObject<{
|
|
185
|
+
displayName: z.ZodString;
|
|
186
|
+
}, z.core.$strict>;
|
|
187
|
+
export declare const localUserAuthorizationBeginSchema: z.ZodObject<{
|
|
188
|
+
apiBaseUrl: z.ZodOptional<z.ZodURL>;
|
|
189
|
+
deviceLabel: z.ZodOptional<z.ZodString>;
|
|
190
|
+
}, z.core.$strict>;
|
|
191
|
+
export declare const localProviderDraftSchema: z.ZodObject<{
|
|
192
|
+
provider: z.ZodEnum<{
|
|
193
|
+
codex: "codex";
|
|
194
|
+
"claude-code": "claude-code";
|
|
195
|
+
}>;
|
|
196
|
+
displayName: z.ZodString;
|
|
197
|
+
folderToken: z.ZodString;
|
|
198
|
+
accessProfile: z.ZodEnum<{
|
|
199
|
+
inspect: "inspect";
|
|
200
|
+
workspace: "workspace";
|
|
201
|
+
}>;
|
|
202
|
+
model: z.ZodOptional<z.ZodString>;
|
|
203
|
+
}, z.core.$strict>;
|
|
204
|
+
export declare const localAgentUpdateSchema: z.ZodObject<{
|
|
205
|
+
localKey: z.ZodString;
|
|
206
|
+
displayName: z.ZodString;
|
|
207
|
+
accessProfile: z.ZodEnum<{
|
|
208
|
+
inspect: "inspect";
|
|
209
|
+
workspace: "workspace";
|
|
210
|
+
}>;
|
|
211
|
+
folderToken: z.ZodOptional<z.ZodString>;
|
|
212
|
+
}, z.core.$strict>;
|
|
213
|
+
export declare const localAgentPauseSchema: z.ZodObject<{
|
|
214
|
+
localKey: z.ZodString;
|
|
215
|
+
paused: z.ZodBoolean;
|
|
216
|
+
}, z.core.$strict>;
|
|
217
|
+
export declare const localAgentKeySchema: z.ZodObject<{
|
|
218
|
+
localKey: z.ZodString;
|
|
219
|
+
}, z.core.$strict>;
|
|
220
|
+
export declare const localProviderSchema: z.ZodObject<{
|
|
221
|
+
provider: z.ZodEnum<{
|
|
222
|
+
codex: "codex";
|
|
223
|
+
"claude-code": "claude-code";
|
|
224
|
+
}>;
|
|
225
|
+
}, z.core.$strict>;
|
|
226
|
+
export declare function localHealth(): LocalHealth;
|
|
227
|
+
export declare function createLocalControllerApi(controller: DesktopConductorApi, userAuthorization?: {
|
|
228
|
+
status(): Promise<UserAuthorizationStatus>;
|
|
229
|
+
begin(input?: {
|
|
230
|
+
apiBaseUrl?: string | undefined;
|
|
231
|
+
deviceLabel?: string | undefined;
|
|
232
|
+
}): Promise<UserAuthorizationStatus>;
|
|
233
|
+
signOut(): Promise<UserAuthorizationStatus>;
|
|
234
|
+
}, work?: WorkConsolePort, authorizedPairing?: AuthorizedPairingPort, localDiagnostics?: LocalDiagnosticsPort): ConductorLocalApi;
|
|
235
|
+
type WorkConsolePort = {
|
|
236
|
+
snapshot(input: {
|
|
237
|
+
projectId?: string | undefined;
|
|
238
|
+
taskId?: string | undefined;
|
|
239
|
+
}): Promise<WorkConsoleSnapshot>;
|
|
240
|
+
createTask(input: z.infer<typeof createTaskRequestSchema>): Promise<unknown>;
|
|
241
|
+
updateTask(input: z.infer<typeof updateTaskRequestSchema>): Promise<unknown>;
|
|
242
|
+
comment(input: z.infer<typeof commentTaskRequestSchema>): Promise<unknown>;
|
|
243
|
+
dispatch(input: z.infer<typeof dispatchTaskRequestSchema>): Promise<unknown>;
|
|
244
|
+
decideApproval(input: z.infer<typeof approvalDecisionRequestSchema>): Promise<unknown>;
|
|
245
|
+
cancelRun(runId: string): Promise<unknown>;
|
|
246
|
+
};
|
|
247
|
+
type AuthorizedPairingPort = {
|
|
248
|
+
pair(displayName: string): ReturnType<DesktopConductorApi["pair"]>;
|
|
249
|
+
};
|
|
250
|
+
type LocalDiagnosticsPort = {
|
|
251
|
+
clear(): Promise<void> | void;
|
|
252
|
+
};
|
|
253
|
+
export {};
|