openpond 0.0.30 → 0.0.32
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/dist/chunks/{app-layer-FIGCNZJX.js → app-layer-CUQQUVJS.js} +20 -3
- package/dist/chunks/{apps-4RMNCKXS.js → apps-TAYMUCWX.js} +3 -3
- package/dist/chunks/{chunk-57P2GCW5.js → chunk-3UOLQG6N.js} +1 -1
- package/dist/chunks/{chunk-MFS3SYUH.js → chunk-3ZJIEA5F.js} +1 -1
- package/dist/chunks/{chunk-4S3XGFGL.js → chunk-4HQURM3N.js} +1 -1
- package/dist/chunks/{chunk-BNVHGSI7.js → chunk-4M4WAORL.js} +874 -798
- package/dist/chunks/{chunk-DANRS43D.js → chunk-5RHZKQRK.js} +14 -76
- package/dist/chunks/{chunk-BNPFMGZD.js → chunk-D264OHTR.js} +4 -5
- package/dist/chunks/{chunk-BBEVMP6O.js → chunk-DCNAXREU.js} +179 -160
- package/dist/chunks/chunk-E5RVRUJB.js +1222 -0
- package/dist/chunks/{chunk-RJXX6TJA.js → chunk-EONKWOLU.js} +2 -2
- package/dist/chunks/{chunk-VQX33YAG.js → chunk-FQW3AQVJ.js} +689 -121
- package/dist/chunks/{chunk-GGKA4HLQ.js → chunk-GYZYZGKS.js} +238 -69
- package/dist/chunks/{chunk-KMSMK7PI.js → chunk-OXQG773T.js} +33 -33
- package/dist/chunks/{chunk-BX4XSB2J.js → chunk-PJXJ2HRT.js} +1816 -1113
- package/dist/chunks/chunk-Q5MZCRJA.js +70 -0
- package/dist/chunks/{chunk-OV3KAFWB.js → chunk-W2DJR3FA.js} +1 -1
- package/dist/chunks/{chunk-KEDXE4BA.js → chunk-XADW35CL.js} +3 -3
- package/dist/chunks/{chunk-IUTUUNAX.js → chunk-Y4F4XD5V.js} +1 -1
- package/dist/chunks/{cli-2L4NB7HD.js → cli-WW5BVN5Z.js} +4 -3
- package/dist/chunks/{cli-5RL7B2Z3.js → cli-ZOCP7X5M.js} +6 -6
- package/dist/chunks/{core-commands-AZJZGTZS.js → core-commands-SYGK7K57.js} +4 -4
- package/dist/chunks/{extend-6IWYZI37.js → extend-Q5HZ7TMA.js} +11 -11
- package/dist/chunks/fileFromPath-DHCRY3BD.js +2151 -0
- package/dist/chunks/{harness-SSNXDSKM.js → harness-ZPBPQVAS.js} +3 -3
- package/dist/chunks/{help-MUJJMI3Q.js → help-3V3TRQNX.js} +1 -1
- package/dist/chunks/{opchat-RW4CFAQB.js → opchat-OUPMEFE5.js} +5 -5
- package/dist/chunks/{organizations-V7DTNLSI.js → organizations-5CSLBDAW.js} +4 -4
- package/dist/chunks/{profile-WDBKJ7YW.js → profile-OQYSXHOG.js} +206 -166
- package/dist/chunks/{project-agent-3TZ3BPYN.js → project-agent-TBTWOUJF.js} +6 -7
- package/dist/chunks/{sandbox-command-HOYHF4NC.js → sandbox-command-HCHPY7KW.js} +4 -4
- package/dist/chunks/{sandbox-template-IYGB4CZU.js → sandbox-template-PNTOZ6W3.js} +5 -6
- package/dist/chunks/{src-CBPRIWG5.js → src-C6MXLDYQ.js} +22 -6
- package/dist/chunks/{src-ZRQKSQTD.js → src-GZT4UX6I.js} +80887 -52945
- package/dist/chunks/{teams-bot-UWGCFL6C.js → teams-bot-CQ76XI6T.js} +3 -3
- package/dist/chunks/workspaces-DHVVOTVR.js +93 -0
- package/dist/cli.js +10 -10
- package/dist/config.d.ts +0 -2
- package/dist/index.js +273 -69
- package/dist/profile/local-profile-types.d.ts +8 -2
- package/dist/profile/local-profile.d.ts +3 -1
- package/dist/sandbox/types/org-project-agent.d.ts +1 -2
- package/dist/web/assets/{AppsView-Bu-Nc3Ew.js → AppsView-CF2g-7FH.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-CCguQ-DR.js → BrowserSidebar-lUsLUl20.js} +1 -1
- package/dist/web/assets/CloudWorkView-BnfGW4OV.js +1 -0
- package/dist/web/assets/{CommandMenu-CnodJFHD.js → CommandMenu-BsS4Bgb6.js} +1 -1
- package/dist/web/assets/{CommunityView-CIbjNUZr.js → CommunityView-C8qVOwlp.js} +1 -1
- package/dist/web/assets/ComposerCreateImproveStrip-C_LIpfSq.js +1 -0
- package/dist/web/assets/GetStartedView-Du533wOh.js +1 -0
- package/dist/web/assets/LabsRoute-CgKtVYTP.css +1 -0
- package/dist/web/assets/LabsRoute-yk8lNMQc.js +3 -0
- package/dist/web/assets/{NewProjectDialog-CaKiCoVS.js → NewProjectDialog-DH7wA1z9.js} +1 -1
- package/dist/web/assets/ProfileSettingsSection-CqnfjiCl.css +1 -0
- package/dist/web/assets/ProfileSettingsSection-D7JvMZdW.js +1 -0
- package/dist/web/assets/SettingsView-C9TgCaWG.js +63 -0
- package/dist/web/assets/TeamChatView-D_CE7br9.js +3 -0
- package/dist/web/assets/{TerminalOverlay-C1iP4OS1.js → TerminalOverlay-CC-VDSlp.js} +1 -1
- package/dist/web/assets/TrainingCreationPanel-NFCoaBUI.js +1 -0
- package/dist/web/assets/TrainingDraftPanel-BWEmVFjM.js +1 -0
- package/dist/web/assets/WorkspaceDiffPanel-SlLlGZM1.js +14 -0
- package/dist/web/assets/{WorkspaceEnvironmentMenu-B8JJbwIz.js → WorkspaceEnvironmentMenu-BAoMBTVD.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-B4sp9BGn.js → WorkspaceGitDialogs-CVIFrzyl.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-BBqimG5X.js → WorkspaceMonacoEditor-0trp0-TI.js} +3 -3
- package/dist/web/assets/{boxes-DAaDUabq.js → boxes-CFihgX2z.js} +1 -1
- package/dist/web/assets/create-pipeline-request-AJWLMTyw.js +4 -0
- package/dist/web/assets/{cssMode-CBF1mieJ.js → cssMode-HvqfCFyP.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-CAickXpN.js → git-commit-horizontal-C5mUmACv.js} +1 -1
- package/dist/web/assets/{htmlMode-2u8OHtWO.js → htmlMode-C8btgUt-.js} +1 -1
- package/dist/web/assets/index-8H-GDlM5.css +1 -0
- package/dist/web/assets/index-D7Vr3zcV.js +192 -0
- package/dist/web/assets/index-DUqAiF57.js +1 -0
- package/dist/web/assets/{info-CQNTh78o.js → info-D0xuy5IB.js} +1 -1
- package/dist/web/assets/{jsonMode-C4CWXViX.js → jsonMode-5zVz9G0X.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-CBs_BOlB.js → lspLanguageFeatures-DxlSSL7c.js} +1 -1
- package/dist/web/assets/{monaco.contribution-lOXpG2xQ.js → monaco.contribution-B1pWWwqT.js} +2 -2
- package/dist/web/assets/{monaco.contribution-sd3cFkcN.js → monaco.contribution-BKpVvKK9.js} +2 -2
- package/dist/web/assets/{monaco.contribution-C1LUxAKf.js → monaco.contribution-BXdXsSWI.js} +2 -2
- package/dist/web/assets/{monaco.contribution-Cpf6dWsh.js → monaco.contribution-CIjjzpUR.js} +2 -2
- package/dist/web/assets/{monitor-DsIswrMV.js → monitor-B4-9Shtp.js} +1 -1
- package/dist/web/assets/{play-CeRw21NV.js → play-BJdhBqQE.js} +1 -1
- package/dist/web/assets/{python-CXYq3BUl.js → python-CEK8J4w_.js} +1 -1
- package/dist/web/assets/{refresh-cw-N5b_6AP5.js → refresh-cw-DE0u_nmZ.js} +1 -1
- package/dist/web/assets/{reply-BSKjZrJg.js → reply-2MfLJ93n.js} +1 -1
- package/dist/web/assets/{save-D0oHH1a3.js → save-CBIVKaf8.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-DRjlcwes.js → toggleHighContrast-CC73mtvA.js} +1 -1
- package/dist/web/assets/training-BY8siNUK.css +1 -0
- package/dist/web/assets/training-model-data-BXUCzS0p.js +1 -0
- package/dist/web/assets/{tsMode-x-1A7ZcB.js → tsMode-Bhn9wr_1.js} +1 -1
- package/dist/web/assets/{wifi-off-Dt52ofzh.js → wifi-off-BKTqnqj0.js} +1 -1
- package/dist/web/assets/{workers-Ciff6Dzi.js → workers-C_adgrEg.js} +1 -1
- package/dist/web/assets/{yaml-CB67Kxnz.js → yaml-DDRAcADU.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunks/chunk-OG75GMVO.js +0 -1
- package/dist/web/assets/CloudWorkView-Dr3xqLE5.js +0 -1
- package/dist/web/assets/GetStartedView-C8nyH_PT.js +0 -1
- package/dist/web/assets/LabsExtensions-GtJzxDnK.js +0 -1
- package/dist/web/assets/LabsProfile-DG7rWYur.js +0 -1
- package/dist/web/assets/LabsRoute-D6MDHBzq.js +0 -2
- package/dist/web/assets/LabsRoute-TEt9j1vB.css +0 -1
- package/dist/web/assets/LabsSignals-BfsDN86w.js +0 -1
- package/dist/web/assets/LabsSignals-D6iA6Ryl.css +0 -1
- package/dist/web/assets/ProfileSettingsSection-DTQS2DVL.css +0 -1
- package/dist/web/assets/ProfileSettingsSection-DxEzoF3K.js +0 -1
- package/dist/web/assets/ProfileView-CEscW7Ru.js +0 -1
- package/dist/web/assets/SettingsView-JIRR_FO4.js +0 -63
- package/dist/web/assets/TeamChatView-B5M1ThhJ.js +0 -3
- package/dist/web/assets/TrainingSettingsSection-BDYvI2te.js +0 -1
- package/dist/web/assets/TrainingView-CoCFK6W3.js +0 -5
- package/dist/web/assets/WorkspaceDiffPanel-CMxKQeo7.js +0 -14
- package/dist/web/assets/index-BdY6A-YN.css +0 -1
- package/dist/web/assets/index-CU2qhUYV.js +0 -195
- package/dist/web/assets/index-Dz2B3-4C.js +0 -1
- package/dist/web/assets/settings-lists-BEg6LMcy.css +0 -1
- package/dist/web/assets/training-model-data-BPrc68VG.js +0 -1
|
@@ -2,14 +2,15 @@ import { createRequire as __openpondCreateRequire } from "node:module"; var requ
|
|
|
2
2
|
import {
|
|
3
3
|
resolveOpChatApiBaseUrl,
|
|
4
4
|
sendHostedChatTurn
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-W2DJR3FA.js";
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
CreateImprovePlanSchema,
|
|
8
|
+
CreateImproveRunSchema,
|
|
9
|
+
CreateImproveWorkflowCaptureSchema,
|
|
10
|
+
createImproveActionShapeFromMetadata,
|
|
11
|
+
inferCreateImproveActionShape,
|
|
12
|
+
nextCreateImproveRunRevision
|
|
13
|
+
} from "./chunk-FQW3AQVJ.js";
|
|
13
14
|
import {
|
|
14
15
|
external_exports
|
|
15
16
|
} from "./chunk-WYDVQOBL.js";
|
|
@@ -18,7 +19,7 @@ import {
|
|
|
18
19
|
loadGlobalConfig,
|
|
19
20
|
readApiJson,
|
|
20
21
|
runShellCommand
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-D264OHTR.js";
|
|
22
23
|
|
|
23
24
|
// src/goal/cli.ts
|
|
24
25
|
import { randomUUID as randomUUID9 } from "node:crypto";
|
|
@@ -146,17 +147,24 @@ function shouldCreatePipelineForGoal(kind) {
|
|
|
146
147
|
}
|
|
147
148
|
function createInitialCreatePipeline(input) {
|
|
148
149
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
149
|
-
const
|
|
150
|
+
const runId = `create_improve_${randomUUID2()}`;
|
|
150
151
|
const planId = `create_plan_${randomUUID2()}`;
|
|
151
152
|
const approvalId = `approval_${randomUUID2()}`;
|
|
152
|
-
const operation = input.goal.kind === "update_agent" ? "
|
|
153
|
+
const operation = input.goal.kind === "update_agent" ? "improve" : "create";
|
|
153
154
|
const createAgentId = input.goal.agentId ?? slugFromObjective(input.goal.objective);
|
|
154
155
|
const sourceRoot = sourceRootPathForAgent(
|
|
155
|
-
operation === "
|
|
156
|
+
operation === "improve" && input.goal.agentId ? input.goal.agentId : createAgentId
|
|
156
157
|
);
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
id:
|
|
158
|
+
const target = {
|
|
159
|
+
kind: "agent",
|
|
160
|
+
id: input.goal.agentId ?? createAgentId,
|
|
161
|
+
displayName: null,
|
|
162
|
+
defaultActionKey: input.goal.agentId ? `${input.goal.agentId}.chat` : `${createAgentId}.chat`
|
|
163
|
+
};
|
|
164
|
+
const draft = CreateImproveRunSchema.parse({
|
|
165
|
+
schemaVersion: "openpond.createImprove.run.v1",
|
|
166
|
+
id: runId,
|
|
167
|
+
revision: 0,
|
|
160
168
|
operation,
|
|
161
169
|
surface: input.surface,
|
|
162
170
|
command: input.command,
|
|
@@ -176,7 +184,9 @@ function createInitialCreatePipeline(input) {
|
|
|
176
184
|
label: null
|
|
177
185
|
},
|
|
178
186
|
scope: {
|
|
187
|
+
profileId: input.profile?.activeProfile ?? "default",
|
|
179
188
|
conversationId: input.goal.conversationId,
|
|
189
|
+
originTurnId: null,
|
|
180
190
|
workItemId: input.goal.workItemId,
|
|
181
191
|
projectId: input.goal.projectId,
|
|
182
192
|
targetProject: input.goal.projectId ? {
|
|
@@ -193,34 +203,64 @@ function createInitialCreatePipeline(input) {
|
|
|
193
203
|
attachments: [],
|
|
194
204
|
apps: [],
|
|
195
205
|
tools: [],
|
|
206
|
+
signalRefs: [],
|
|
207
|
+
evalRefs: [],
|
|
196
208
|
targetRepoAssumptions: []
|
|
197
209
|
},
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
210
|
+
target,
|
|
211
|
+
state: "planning",
|
|
212
|
+
plan: null,
|
|
213
|
+
workflowCapture: null,
|
|
214
|
+
executionPolicy: {
|
|
215
|
+
mode: "background",
|
|
216
|
+
pauseAllowed: true,
|
|
217
|
+
cancellationAllowed: true
|
|
218
|
+
},
|
|
219
|
+
iterationPolicy: {
|
|
220
|
+
mode: "single",
|
|
221
|
+
maximumAttempts: 1,
|
|
222
|
+
currentAttempt: 0
|
|
223
|
+
},
|
|
224
|
+
approvalIds: [],
|
|
225
|
+
questionIds: [],
|
|
226
|
+
questions: [],
|
|
227
|
+
candidates: [],
|
|
228
|
+
evaluationReceipts: [],
|
|
229
|
+
checkRefs: [],
|
|
230
|
+
sourceRefs: [],
|
|
231
|
+
externalExecutionRefs: [],
|
|
232
|
+
localProfileCommit: input.profile?.localHead ?? null,
|
|
233
|
+
hostedSourceCommit: null,
|
|
234
|
+
hostedSourceRef: null,
|
|
235
|
+
releaseOutcome: {
|
|
236
|
+
status: "not_requested",
|
|
237
|
+
profileCommit: null,
|
|
238
|
+
profileTag: null,
|
|
239
|
+
releaseReceiptRef: null,
|
|
240
|
+
updatedAt: null
|
|
202
241
|
},
|
|
242
|
+
blockedReason: null,
|
|
243
|
+
appliedActionIds: [],
|
|
203
244
|
metadata: {
|
|
204
245
|
goalKind: input.goal.kind,
|
|
205
246
|
promptPack: input.goal.promptPack,
|
|
206
247
|
sourceOwnership: "Profile source is durable agent code/config; local Goal state is operational run history and is not committed by default.",
|
|
207
248
|
stateOwnership: "Local questions, answers, approvals, events, create plans, and workflow capture are stored under the configured local Goal storage root."
|
|
208
249
|
},
|
|
209
|
-
createdAt: now
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
const actionShape =
|
|
213
|
-
const actionShapeDecisionSource =
|
|
214
|
-
|
|
250
|
+
createdAt: now,
|
|
251
|
+
updatedAt: now
|
|
252
|
+
});
|
|
253
|
+
const actionShape = inferCreateImproveActionShape(draft);
|
|
254
|
+
const actionShapeDecisionSource = createImproveActionShapeFromMetadata(
|
|
255
|
+
draft.metadata
|
|
215
256
|
) ? "request_metadata" : "default_chat_fallback";
|
|
216
|
-
const plan =
|
|
217
|
-
schemaVersion: "openpond.
|
|
257
|
+
const plan = CreateImprovePlanSchema.parse({
|
|
258
|
+
schemaVersion: "openpond.createImprove.plan.v1",
|
|
218
259
|
id: planId,
|
|
219
|
-
|
|
220
|
-
requestId,
|
|
260
|
+
runId,
|
|
221
261
|
status: "pending_approval",
|
|
222
262
|
objective: input.goal.objective,
|
|
223
|
-
summary: operation === "
|
|
263
|
+
summary: operation === "improve" ? "Edit the selected source-backed OpenPond profile agent after this plan is approved." : "Create a source-backed OpenPond profile agent after this plan is approved.",
|
|
224
264
|
capturedContextSummary: input.surface === "local_extend" ? "Local extend request from the active profile source. No prior chat context was attached." : "Direct prompt request. No prior chat context was attached.",
|
|
225
265
|
defaultChatAction: {
|
|
226
266
|
key: input.goal.agentId ? `${input.goal.agentId}.chat` : "chat",
|
|
@@ -230,8 +270,8 @@ function createInitialCreatePipeline(input) {
|
|
|
230
270
|
sourcePlan: [
|
|
231
271
|
{
|
|
232
272
|
path: sourceRoot,
|
|
233
|
-
operation: operation === "
|
|
234
|
-
reason: operation === "
|
|
273
|
+
operation: operation === "improve" ? "update" : "create",
|
|
274
|
+
reason: operation === "improve" ? "Revise the selected profile agent source while preserving the default chat route." : "Implement the new profile agent source without overwriting existing profile agents."
|
|
235
275
|
},
|
|
236
276
|
{
|
|
237
277
|
path: "settings/profile.yaml",
|
|
@@ -282,11 +322,10 @@ function createInitialCreatePipeline(input) {
|
|
|
282
322
|
createdAt: now,
|
|
283
323
|
updatedAt: now
|
|
284
324
|
});
|
|
285
|
-
const workflowCapture =
|
|
286
|
-
schemaVersion: "openpond.
|
|
325
|
+
const workflowCapture = CreateImproveWorkflowCaptureSchema.parse({
|
|
326
|
+
schemaVersion: "openpond.createImprove.workflowCapture.v1",
|
|
287
327
|
id: `workflow_capture_${randomUUID2()}`,
|
|
288
|
-
|
|
289
|
-
requestId,
|
|
328
|
+
runId,
|
|
290
329
|
command: input.command,
|
|
291
330
|
objective: input.goal.objective,
|
|
292
331
|
conversationExcerpts: [],
|
|
@@ -308,37 +347,24 @@ function createInitialCreatePipeline(input) {
|
|
|
308
347
|
},
|
|
309
348
|
createdAt: now
|
|
310
349
|
});
|
|
311
|
-
const snapshot =
|
|
312
|
-
|
|
313
|
-
id: `create_pipeline_${randomUUID2()}`,
|
|
314
|
-
goalId: input.goal.id,
|
|
350
|
+
const snapshot = CreateImproveRunSchema.parse({
|
|
351
|
+
...draft,
|
|
315
352
|
state: "awaiting_plan_approval",
|
|
316
|
-
request: parsedRequest,
|
|
317
353
|
plan,
|
|
318
354
|
workflowCapture,
|
|
319
355
|
approvalIds: [approvalId],
|
|
320
|
-
|
|
321
|
-
sourceRefs: [],
|
|
322
|
-
localGoalId: input.goal.id,
|
|
323
|
-
localProfileCommit: input.profile?.localHead ?? null,
|
|
324
|
-
hostedGoalId: null,
|
|
325
|
-
hostedSourceCommit: null,
|
|
326
|
-
hostedSourceRef: null,
|
|
327
|
-
blockedReason: null,
|
|
328
|
-
metadata: {},
|
|
329
|
-
createdAt: now,
|
|
356
|
+
revision: 1,
|
|
330
357
|
updatedAt: now
|
|
331
358
|
});
|
|
332
359
|
const approval = {
|
|
333
360
|
id: approvalId,
|
|
334
361
|
goalId: input.goal.id,
|
|
335
362
|
kind: "create_plan",
|
|
336
|
-
title: operation === "
|
|
363
|
+
title: operation === "improve" ? "Approve agent improvement plan" : "Approve agent create plan",
|
|
337
364
|
reason: "OpenPond requires plan approval before mutating durable profile agent source.",
|
|
338
365
|
payload: {
|
|
339
|
-
requestId,
|
|
340
366
|
planId,
|
|
341
|
-
|
|
367
|
+
runId: snapshot.id,
|
|
342
368
|
objective: input.goal.objective,
|
|
343
369
|
defaultActionKey: plan.defaultChatAction.key,
|
|
344
370
|
sourcePlan: plan.sourcePlan,
|
|
@@ -366,17 +392,17 @@ function normalizeAgentId(value) {
|
|
|
366
392
|
const normalized = value.trim().toLowerCase().replace(/['"]/g, "").replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 64);
|
|
367
393
|
return normalized || "created-agent";
|
|
368
394
|
}
|
|
369
|
-
function
|
|
370
|
-
return
|
|
395
|
+
function approveCreateImprovePlan(goal, approvalId) {
|
|
396
|
+
return decideCreateImprovePlan(goal, approvalId, "approved");
|
|
371
397
|
}
|
|
372
|
-
function
|
|
373
|
-
return
|
|
398
|
+
function rejectCreateImprovePlan(goal, approvalId, decisionNote) {
|
|
399
|
+
return decideCreateImprovePlan(goal, approvalId, "rejected", decisionNote);
|
|
374
400
|
}
|
|
375
|
-
function
|
|
376
|
-
return
|
|
401
|
+
function cancelCreateImprovePlan(goal, approvalId, decisionNote) {
|
|
402
|
+
return decideCreateImprovePlan(goal, approvalId, "cancelled", decisionNote);
|
|
377
403
|
}
|
|
378
|
-
function
|
|
379
|
-
const pipeline = goal.
|
|
404
|
+
function reviseCreateImprovePlan(goal, input) {
|
|
405
|
+
const pipeline = goal.createImproveRun;
|
|
380
406
|
if (!pipeline?.plan) {
|
|
381
407
|
throw new Error("goal has no create plan to edit");
|
|
382
408
|
}
|
|
@@ -389,7 +415,7 @@ function reviseCreatePipelinePlan(goal, input) {
|
|
|
389
415
|
}
|
|
390
416
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
391
417
|
const previousPlan = pipeline.plan;
|
|
392
|
-
const nextPlan =
|
|
418
|
+
const nextPlan = CreateImprovePlanSchema.parse({
|
|
393
419
|
...previousPlan,
|
|
394
420
|
id: `create_plan_${randomUUID2()}`,
|
|
395
421
|
status: "pending_approval",
|
|
@@ -434,8 +460,7 @@ Revision requested: ${revision}`,
|
|
|
434
460
|
...goal,
|
|
435
461
|
status: "awaiting_approval",
|
|
436
462
|
approvals,
|
|
437
|
-
|
|
438
|
-
...pipeline,
|
|
463
|
+
createImproveRun: nextCreateImproveRunRevision(pipeline, {
|
|
439
464
|
state: "awaiting_plan_approval",
|
|
440
465
|
plan: nextPlan,
|
|
441
466
|
blockedReason: null,
|
|
@@ -448,15 +473,14 @@ Revision requested: ${revision}`,
|
|
|
448
473
|
updatedAt: now
|
|
449
474
|
};
|
|
450
475
|
}
|
|
451
|
-
function
|
|
452
|
-
const pipeline = goal.
|
|
476
|
+
function decideCreateImprovePlan(goal, approvalId, decision, decisionNote) {
|
|
477
|
+
const pipeline = goal.createImproveRun;
|
|
453
478
|
if (!pipeline?.plan || pipeline.plan.approvalId !== approvalId) return goal;
|
|
454
479
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
455
480
|
const nextState = decision === "approved" ? "applying_source" : decision === "cancelled" ? "cancelled" : "blocked";
|
|
456
481
|
return {
|
|
457
482
|
...goal,
|
|
458
|
-
|
|
459
|
-
...pipeline,
|
|
483
|
+
createImproveRun: nextCreateImproveRunRevision(pipeline, {
|
|
460
484
|
state: nextState,
|
|
461
485
|
plan: {
|
|
462
486
|
...pipeline.plan,
|
|
@@ -517,7 +541,7 @@ Create a source-backed OpenPond agent from the user's prompt. Ask structured que
|
|
|
517
541
|
|
|
518
542
|
Do not invoke openpond-agent through shell, npx, pnpm dlx, or yarn dlx.
|
|
519
543
|
|
|
520
|
-
Create-agent and edit-agent Goals use
|
|
544
|
+
Create-agent and edit-agent Goals use the shared Create/Improve run. Its plan and workflow capture are durable Goal state under the configured local Goal storage root, normally ~/.openpond/goals/<goalId>; they are operational run history, not profile source to commit. Source mutation is allowed only after the create_plan approval is approved. When the Goal metadata contains an approved Create/Improve plan, follow that plan, preserve or create a default chat action, keep openpond_chat routed to that default action, and run the required SDK checks before claiming the agent is ready.
|
|
521
545
|
|
|
522
546
|
## Create Plan Action Shape
|
|
523
547
|
|
|
@@ -656,36 +680,33 @@ function buildGoalUserContext(goal) {
|
|
|
656
680
|
decisionNote: approval.decisionNote,
|
|
657
681
|
decidedAt: approval.decidedAt
|
|
658
682
|
}));
|
|
659
|
-
const
|
|
660
|
-
id: goal.
|
|
661
|
-
state: goal.
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
sourcePlan: goal.createPipeline.plan.sourcePlan,
|
|
676
|
-
requirements: goal.createPipeline.plan.requirements,
|
|
677
|
-
checks: goal.createPipeline.plan.checks,
|
|
683
|
+
const createImproveRun = goal.createImproveRun ? {
|
|
684
|
+
id: goal.createImproveRun.id,
|
|
685
|
+
state: goal.createImproveRun.state,
|
|
686
|
+
operation: goal.createImproveRun.operation,
|
|
687
|
+
surface: goal.createImproveRun.surface,
|
|
688
|
+
command: goal.createImproveRun.command,
|
|
689
|
+
sourceAuthority: goal.createImproveRun.adapter.sourceAuthority,
|
|
690
|
+
confirmationPolicy: goal.createImproveRun.adapter.confirmationPolicy,
|
|
691
|
+
plan: goal.createImproveRun.plan ? {
|
|
692
|
+
id: goal.createImproveRun.plan.id,
|
|
693
|
+
status: goal.createImproveRun.plan.status,
|
|
694
|
+
summary: goal.createImproveRun.plan.summary,
|
|
695
|
+
defaultChatAction: goal.createImproveRun.plan.defaultChatAction,
|
|
696
|
+
sourcePlan: goal.createImproveRun.plan.sourcePlan,
|
|
697
|
+
requirements: goal.createImproveRun.plan.requirements,
|
|
698
|
+
checks: goal.createImproveRun.plan.checks,
|
|
678
699
|
metadata: {
|
|
679
|
-
actionShape: goal.
|
|
680
|
-
actionShapeDecisionSource: goal.
|
|
700
|
+
actionShape: goal.createImproveRun.plan.metadata?.actionShape ?? null,
|
|
701
|
+
actionShapeDecisionSource: goal.createImproveRun.plan.metadata?.actionShapeDecisionSource ?? null
|
|
681
702
|
},
|
|
682
|
-
approvedAt: goal.
|
|
703
|
+
approvedAt: goal.createImproveRun.plan.approvedAt
|
|
683
704
|
} : null,
|
|
684
|
-
workflowCapture: goal.
|
|
685
|
-
id: goal.
|
|
686
|
-
tools: goal.
|
|
687
|
-
apps: goal.
|
|
688
|
-
targetRepoAssumptions: goal.
|
|
705
|
+
workflowCapture: goal.createImproveRun.workflowCapture ? {
|
|
706
|
+
id: goal.createImproveRun.workflowCapture.id,
|
|
707
|
+
tools: goal.createImproveRun.workflowCapture.tools,
|
|
708
|
+
apps: goal.createImproveRun.workflowCapture.apps,
|
|
709
|
+
targetRepoAssumptions: goal.createImproveRun.workflowCapture.targetRepoAssumptions
|
|
689
710
|
} : null
|
|
690
711
|
} : null;
|
|
691
712
|
return [
|
|
@@ -703,7 +724,7 @@ function buildGoalUserContext(goal) {
|
|
|
703
724
|
evidenceRefs: goal.evidenceRefs,
|
|
704
725
|
executionPolicy: goal.executionPolicy,
|
|
705
726
|
verification: goal.verification,
|
|
706
|
-
|
|
727
|
+
createImproveRun,
|
|
707
728
|
answeredQuestions,
|
|
708
729
|
openQuestions,
|
|
709
730
|
approvals
|
|
@@ -842,9 +863,9 @@ function createGoalRunResult(input) {
|
|
|
842
863
|
// src/goal/local-create-pipeline.ts
|
|
843
864
|
var MODEL_BACKED_LOCAL_CREATE_REQUIRED_REASON = "Approved local Create plans require model-backed SDK source application; no source mutation was performed.";
|
|
844
865
|
function shouldRunLocalCreatePipeline(goal, mode) {
|
|
845
|
-
const pipeline = goal.
|
|
866
|
+
const pipeline = goal.createImproveRun;
|
|
846
867
|
return Boolean(
|
|
847
|
-
mode === "local" && pipeline && pipeline.state === "applying_source" && pipeline.
|
|
868
|
+
mode === "local" && pipeline && pipeline.state === "applying_source" && pipeline.adapter.kind === "local"
|
|
848
869
|
);
|
|
849
870
|
}
|
|
850
871
|
async function runLocalCreatePipeline(input) {
|
|
@@ -854,7 +875,7 @@ async function runLocalCreatePipeline(input) {
|
|
|
854
875
|
goalId: input.goal.id,
|
|
855
876
|
iterationId: input.iterationId,
|
|
856
877
|
kind: "goal.blocked",
|
|
857
|
-
summary: "Local
|
|
878
|
+
summary: "Local Create/Improve execution requires local Goal state",
|
|
858
879
|
payload: { reason: "missing_local_state" }
|
|
859
880
|
});
|
|
860
881
|
return createGoalRunResult({
|
|
@@ -865,13 +886,13 @@ async function runLocalCreatePipeline(input) {
|
|
|
865
886
|
});
|
|
866
887
|
}
|
|
867
888
|
const current = await localState.get(input.goal.id) ?? input.goal;
|
|
868
|
-
const pipeline = current.
|
|
869
|
-
if (!pipeline || pipeline.
|
|
889
|
+
const pipeline = current.createImproveRun;
|
|
890
|
+
if (!pipeline || pipeline.adapter.kind !== "local") {
|
|
870
891
|
const blocked2 = createGoalEvent({
|
|
871
892
|
goalId: current.id,
|
|
872
893
|
iterationId: input.iterationId,
|
|
873
894
|
kind: "goal.blocked",
|
|
874
|
-
summary: "Goal does not have a local
|
|
895
|
+
summary: "Goal does not have a local Create/Improve run to execute",
|
|
875
896
|
payload: { reason: "missing_local_create_pipeline" }
|
|
876
897
|
});
|
|
877
898
|
await recordGoalEvent(blocked2, { localState });
|
|
@@ -904,10 +925,10 @@ async function runLocalCreatePipeline(input) {
|
|
|
904
925
|
summary: MODEL_BACKED_LOCAL_CREATE_REQUIRED_REASON,
|
|
905
926
|
payload: {
|
|
906
927
|
pipelineId: pipeline.id,
|
|
907
|
-
operation: pipeline.
|
|
928
|
+
operation: pipeline.operation,
|
|
908
929
|
reason: "model_backed_source_application_required",
|
|
909
|
-
sourcePath: pipeline.
|
|
910
|
-
repoPath: pipeline.
|
|
930
|
+
sourcePath: pipeline.adapter.sourcePath ?? null,
|
|
931
|
+
repoPath: pipeline.adapter.repoPath ?? null
|
|
911
932
|
}
|
|
912
933
|
});
|
|
913
934
|
await recordGoalEvent(blocked, { localState });
|
|
@@ -921,21 +942,20 @@ async function runLocalCreatePipeline(input) {
|
|
|
921
942
|
}
|
|
922
943
|
async function transitionLocalCreatePipeline(input) {
|
|
923
944
|
const current = await input.localState.get(input.goalId);
|
|
924
|
-
if (!current?.
|
|
925
|
-
throw new Error(`goal has no
|
|
945
|
+
if (!current?.createImproveRun) {
|
|
946
|
+
throw new Error(`goal has no Create/Improve run: ${input.goalId}`);
|
|
926
947
|
}
|
|
927
948
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
928
|
-
const previousState = current.
|
|
929
|
-
const nextPipeline =
|
|
930
|
-
...current.createPipeline,
|
|
949
|
+
const previousState = current.createImproveRun.state;
|
|
950
|
+
const nextPipeline = nextCreateImproveRunRevision(current.createImproveRun, {
|
|
931
951
|
state: input.state,
|
|
932
|
-
checkRefs: mergeRefs(current.
|
|
933
|
-
blockedReason: input.blockedReason === void 0 ? current.
|
|
952
|
+
checkRefs: mergeRefs(current.createImproveRun.checkRefs, input.checkRefs ?? []),
|
|
953
|
+
blockedReason: input.blockedReason === void 0 ? current.createImproveRun.blockedReason : input.blockedReason,
|
|
934
954
|
updatedAt: now
|
|
935
955
|
});
|
|
936
956
|
const goal = await input.localState.update({
|
|
937
957
|
...current,
|
|
938
|
-
|
|
958
|
+
createImproveRun: nextPipeline,
|
|
939
959
|
updatedAt: now
|
|
940
960
|
});
|
|
941
961
|
const event = createGoalEvent({
|
|
@@ -2972,7 +2992,7 @@ var GOAL_STATE_FILE = "state.json";
|
|
|
2972
2992
|
var GOAL_EVENTS_FILE = "events.jsonl";
|
|
2973
2993
|
var GOAL_QUESTIONS_FILE = "questions.json";
|
|
2974
2994
|
var GOAL_RESULT_FILE = "result.json";
|
|
2975
|
-
var
|
|
2995
|
+
var CREATE_IMPROVE_RUN_FILE = "create-improve-run.json";
|
|
2976
2996
|
var CREATE_PLAN_FILE = "create-plan.json";
|
|
2977
2997
|
var WORKFLOW_CAPTURE_FILE = "workflow-capture.json";
|
|
2978
2998
|
var LocalGoalStateAdapter = class {
|
|
@@ -3026,11 +3046,11 @@ var LocalGoalStateAdapter = class {
|
|
|
3026
3046
|
async addQuestion(goalId, question) {
|
|
3027
3047
|
const goal = await this.requireGoal(goalId);
|
|
3028
3048
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3029
|
-
const
|
|
3030
|
-
...goal.
|
|
3031
|
-
state: question.required ? "awaiting_questions" : goal.
|
|
3049
|
+
const createImproveRun = goal.createImproveRun ? CreateImproveRunSchema.parse({
|
|
3050
|
+
...goal.createImproveRun,
|
|
3051
|
+
state: question.required ? "awaiting_questions" : goal.createImproveRun.state,
|
|
3032
3052
|
questionIds: Array.from(
|
|
3033
|
-
/* @__PURE__ */ new Set([...goal.
|
|
3053
|
+
/* @__PURE__ */ new Set([...goal.createImproveRun.questionIds ?? [], question.id])
|
|
3034
3054
|
),
|
|
3035
3055
|
updatedAt: now
|
|
3036
3056
|
}) : void 0;
|
|
@@ -3038,7 +3058,7 @@ var LocalGoalStateAdapter = class {
|
|
|
3038
3058
|
...goal,
|
|
3039
3059
|
status: question.required ? "awaiting_user_input" : goal.status,
|
|
3040
3060
|
questions: [...goal.questions, question],
|
|
3041
|
-
...
|
|
3061
|
+
...createImproveRun ? { createImproveRun } : {},
|
|
3042
3062
|
updatedAt: now
|
|
3043
3063
|
};
|
|
3044
3064
|
await this.write(next);
|
|
@@ -3053,17 +3073,17 @@ var LocalGoalStateAdapter = class {
|
|
|
3053
3073
|
const hasOpenRequiredQuestion = questions.some(
|
|
3054
3074
|
(question) => question.required && !question.answeredAt
|
|
3055
3075
|
);
|
|
3056
|
-
const
|
|
3057
|
-
...goal.
|
|
3058
|
-
state: goal.
|
|
3076
|
+
const createImproveRun = goal.createImproveRun && goal.createImproveRun.state === "awaiting_questions" && !hasOpenRequiredQuestion ? CreateImproveRunSchema.parse({
|
|
3077
|
+
...goal.createImproveRun,
|
|
3078
|
+
state: goal.createImproveRun.plan?.status === "pending_approval" ? "awaiting_plan_approval" : "planning",
|
|
3059
3079
|
updatedAt: now
|
|
3060
|
-
}) : goal.
|
|
3080
|
+
}) : goal.createImproveRun;
|
|
3061
3081
|
const next = {
|
|
3062
3082
|
...goal,
|
|
3063
3083
|
status: goal.status === "awaiting_user_input" && !hasOpenRequiredQuestion ? "queued" : goal.status,
|
|
3064
3084
|
questions,
|
|
3065
3085
|
answers: [...goal.answers, params.answer],
|
|
3066
|
-
...
|
|
3086
|
+
...createImproveRun ? { createImproveRun } : {},
|
|
3067
3087
|
updatedAt: now
|
|
3068
3088
|
};
|
|
3069
3089
|
await this.write(next);
|
|
@@ -3102,8 +3122,8 @@ var LocalGoalStateAdapter = class {
|
|
|
3102
3122
|
goalResultPath(goalId) {
|
|
3103
3123
|
return join4(this.goalDir(goalId), GOAL_RESULT_FILE);
|
|
3104
3124
|
}
|
|
3105
|
-
|
|
3106
|
-
return join4(this.goalDir(goalId),
|
|
3125
|
+
createImproveRunPath(goalId) {
|
|
3126
|
+
return join4(this.goalDir(goalId), CREATE_IMPROVE_RUN_FILE);
|
|
3107
3127
|
}
|
|
3108
3128
|
createPlanPath(goalId) {
|
|
3109
3129
|
return join4(this.goalDir(goalId), CREATE_PLAN_FILE);
|
|
@@ -3136,25 +3156,25 @@ var LocalGoalStateAdapter = class {
|
|
|
3136
3156
|
`,
|
|
3137
3157
|
"utf-8"
|
|
3138
3158
|
);
|
|
3139
|
-
if (goal.
|
|
3159
|
+
if (goal.createImproveRun) {
|
|
3140
3160
|
await writeFile3(
|
|
3141
|
-
this.
|
|
3142
|
-
`${JSON.stringify(goal.
|
|
3161
|
+
this.createImproveRunPath(goal.id),
|
|
3162
|
+
`${JSON.stringify(goal.createImproveRun, null, 2)}
|
|
3143
3163
|
`,
|
|
3144
3164
|
"utf-8"
|
|
3145
3165
|
);
|
|
3146
|
-
if (goal.
|
|
3166
|
+
if (goal.createImproveRun.plan) {
|
|
3147
3167
|
await writeFile3(
|
|
3148
3168
|
this.createPlanPath(goal.id),
|
|
3149
|
-
`${JSON.stringify(goal.
|
|
3169
|
+
`${JSON.stringify(goal.createImproveRun.plan, null, 2)}
|
|
3150
3170
|
`,
|
|
3151
3171
|
"utf-8"
|
|
3152
3172
|
);
|
|
3153
3173
|
}
|
|
3154
|
-
if (goal.
|
|
3174
|
+
if (goal.createImproveRun.workflowCapture) {
|
|
3155
3175
|
await writeFile3(
|
|
3156
3176
|
this.workflowCapturePath(goal.id),
|
|
3157
|
-
`${JSON.stringify(goal.
|
|
3177
|
+
`${JSON.stringify(goal.createImproveRun.workflowCapture, null, 2)}
|
|
3158
3178
|
`,
|
|
3159
3179
|
"utf-8"
|
|
3160
3180
|
);
|
|
@@ -3399,13 +3419,13 @@ async function createLocalGoal(params) {
|
|
|
3399
3419
|
})
|
|
3400
3420
|
);
|
|
3401
3421
|
if (shouldCreatePipelineForGoal(params.kind)) {
|
|
3402
|
-
const command = params.
|
|
3403
|
-
const surface = params.
|
|
3422
|
+
const command = params.createImprove?.command ?? (params.kind === "update_agent" ? "/edit" : "/create");
|
|
3423
|
+
const surface = params.createImprove?.surface ?? (params.kind === "update_agent" ? "direct_prompt_improve" : "direct_prompt_create");
|
|
3404
3424
|
const { snapshot, approval } = createInitialCreatePipeline({
|
|
3405
3425
|
goal: state,
|
|
3406
3426
|
command,
|
|
3407
3427
|
surface,
|
|
3408
|
-
profile: params.
|
|
3428
|
+
profile: params.createImprove?.profile ?? {
|
|
3409
3429
|
activeProfile: optionString(params.options, "profile") || null,
|
|
3410
3430
|
repoPath: null,
|
|
3411
3431
|
sourcePath: local.workspace,
|
|
@@ -3416,18 +3436,17 @@ async function createLocalGoal(params) {
|
|
|
3416
3436
|
...state,
|
|
3417
3437
|
status: "awaiting_approval",
|
|
3418
3438
|
approvals: [approval],
|
|
3419
|
-
|
|
3439
|
+
createImproveRun: snapshot,
|
|
3420
3440
|
events: [
|
|
3421
3441
|
...state.events,
|
|
3422
3442
|
createGoalEvent({
|
|
3423
3443
|
goalId: state.id,
|
|
3424
3444
|
kind: "create_pipeline.created",
|
|
3425
|
-
summary: "Create
|
|
3445
|
+
summary: "Create/Improve run initialized",
|
|
3426
3446
|
payload: {
|
|
3427
|
-
|
|
3428
|
-
requestId: snapshot.request.id,
|
|
3447
|
+
runId: snapshot.id,
|
|
3429
3448
|
state: snapshot.state,
|
|
3430
|
-
sourceAuthority: snapshot.
|
|
3449
|
+
sourceAuthority: snapshot.adapter.sourceAuthority
|
|
3431
3450
|
}
|
|
3432
3451
|
}),
|
|
3433
3452
|
createGoalEvent({
|
|
@@ -3455,7 +3474,7 @@ async function createLocalGoal(params) {
|
|
|
3455
3474
|
payload: {
|
|
3456
3475
|
kind: approval.kind,
|
|
3457
3476
|
reason: approval.reason,
|
|
3458
|
-
|
|
3477
|
+
runId: snapshot.id,
|
|
3459
3478
|
planId: snapshot.plan?.id ?? null
|
|
3460
3479
|
}
|
|
3461
3480
|
})
|
|
@@ -3465,7 +3484,7 @@ async function createLocalGoal(params) {
|
|
|
3465
3484
|
await local.adapter.create(state);
|
|
3466
3485
|
console.log(`Goal created: ${state.id}`);
|
|
3467
3486
|
console.log(`State: ${goalStateDisplayPath({ storageRoot: local.storageRoot, goalId: state.id, fileName: "state.json" })}`);
|
|
3468
|
-
if (state.
|
|
3487
|
+
if (state.createImproveRun?.plan) {
|
|
3469
3488
|
console.log(`Plan: ${goalStateDisplayPath({ storageRoot: local.storageRoot, goalId: state.id, fileName: "create-plan.json" })}`);
|
|
3470
3489
|
console.log(`Approval required: openpond goal approve ${state.id}`);
|
|
3471
3490
|
}
|
|
@@ -3645,11 +3664,11 @@ async function applyGoalLifecycle(params) {
|
|
|
3645
3664
|
};
|
|
3646
3665
|
if (pendingApproval?.kind === "create_plan") {
|
|
3647
3666
|
if (params.action === "approve") {
|
|
3648
|
-
decidedGoal =
|
|
3667
|
+
decidedGoal = approveCreateImprovePlan(decidedGoal, pendingApproval.id);
|
|
3649
3668
|
} else if (params.action === "reject") {
|
|
3650
|
-
decidedGoal =
|
|
3669
|
+
decidedGoal = rejectCreateImprovePlan(decidedGoal, pendingApproval.id, note);
|
|
3651
3670
|
} else {
|
|
3652
|
-
decidedGoal =
|
|
3671
|
+
decidedGoal = cancelCreateImprovePlan(decidedGoal, pendingApproval.id, note);
|
|
3653
3672
|
}
|
|
3654
3673
|
}
|
|
3655
3674
|
await local.adapter.update(decidedGoal);
|
|
@@ -3676,7 +3695,7 @@ async function applyGoalLifecycle(params) {
|
|
|
3676
3695
|
kind: "create_pipeline.status_changed",
|
|
3677
3696
|
summary: params.action === "approve" ? "Create plan approved" : params.action === "reject" ? "Create plan rejected" : "Create plan cancelled",
|
|
3678
3697
|
payload: {
|
|
3679
|
-
fromState: goal.
|
|
3698
|
+
fromState: goal.createImproveRun?.state ?? null,
|
|
3680
3699
|
toState,
|
|
3681
3700
|
approvalId: pendingApproval.id
|
|
3682
3701
|
}
|
|
@@ -3714,8 +3733,8 @@ async function editGoalPlan(params) {
|
|
|
3714
3733
|
const local = await localGoalPaths(params.options);
|
|
3715
3734
|
const goal = await local.adapter.get(params.goalId);
|
|
3716
3735
|
if (!goal) throw new Error(`goal not found: ${params.goalId}`);
|
|
3717
|
-
const previousPlanId = goal.
|
|
3718
|
-
const revised =
|
|
3736
|
+
const previousPlanId = goal.createImproveRun?.plan?.id ?? null;
|
|
3737
|
+
const revised = reviseCreateImprovePlan(goal, { revision: params.revision });
|
|
3719
3738
|
await local.adapter.update(revised);
|
|
3720
3739
|
await local.adapter.appendEvent(
|
|
3721
3740
|
goal.id,
|
|
@@ -3725,37 +3744,37 @@ async function editGoalPlan(params) {
|
|
|
3725
3744
|
summary: "Create plan revised before source mutation",
|
|
3726
3745
|
payload: {
|
|
3727
3746
|
previousPlanId,
|
|
3728
|
-
planId: revised.
|
|
3747
|
+
planId: revised.createImproveRun?.plan?.id ?? null,
|
|
3729
3748
|
revision: params.revision
|
|
3730
3749
|
}
|
|
3731
3750
|
})
|
|
3732
3751
|
);
|
|
3733
3752
|
if (hasFlag(params.options, "json")) {
|
|
3734
|
-
console.log(JSON.stringify(revised.
|
|
3753
|
+
console.log(JSON.stringify(revised.createImproveRun, null, 2));
|
|
3735
3754
|
return;
|
|
3736
3755
|
}
|
|
3737
3756
|
console.log(`Goal ${params.goalId} plan revised`);
|
|
3738
|
-
console.log(`Plan: ${revised.
|
|
3757
|
+
console.log(`Plan: ${revised.createImproveRun?.plan?.id ?? "unknown"}`);
|
|
3739
3758
|
}
|
|
3740
3759
|
function printCreatePipeline(goal, json = false) {
|
|
3741
|
-
if (!goal?.
|
|
3760
|
+
if (!goal?.createImproveRun) {
|
|
3742
3761
|
if (json) {
|
|
3743
3762
|
console.log(JSON.stringify(null, null, 2));
|
|
3744
3763
|
return;
|
|
3745
3764
|
}
|
|
3746
|
-
console.log(`Goal ${goal?.id ?? "unknown"} has no
|
|
3765
|
+
console.log(`Goal ${goal?.id ?? "unknown"} has no Create/Improve run.`);
|
|
3747
3766
|
return;
|
|
3748
3767
|
}
|
|
3749
|
-
const pipeline = goal.
|
|
3768
|
+
const pipeline = goal.createImproveRun;
|
|
3750
3769
|
const plan = pipeline.plan;
|
|
3751
3770
|
if (json) {
|
|
3752
3771
|
console.log(JSON.stringify(pipeline, null, 2));
|
|
3753
3772
|
return;
|
|
3754
3773
|
}
|
|
3755
3774
|
console.log(`Goal: ${goal.id}`);
|
|
3756
|
-
console.log(`
|
|
3757
|
-
console.log(`Request: ${pipeline.
|
|
3758
|
-
console.log(`Objective: ${pipeline.
|
|
3775
|
+
console.log(`Create/Improve: ${pipeline.state}`);
|
|
3776
|
+
console.log(`Request: ${pipeline.command} ${pipeline.operation}`);
|
|
3777
|
+
console.log(`Objective: ${pipeline.objective}`);
|
|
3759
3778
|
if (!plan) return;
|
|
3760
3779
|
console.log("");
|
|
3761
3780
|
console.log(`Plan: ${plan.status}`);
|
|
@@ -3766,7 +3785,7 @@ function printCreatePipeline(goal, json = false) {
|
|
|
3766
3785
|
console.log("");
|
|
3767
3786
|
console.log("Default chat action:");
|
|
3768
3787
|
console.log(` ${plan.defaultChatAction.key ?? "none"}`);
|
|
3769
|
-
const actionShape =
|
|
3788
|
+
const actionShape = createImproveActionShapeFromMetadata(plan.metadata);
|
|
3770
3789
|
if (actionShape) {
|
|
3771
3790
|
console.log("");
|
|
3772
3791
|
console.log("Action shape:");
|