openpond 0.0.56 → 0.0.58
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 +3 -0
- package/dist/chunks/actions-command-BNVIILSL.js +184 -0
- package/dist/chunks/{app-layer-T26MAAGI.js → app-layer-RNQXXM6L.js} +5 -4
- package/dist/chunks/{app-server-runtime-64AV5AXJ.js → app-server-runtime-WYIRC5LV.js} +7 -7
- package/dist/chunks/{apps-7KLTYKHN.js → apps-LV3CSMLT.js} +5 -4
- package/dist/chunks/{chunk-M2OSF2YN.js → chunk-2J3LG4U7.js} +2 -2
- package/dist/chunks/{chunk-3HW6OSHP.js → chunk-63N6442Q.js} +1 -1
- package/dist/chunks/{chunk-6QWTEC2D.js → chunk-7QLVLGDM.js} +1 -1
- package/dist/chunks/{chunk-Q4YKGVNG.js → chunk-AD6KZWHL.js} +519 -131
- package/dist/chunks/{chunk-H44J7BB4.js → chunk-BFR6VZ2A.js} +1 -1
- package/dist/chunks/{chunk-KHNHUA2H.js → chunk-DXSHQ6TO.js} +111 -1
- package/dist/chunks/{chunk-FCVVOMIP.js → chunk-FHP7OMEI.js} +3 -31
- package/dist/chunks/{chunk-MIZHCABO.js → chunk-I23UKEYS.js} +1 -1
- package/dist/chunks/{chunk-EIRW6Z6S.js → chunk-LMQ4MPQI.js} +2 -2
- package/dist/chunks/{chunk-OSLQMUIB.js → chunk-OI65U2B5.js} +1 -1
- package/dist/chunks/{chunk-55KT7K5P.js → chunk-PVGJXCAK.js} +3 -2
- package/dist/chunks/chunk-QETF6ILG.js +15004 -0
- package/dist/chunks/{chunk-CW6FAJEF.js → chunk-QIB27QOT.js} +5 -5
- package/dist/chunks/{chunk-JSRCXDIL.js → chunk-RC3N77IV.js} +52 -32
- package/dist/chunks/chunk-SKUS4NPW.js +633 -0
- package/dist/chunks/{chunk-US7DOPAH.js → chunk-VG4H4TQG.js} +65 -58
- package/dist/chunks/{cli-J7EKEJZV.js → cli-EPVMUYQT.js} +6 -6
- package/dist/chunks/{core-commands-SND555SC.js → core-commands-H2UC3LHG.js} +6 -5
- package/dist/chunks/{desktop-test-WSWXNSFS.js → desktop-test-TV64EY5A.js} +5 -4
- package/dist/chunks/{extension-3IKF6YQE.js → extension-XMWCG6YG.js} +9 -9
- package/dist/chunks/{help-DHGNXUA4.js → help-NEYFMHWQ.js} +1 -1
- package/dist/chunks/{opchat-XYKT5KKO.js → opchat-ZL5JJQ5L.js} +5 -4
- package/dist/chunks/{organizations-HKVC4CSA.js → organizations-4IEC35QB.js} +8 -7
- package/dist/chunks/{profile-PLWXQHKF.js → profile-EVASCDIN.js} +6 -5
- package/dist/chunks/{project-agent-JNSP56KG.js → project-agent-DMN64RZJ.js} +6 -5
- package/dist/chunks/{sandbox-command-Z6LNNSSL.js → sandbox-command-WKGVO32R.js} +6 -5
- package/dist/chunks/{sandbox-template-FVW2UTI4.js → sandbox-template-BJUS4KJM.js} +7 -6
- package/dist/chunks/{src-6UCIW76H.js → src-NJYDLJ2M.js} +727 -521
- package/dist/chunks/{src-2TP42H76.js → src-SR3UHNV4.js} +4 -4
- package/dist/chunks/{teams-bot-FNPT4Q2B.js → teams-bot-HUXYJ6XA.js} +5 -4
- package/dist/chunks/{workspaces-4A2OR2OP.js → workspaces-N2WWI77O.js} +2 -2
- package/dist/cli.js +13 -13
- package/dist/web/assets/{AppDialog-BEKS_Ixr.js → AppDialog-CxLYXiI1.js} +1 -1
- package/dist/web/assets/{AppsView-CbuT2sT2.js → AppsView-CVTUkahv.js} +1 -1
- package/dist/web/assets/{BrowserSidebar-DgqVeW5u.js → BrowserSidebar-oHniLA05.js} +1 -1
- package/dist/web/assets/{CommandMenu-CQcaEB76.js → CommandMenu-Db_5OiKs.js} +1 -1
- package/dist/web/assets/{CommunityView-CYX6iFcg.js → CommunityView-HTwMEO-T.js} +1 -1
- package/dist/web/assets/{ComposerCreateImproveStrip-DY4SQbL4.js → ComposerCreateImproveStrip-ER26yFe-.js} +1 -1
- package/dist/web/assets/{GetStartedView-DnxeZaBB.js → GetStartedView-l9MUYMYH.js} +1 -1
- package/dist/web/assets/{LabModelVersionDetailPage-DYTfYGWv.js → LabModelVersionDetailPage-Dgf-DlJi.js} +1 -1
- package/dist/web/assets/{LabSkillSidebar-BpD-kjP_.js → LabSkillSidebar-CyX8sVm1.js} +1 -1
- package/dist/web/assets/{LabsRoute-DVC7eZCs.js → LabsRoute-BC1ST9qT.js} +3 -3
- package/dist/web/assets/{MainChatThread-DTiX_8MC.js → MainChatThread-BfW92Rv1.js} +2 -2
- package/dist/web/assets/{MainPane-CNoHJkXy.js → MainPane-DlciH8yR.js} +3 -3
- package/dist/web/assets/{MarkdownText-_JhfBcQL.js → MarkdownText-CyOeCVjf.js} +1 -1
- package/dist/web/assets/{Messages-Bo0-Uvcz.js → Messages-BDtEbIKv.js} +1 -1
- package/dist/web/assets/{NativeSkillSidebar-CHQ87FW2.js → NativeSkillSidebar-D0BlvEtE.js} +1 -1
- package/dist/web/assets/{NewProjectDialog-B-1KuU5u.js → NewProjectDialog-CiGPfI5s.js} +1 -1
- package/dist/web/assets/{OutputsPage-BSimpEpA.js → OutputsPage-DNU2yD7q.js} +1 -1
- package/dist/web/assets/{RightChatPanelStack-B8ZOyuFO.js → RightChatPanelStack-Cs63fQwk.js} +1 -1
- package/dist/web/assets/{ScheduledWorkPage-Blwy1G8r.js → ScheduledWorkPage-DMKHFbeE.js} +1 -1
- package/dist/web/assets/{SettingsView-CTLTakyn.js → SettingsView-L0g-g2fL.js} +3 -3
- package/dist/web/assets/{TeamChatView-dN3fUCbZ.js → TeamChatView-CSVMTUAE.js} +1 -1
- package/dist/web/assets/{TerminalOverlay-CPVGeO7U.js → TerminalOverlay-Bb0RJR04.js} +1 -1
- package/dist/web/assets/{TrainingCreationPanel-ettNNJBP.js → TrainingCreationPanel-VIWlpVV2.js} +1 -1
- package/dist/web/assets/{TrainingDraftPanel-DUJBuII1.js → TrainingDraftPanel-MTYsR-Ry.js} +1 -1
- package/dist/web/assets/{UsageSettingsSection-BOZR3JE_.js → UsageSettingsSection-Cdc_jGFX.js} +1 -1
- package/dist/web/assets/{WorkspaceDiffPanel-99MjzMkW.js → WorkspaceDiffPanel-BgIbxMMu.js} +3 -3
- package/dist/web/assets/{WorkspaceEnvironmentMenu-C3s3mTyu.js → WorkspaceEnvironmentMenu-C97GqYn9.js} +1 -1
- package/dist/web/assets/{WorkspaceGitDialogs-BvurXjNP.js → WorkspaceGitDialogs-CK6ahRty.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-BCXg9mBQ.js → WorkspaceMonacoEditor-BQoN7jWa.js} +3 -3
- package/dist/web/assets/{arrow-up-right-DRIT5z3q.js → arrow-up-right-CzBZuWNj.js} +1 -1
- package/dist/web/assets/{chevron-up-Hglu-Zx3.js → chevron-up-DW-qEVSP.js} +1 -1
- package/dist/web/assets/{circle-alert-Crh3Zr2m.js → circle-alert-B_xROoPY.js} +1 -1
- package/dist/web/assets/{cloud-upload-mSm9KIL4.js → cloud-upload-CjLR-8-r.js} +1 -1
- package/dist/web/assets/{cssMode-CkQ4x6JA.js → cssMode-CQQJhS7v.js} +1 -1
- package/dist/web/assets/{folder-git-2-B8TV5i0V.js → folder-git-2-ktXin28y.js} +1 -1
- package/dist/web/assets/{folder-open-DXaun_C3.js → folder-open-BpUcIJHn.js} +1 -1
- package/dist/web/assets/{folder-plus-CUbTwu82.js → folder-plus-8NHsIAxQ.js} +1 -1
- package/dist/web/assets/{folder-DMeODEQJ.js → folder-tLv6TMN2.js} +1 -1
- package/dist/web/assets/{git-branch-CUlgF0kK.js → git-branch-DO3iP_fL.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-DAQfyhbS.js → git-commit-horizontal-BSWa2I3g.js} +1 -1
- package/dist/web/assets/{htmlMode-BfyAplZo.js → htmlMode-DaAKO9wk.js} +1 -1
- package/dist/web/assets/index-BtiK52K1.js +1 -0
- package/dist/web/assets/index-DHxBMQIJ.js +174 -0
- package/dist/web/assets/{info-Ll3PkeGE.js → info-DiEvrUda.js} +1 -1
- package/dist/web/assets/{jsonMode-C9Vibh0P.js → jsonMode-Biu1ZTZ7.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-CFoA9--Z.js → lspLanguageFeatures-lwoDxGgl.js} +1 -1
- package/dist/web/assets/{monaco.contribution-C2q-tDuk.js → monaco.contribution-BqQSY5-t.js} +2 -2
- package/dist/web/assets/{monaco.contribution-C8tRjUqy.js → monaco.contribution-Ce2MS2Nv.js} +2 -2
- package/dist/web/assets/{monaco.contribution-vWDjhuCI.js → monaco.contribution-DzHhgeLy.js} +2 -2
- package/dist/web/assets/{monaco.contribution-Co4ZPnCC.js → monaco.contribution-Ic8LKME8.js} +2 -2
- package/dist/web/assets/{play-lC5KpmRD.js → play-D9F3t5Cx.js} +1 -1
- package/dist/web/assets/{python-I5xkyvMs.js → python-BhVCwr-K.js} +1 -1
- package/dist/web/assets/{refresh-cw-8a_wz4tX.js → refresh-cw-DRN17xPU.js} +1 -1
- package/dist/web/assets/{save-Dj9ex3Ce.js → save-CDZwpzlG.js} +1 -1
- package/dist/web/assets/{square-DfEM9XgY.js → square-Cf_AXs4a.js} +1 -1
- package/dist/web/assets/{square-pen-CgX3HoJ6.js → square-pen-ChJgNiDm.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-BkNzz1Bg.js → toggleHighContrast-Bb_m9pXM.js} +1 -1
- package/dist/web/assets/{tsMode-CNwaV0ZJ.js → tsMode-BaWkaSHN.js} +1 -1
- package/dist/web/assets/{upload-Co5zYY9Z.js → upload-Cef29aCP.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-QY4_XS2F.js → useLocalAgentSchedules-CAAqoZ0V.js} +1 -1
- package/dist/web/assets/{wifi-off-CFzyn7Tf.js → wifi-off-C8cC22F6.js} +1 -1
- package/dist/web/assets/{workers-DqFxl1zu.js → workers-GOdHtcZt.js} +1 -1
- package/dist/web/assets/{yaml-Bbm66uDK.js → yaml-jBIxwMeR.js} +1 -1
- package/dist/web/index.html +1 -1
- package/docs/command-reference.md +21 -0
- package/package.json +2 -1
- package/dist/web/assets/index-Blindd8c.js +0 -1
- package/dist/web/assets/index-CDJX5ZxL.js +0 -174
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
assertSafeBranchName,
|
|
4
|
+
isGeneratedWorkspacePath,
|
|
5
|
+
listPlainWorkspaceFiles,
|
|
6
|
+
loadWorkspaceDiffAtPath,
|
|
7
|
+
loadWorkspaceStateAtPath,
|
|
8
|
+
normalizeWorkspaceFilePath,
|
|
9
|
+
readLocalImageFile,
|
|
10
|
+
runCommand,
|
|
11
|
+
truncatePatch,
|
|
12
|
+
uniqueSortedPaths,
|
|
13
|
+
workspaceImageContentType
|
|
14
|
+
} from "./chunk-BFR6VZ2A.js";
|
|
2
15
|
import {
|
|
3
16
|
AGENT_PROTOCOL_VERSION,
|
|
4
17
|
AGENT_RPC_METHODS,
|
|
@@ -16,32 +29,19 @@ import {
|
|
|
16
29
|
runProviderRound,
|
|
17
30
|
runProviderRoundLoop
|
|
18
31
|
} from "./chunk-NFNEENNR.js";
|
|
19
|
-
import {
|
|
20
|
-
getBundledRuntimeVersion,
|
|
21
|
-
loadOpenPondAccountContext,
|
|
22
|
-
loadOpenPondHostedModels,
|
|
23
|
-
streamOpenPondHostedChatTurn
|
|
24
|
-
} from "./chunk-EIRW6Z6S.js";
|
|
25
|
-
import {
|
|
26
|
-
assertSafeBranchName,
|
|
27
|
-
isGeneratedWorkspacePath,
|
|
28
|
-
listPlainWorkspaceFiles,
|
|
29
|
-
loadWorkspaceDiffAtPath,
|
|
30
|
-
loadWorkspaceStateAtPath,
|
|
31
|
-
normalizeWorkspaceFilePath,
|
|
32
|
-
readLocalImageFile,
|
|
33
|
-
runCommand,
|
|
34
|
-
truncatePatch,
|
|
35
|
-
uniqueSortedPaths,
|
|
36
|
-
workspaceImageContentType
|
|
37
|
-
} from "./chunk-H44J7BB4.js";
|
|
38
32
|
import {
|
|
39
33
|
HOSTED_CHAT_SYSTEM_PROMPT,
|
|
40
34
|
VERSION,
|
|
41
35
|
event,
|
|
42
36
|
now,
|
|
43
37
|
textFromUnknown
|
|
44
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-OI65U2B5.js";
|
|
39
|
+
import {
|
|
40
|
+
getBundledRuntimeVersion,
|
|
41
|
+
loadOpenPondAccountContext,
|
|
42
|
+
loadOpenPondHostedModels,
|
|
43
|
+
streamOpenPondHostedChatTurn
|
|
44
|
+
} from "./chunk-LMQ4MPQI.js";
|
|
45
45
|
import {
|
|
46
46
|
AppPreferencesSchema,
|
|
47
47
|
ApplyCreateImproveRunActionRequestSchema,
|
|
@@ -158,7 +158,7 @@ import {
|
|
|
158
158
|
runAgentSdkProjectCommand,
|
|
159
159
|
runProfileSkillCommand,
|
|
160
160
|
sidebarFileBookmarkId
|
|
161
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-PVGJXCAK.js";
|
|
162
162
|
import {
|
|
163
163
|
AgentSnapshotSchema,
|
|
164
164
|
AttemptReceiptSchema,
|
|
@@ -236,7 +236,7 @@ import {
|
|
|
236
236
|
stableId,
|
|
237
237
|
uniqueEventRefs,
|
|
238
238
|
validateConnectedAppProviderOperationRequest
|
|
239
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-VG4H4TQG.js";
|
|
240
240
|
import {
|
|
241
241
|
external_exports
|
|
242
242
|
} from "./chunk-WYDVQOBL.js";
|
|
@@ -246,7 +246,7 @@ import {
|
|
|
246
246
|
createOpenPondSandboxClient,
|
|
247
247
|
normalizeSandboxApiUrl,
|
|
248
248
|
withVercelProtectionBypass
|
|
249
|
-
} from "./chunk-
|
|
249
|
+
} from "./chunk-DXSHQ6TO.js";
|
|
250
250
|
import {
|
|
251
251
|
__commonJS,
|
|
252
252
|
__toESM
|
|
@@ -7864,11 +7864,16 @@ function executableSearchPath(environment = process.env, platform = process.plat
|
|
|
7864
7864
|
}
|
|
7865
7865
|
|
|
7866
7866
|
// ../server/src/harness/local-harness-refiner-context.ts
|
|
7867
|
-
var MAX_REFINER_SOURCE_BYTES =
|
|
7867
|
+
var MAX_REFINER_SOURCE_BYTES = 36e3;
|
|
7868
7868
|
var MAX_PDF_ARTIFACTS = 10;
|
|
7869
7869
|
var MAX_PDF_BYTES = 20 * 1024 * 1024;
|
|
7870
|
+
var MAX_REVIEW_TIMELINE_EVENTS = 40;
|
|
7871
|
+
var MAX_REVIEW_TIMELINE_CHARS = 24e3;
|
|
7872
|
+
var MAX_PRIOR_CONVERSATION_TURNS = 3;
|
|
7873
|
+
var MAX_PRIOR_INCIDENTS = 3;
|
|
7874
|
+
var MAX_PRIOR_INCIDENT_TIMELINE_EVENTS = 6;
|
|
7870
7875
|
var execFileAsync = promisify(execFile);
|
|
7871
|
-
async function loadBoundedRefinerContext(store, trigger, observations) {
|
|
7876
|
+
async function loadBoundedRefinerContext(store, trigger, observations, workspaceId) {
|
|
7872
7877
|
const [session, turn, events, turns, usageRecords] = await Promise.all([
|
|
7873
7878
|
store.getSession(trigger.runRef),
|
|
7874
7879
|
store.getTurn(trigger.turnId),
|
|
@@ -7918,6 +7923,30 @@ async function loadBoundedRefinerContext(store, trigger, observations) {
|
|
|
7918
7923
|
0
|
|
7919
7924
|
) || receiptProfile.totalTokens
|
|
7920
7925
|
};
|
|
7926
|
+
const executionProfile = {
|
|
7927
|
+
modelRequestCount: durableUsage.modelRequestCount,
|
|
7928
|
+
failedModelRequestCount: usageRecords.filter(
|
|
7929
|
+
(record9) => record9.status === "failed" || record9.status === "interrupted"
|
|
7930
|
+
).length,
|
|
7931
|
+
promptTokens: durableUsage.promptTokens,
|
|
7932
|
+
completionTokens: durableUsage.completionTokens,
|
|
7933
|
+
totalTokens: durableUsage.totalTokens,
|
|
7934
|
+
toolFailureCount: observationKinds.filter((kind) => kind === "tool_failure").length,
|
|
7935
|
+
retryCount: observationKinds.filter((kind) => kind === "retry").length,
|
|
7936
|
+
recoveryCount: observationKinds.filter((kind) => kind === "recovery").length
|
|
7937
|
+
};
|
|
7938
|
+
const artifactDiagnostics = await inspectBoundedPdfArtifactDiagnostics(session?.cwd);
|
|
7939
|
+
const timelineCandidates = events.filter(
|
|
7940
|
+
(runtimeEvent) => runtimeEvent.turnId === trigger.turnId && isRefinerReviewTimelineEvent(runtimeEvent) && (runtimeEvent.sequence === void 0 || runtimeEvent.sequence <= trigger.boundary.eventSequence)
|
|
7941
|
+
).sort(compareRuntimeEvents);
|
|
7942
|
+
const timeline = boundedReviewTimeline(timelineCandidates);
|
|
7943
|
+
const priorConversation = orderedTurns.slice(Math.max(0, turnIndex - MAX_PRIOR_CONVERSATION_TURNS), Math.max(0, turnIndex)).map((candidate) => conversationTurn(candidate, events));
|
|
7944
|
+
const priorIncidents = workspaceId ? await loadRelevantPriorIncidentPackets({
|
|
7945
|
+
store,
|
|
7946
|
+
workspaceId,
|
|
7947
|
+
trigger,
|
|
7948
|
+
observations
|
|
7949
|
+
}) : [];
|
|
7921
7950
|
return {
|
|
7922
7951
|
task: {
|
|
7923
7952
|
prompt: turn?.prompt ? redactAndBoundRefinerText(turn.prompt, 8e3) : null,
|
|
@@ -7925,19 +7954,8 @@ async function loadBoundedRefinerContext(store, trigger, observations) {
|
|
|
7925
7954
|
assistantOutputLinkCount: countAbsoluteLinks(assistantOutput),
|
|
7926
7955
|
previousAssistantOutput: previousTurn ? assistantOutputForTurn(events, previousTurn.id) : null
|
|
7927
7956
|
},
|
|
7928
|
-
artifactDiagnostics
|
|
7929
|
-
executionProfile
|
|
7930
|
-
modelRequestCount: durableUsage.modelRequestCount,
|
|
7931
|
-
failedModelRequestCount: usageRecords.filter(
|
|
7932
|
-
(record9) => record9.status === "failed" || record9.status === "interrupted"
|
|
7933
|
-
).length,
|
|
7934
|
-
promptTokens: durableUsage.promptTokens,
|
|
7935
|
-
completionTokens: durableUsage.completionTokens,
|
|
7936
|
-
totalTokens: durableUsage.totalTokens,
|
|
7937
|
-
toolFailureCount: observationKinds.filter((kind) => kind === "tool_failure").length,
|
|
7938
|
-
retryCount: observationKinds.filter((kind) => kind === "retry").length,
|
|
7939
|
-
recoveryCount: observationKinds.filter((kind) => kind === "recovery").length
|
|
7940
|
-
},
|
|
7957
|
+
artifactDiagnostics,
|
|
7958
|
+
executionProfile,
|
|
7941
7959
|
eventExcerpts: evidenceEvents.map((runtimeEvent) => {
|
|
7942
7960
|
const data = asRecord(runtimeEvent.data);
|
|
7943
7961
|
const result = asRecord(data.result);
|
|
@@ -7954,9 +7972,242 @@ async function loadBoundedRefinerContext(store, trigger, observations) {
|
|
|
7954
7972
|
stderr: textField(result.stderr, 3e3),
|
|
7955
7973
|
stdout: textField(result.stdout, 3e3)
|
|
7956
7974
|
};
|
|
7957
|
-
})
|
|
7975
|
+
}),
|
|
7976
|
+
reviewPacket: {
|
|
7977
|
+
currentTurn: {
|
|
7978
|
+
id: trigger.turnId,
|
|
7979
|
+
status: turn?.status ?? null,
|
|
7980
|
+
error: turn?.error ? redactAndBoundRefinerText(turn.error, 2e3) : null,
|
|
7981
|
+
prompt: turn?.prompt ? redactAndBoundRefinerText(turn.prompt, 8e3) : null,
|
|
7982
|
+
assistantOutput,
|
|
7983
|
+
assistantOutputLinkCount: countAbsoluteLinks(assistantOutput)
|
|
7984
|
+
},
|
|
7985
|
+
priorConversation,
|
|
7986
|
+
timeline,
|
|
7987
|
+
artifacts: fileOutputInventory(events, trigger.turnId),
|
|
7988
|
+
artifactDiagnostics,
|
|
7989
|
+
executionProfile,
|
|
7990
|
+
priorIncidents,
|
|
7991
|
+
truncation: {
|
|
7992
|
+
timelineEventCount: timelineCandidates.length,
|
|
7993
|
+
includedTimelineEventCount: timeline.length,
|
|
7994
|
+
timelineTruncated: timeline.length < timelineCandidates.length
|
|
7995
|
+
}
|
|
7996
|
+
}
|
|
7997
|
+
};
|
|
7998
|
+
}
|
|
7999
|
+
function conversationTurn(turn, events) {
|
|
8000
|
+
return {
|
|
8001
|
+
turnId: turn.id,
|
|
8002
|
+
status: turn.status,
|
|
8003
|
+
prompt: turn.prompt ? redactAndBoundRefinerText(turn.prompt, 3e3) : null,
|
|
8004
|
+
assistantOutput: assistantOutputForTurn(events, turn.id, 3e3)
|
|
7958
8005
|
};
|
|
7959
8006
|
}
|
|
8007
|
+
function boundedReviewTimeline(events) {
|
|
8008
|
+
const mapped = events.map(reviewTimelineEntry);
|
|
8009
|
+
if (mapped.length <= MAX_REVIEW_TIMELINE_EVENTS) {
|
|
8010
|
+
return fitTimelineToCharacterBudget(mapped);
|
|
8011
|
+
}
|
|
8012
|
+
const important = mapped.filter(
|
|
8013
|
+
(entry) => entry.status === "failed" || entry.name === "turn.completed" || entry.name === "turn.failed" || entry.name === "turn.interrupted" || entry.name === "skill.loaded" || entry.name === "validation.completed" || entry.name === "diagnostic"
|
|
8014
|
+
);
|
|
8015
|
+
const retainedKeys = new Set(important.map(timelineEntryKey));
|
|
8016
|
+
const remaining = mapped.filter((entry) => !retainedKeys.has(timelineEntryKey(entry))).slice(-(MAX_REVIEW_TIMELINE_EVENTS - Math.min(important.length, MAX_REVIEW_TIMELINE_EVENTS)));
|
|
8017
|
+
return fitTimelineToCharacterBudget(
|
|
8018
|
+
[...important.slice(-MAX_REVIEW_TIMELINE_EVENTS), ...remaining].sort((left, right) => Number(left.sequence ?? 0) - Number(right.sequence ?? 0))
|
|
8019
|
+
);
|
|
8020
|
+
}
|
|
8021
|
+
function fitTimelineToCharacterBudget(entries) {
|
|
8022
|
+
const retained = [];
|
|
8023
|
+
let used = 0;
|
|
8024
|
+
for (const entry of entries) {
|
|
8025
|
+
const size = JSON.stringify(entry).length;
|
|
8026
|
+
if (used + size > MAX_REVIEW_TIMELINE_CHARS) continue;
|
|
8027
|
+
retained.push(entry);
|
|
8028
|
+
used += size;
|
|
8029
|
+
}
|
|
8030
|
+
return retained;
|
|
8031
|
+
}
|
|
8032
|
+
function reviewTimelineEntry(runtimeEvent) {
|
|
8033
|
+
const data = asRecord(runtimeEvent.data);
|
|
8034
|
+
const result = asRecord(data.result);
|
|
8035
|
+
return {
|
|
8036
|
+
sequence: runtimeEvent.sequence ?? null,
|
|
8037
|
+
timestamp: runtimeEvent.timestamp,
|
|
8038
|
+
name: runtimeEvent.name,
|
|
8039
|
+
action: runtimeEvent.action ?? (typeof data.tool === "string" ? data.tool : null),
|
|
8040
|
+
status: runtimeEvent.status ?? null,
|
|
8041
|
+
args: boundedUnknown(runtimeEvent.args, 1500),
|
|
8042
|
+
command: textField(result.command, 2e3),
|
|
8043
|
+
error: textField(runtimeEvent.error, 2e3),
|
|
8044
|
+
output: textField(result.output, 2e3) ?? textField(runtimeEvent.output, 2e3),
|
|
8045
|
+
exitCode: typeof result.exitCode === "number" ? result.exitCode : null,
|
|
8046
|
+
timedOut: result.timedOut === true,
|
|
8047
|
+
stderr: textField(result.stderr, 2e3),
|
|
8048
|
+
stdout: textField(result.stdout, 2e3)
|
|
8049
|
+
};
|
|
8050
|
+
}
|
|
8051
|
+
function timelineEntryKey(entry) {
|
|
8052
|
+
return `${entry.sequence ?? "none"}:${entry.name ?? "unknown"}:${entry.action ?? "none"}`;
|
|
8053
|
+
}
|
|
8054
|
+
function fileOutputInventory(events, turnId) {
|
|
8055
|
+
const byRevision = /* @__PURE__ */ new Map();
|
|
8056
|
+
for (const runtimeEvent of events) {
|
|
8057
|
+
if (runtimeEvent.turnId !== turnId) continue;
|
|
8058
|
+
for (const output of findFileOutputRefs(runtimeEvent.data)) {
|
|
8059
|
+
byRevision.set(`${output.id}:${output.revision}`, output);
|
|
8060
|
+
}
|
|
8061
|
+
}
|
|
8062
|
+
return [...byRevision.values()].sort((left, right) => left.title.localeCompare(right.title) || left.revision - right.revision).slice(0, 30).map((output) => ({
|
|
8063
|
+
id: output.id,
|
|
8064
|
+
title: output.title,
|
|
8065
|
+
revision: output.revision,
|
|
8066
|
+
contentType: output.contentType,
|
|
8067
|
+
sizeBytes: output.sizeBytes,
|
|
8068
|
+
sha256: output.sha256,
|
|
8069
|
+
locationKind: output.location.kind,
|
|
8070
|
+
validation: output.validation.map((validation) => ({
|
|
8071
|
+
kind: validation.kind,
|
|
8072
|
+
status: validation.status,
|
|
8073
|
+
label: validation.label,
|
|
8074
|
+
detail: validation.detail ?? null
|
|
8075
|
+
}))
|
|
8076
|
+
}));
|
|
8077
|
+
}
|
|
8078
|
+
function findFileOutputRefs(value, depth = 0) {
|
|
8079
|
+
if (depth > 8) return [];
|
|
8080
|
+
const parsed = FileOutputRefSchema.safeParse(value);
|
|
8081
|
+
if (parsed.success) return [parsed.data];
|
|
8082
|
+
if (Array.isArray(value)) {
|
|
8083
|
+
return value.flatMap((item) => findFileOutputRefs(item, depth + 1));
|
|
8084
|
+
}
|
|
8085
|
+
if (!value || typeof value !== "object") return [];
|
|
8086
|
+
return Object.values(value).flatMap(
|
|
8087
|
+
(item) => findFileOutputRefs(item, depth + 1)
|
|
8088
|
+
);
|
|
8089
|
+
}
|
|
8090
|
+
async function loadRelevantPriorIncidentPackets(input) {
|
|
8091
|
+
const currentClasses = new Set(
|
|
8092
|
+
input.observations.flatMap(
|
|
8093
|
+
(observation) => observation.deterministicClass ? [observation.deterministicClass] : []
|
|
8094
|
+
)
|
|
8095
|
+
);
|
|
8096
|
+
const currentTools = new Set(
|
|
8097
|
+
input.observations.flatMap((observation) => observation.tool ? [observation.tool.name] : [])
|
|
8098
|
+
);
|
|
8099
|
+
if (currentClasses.size === 0 && currentTools.size === 0) return [];
|
|
8100
|
+
const available = (await input.store.listHarnessImprovementArtifacts(
|
|
8101
|
+
input.workspaceId,
|
|
8102
|
+
"observation",
|
|
8103
|
+
200
|
|
8104
|
+
)).filter(
|
|
8105
|
+
(observation) => observation.runRef !== input.trigger.runRef && observation.turnId !== input.trigger.turnId && (observation.deterministicClass !== null && currentClasses.has(observation.deterministicClass) || observation.tool !== null && currentTools.has(observation.tool.name))
|
|
8106
|
+
).sort((left, right) => right.createdAt.localeCompare(left.createdAt));
|
|
8107
|
+
const byTurn = /* @__PURE__ */ new Map();
|
|
8108
|
+
for (const observation of available) {
|
|
8109
|
+
const key = `${observation.runRef}:${observation.turnId}`;
|
|
8110
|
+
const list = byTurn.get(key) ?? [];
|
|
8111
|
+
list.push(observation);
|
|
8112
|
+
byTurn.set(key, list);
|
|
8113
|
+
}
|
|
8114
|
+
const packets = [];
|
|
8115
|
+
for (const group of byTurn.values()) {
|
|
8116
|
+
if (packets.length >= MAX_PRIOR_INCIDENTS) break;
|
|
8117
|
+
const first = group[0];
|
|
8118
|
+
const [turn, events] = await Promise.all([
|
|
8119
|
+
input.store.getTurn(first.turnId),
|
|
8120
|
+
input.store.runtimeEventsForSession(first.runRef, { limit: 1e3 })
|
|
8121
|
+
]);
|
|
8122
|
+
if (!turn) continue;
|
|
8123
|
+
const matchingClasses = [...new Set(group.flatMap(
|
|
8124
|
+
(observation) => observation.deterministicClass && currentClasses.has(observation.deterministicClass) ? [observation.deterministicClass] : []
|
|
8125
|
+
))];
|
|
8126
|
+
const matchingTools = [...new Set(group.flatMap(
|
|
8127
|
+
(observation) => observation.tool && currentTools.has(observation.tool.name) ? [observation.tool.name] : []
|
|
8128
|
+
))];
|
|
8129
|
+
const timeline = priorIncidentTimeline(
|
|
8130
|
+
events.filter((runtimeEvent) => runtimeEvent.turnId === turn.id)
|
|
8131
|
+
);
|
|
8132
|
+
packets.push({
|
|
8133
|
+
runRef: first.runRef,
|
|
8134
|
+
turnId: first.turnId,
|
|
8135
|
+
createdAt: first.createdAt,
|
|
8136
|
+
matchedBy: {
|
|
8137
|
+
deterministicClasses: matchingClasses,
|
|
8138
|
+
tools: matchingTools
|
|
8139
|
+
},
|
|
8140
|
+
observations: group.slice(0, 4).map((observation) => ({
|
|
8141
|
+
kind: observation.kind,
|
|
8142
|
+
state: observation.state,
|
|
8143
|
+
deterministicClass: observation.deterministicClass,
|
|
8144
|
+
summary: observation.summary
|
|
8145
|
+
})),
|
|
8146
|
+
prompt: turn.prompt ? redactAndBoundRefinerText(turn.prompt, 1200) : null,
|
|
8147
|
+
assistantOutput: assistantOutputForTurn(events, turn.id, 1200),
|
|
8148
|
+
timeline,
|
|
8149
|
+
artifacts: fileOutputInventory(events, turn.id).slice(0, 5)
|
|
8150
|
+
});
|
|
8151
|
+
}
|
|
8152
|
+
return packets;
|
|
8153
|
+
}
|
|
8154
|
+
function priorIncidentTimeline(events) {
|
|
8155
|
+
const terminalNames = /* @__PURE__ */ new Set(["turn.completed", "turn.failed", "turn.interrupted"]);
|
|
8156
|
+
const candidates = events.filter((runtimeEvent) => {
|
|
8157
|
+
if (terminalNames.has(runtimeEvent.name)) return true;
|
|
8158
|
+
const serialized = JSON.stringify({
|
|
8159
|
+
error: runtimeEvent.error,
|
|
8160
|
+
output: runtimeEvent.output,
|
|
8161
|
+
data: runtimeEvent.data
|
|
8162
|
+
});
|
|
8163
|
+
return runtimeEvent.status === "failed" || /"ok"\s*:\s*false|failed|denied|unavailable|timed?\s*out|exception|traceback/i.test(serialized);
|
|
8164
|
+
}).sort(compareRuntimeEvents).map((runtimeEvent) => {
|
|
8165
|
+
const entry = reviewTimelineEntry(runtimeEvent);
|
|
8166
|
+
return {
|
|
8167
|
+
sequence: entry.sequence,
|
|
8168
|
+
name: entry.name,
|
|
8169
|
+
action: entry.action,
|
|
8170
|
+
status: entry.status,
|
|
8171
|
+
error: textField(entry.error, 800),
|
|
8172
|
+
output: textField(entry.output, 800),
|
|
8173
|
+
exitCode: entry.exitCode,
|
|
8174
|
+
timedOut: entry.timedOut
|
|
8175
|
+
};
|
|
8176
|
+
});
|
|
8177
|
+
const unique2 = /* @__PURE__ */ new Map();
|
|
8178
|
+
for (const entry of candidates) {
|
|
8179
|
+
const signature = JSON.stringify({
|
|
8180
|
+
name: entry.name,
|
|
8181
|
+
action: entry.action,
|
|
8182
|
+
status: entry.status,
|
|
8183
|
+
error: entry.error,
|
|
8184
|
+
output: entry.output,
|
|
8185
|
+
exitCode: entry.exitCode,
|
|
8186
|
+
timedOut: entry.timedOut
|
|
8187
|
+
});
|
|
8188
|
+
const existing = unique2.get(signature);
|
|
8189
|
+
if (existing) {
|
|
8190
|
+
existing.occurrenceCount += 1;
|
|
8191
|
+
continue;
|
|
8192
|
+
}
|
|
8193
|
+
unique2.set(signature, { ...entry, occurrenceCount: 1 });
|
|
8194
|
+
}
|
|
8195
|
+
const compact = [...unique2.values()];
|
|
8196
|
+
if (compact.length <= MAX_PRIOR_INCIDENT_TIMELINE_EVENTS) return compact;
|
|
8197
|
+
return [
|
|
8198
|
+
...compact.slice(0, MAX_PRIOR_INCIDENT_TIMELINE_EVENTS - 2),
|
|
8199
|
+
...compact.slice(-2)
|
|
8200
|
+
];
|
|
8201
|
+
}
|
|
8202
|
+
function boundedUnknown(value, maxLength) {
|
|
8203
|
+
if (value === void 0) return null;
|
|
8204
|
+
try {
|
|
8205
|
+
const text = redactAndBoundRefinerText(JSON.stringify(value), maxLength);
|
|
8206
|
+
return JSON.parse(text.endsWith("\n[truncated]") ? JSON.stringify(text) : text);
|
|
8207
|
+
} catch {
|
|
8208
|
+
return redactAndBoundRefinerText(String(value), maxLength);
|
|
8209
|
+
}
|
|
8210
|
+
}
|
|
7960
8211
|
function tasksetGradeExecutionProfile(events, turnId) {
|
|
7961
8212
|
const fallback = {
|
|
7962
8213
|
modelRequestCount: 0,
|
|
@@ -8074,11 +8325,11 @@ function countAbsoluteLinks(value) {
|
|
|
8074
8325
|
if (!value) return 0;
|
|
8075
8326
|
return value.match(/https?:\/\/[^\s<>)\]}"']+/gi)?.length ?? 0;
|
|
8076
8327
|
}
|
|
8077
|
-
function assistantOutputForTurn(events, turnId) {
|
|
8328
|
+
function assistantOutputForTurn(events, turnId, maxLength = 8e3) {
|
|
8078
8329
|
const output = events.filter(
|
|
8079
8330
|
(runtimeEvent) => runtimeEvent.turnId === turnId && runtimeEvent.name === "assistant.delta" && typeof runtimeEvent.output === "string"
|
|
8080
8331
|
).sort(compareRuntimeEvents).map((runtimeEvent) => runtimeEvent.output).join("");
|
|
8081
|
-
return output ? redactAndBoundRefinerText(output,
|
|
8332
|
+
return output ? redactAndBoundRefinerText(output, maxLength) : null;
|
|
8082
8333
|
}
|
|
8083
8334
|
async function loadExactObservations(store, workspaceId, trigger) {
|
|
8084
8335
|
const available = await store.listHarnessImprovementArtifacts(
|
|
@@ -8115,7 +8366,14 @@ async function readBoundedRefinerSource(bundlePath, trigger) {
|
|
|
8115
8366
|
kind: file.kind,
|
|
8116
8367
|
loaded: file.kind === "skill" && loadedSkillNames.has(skillNameFromPath(file.path))
|
|
8117
8368
|
}));
|
|
8118
|
-
|
|
8369
|
+
const rankedFiles = manifest.files.slice().sort((left, right) => {
|
|
8370
|
+
const leftLoaded = left.kind === "skill" && loadedSkillNames.has(skillNameFromPath(left.path));
|
|
8371
|
+
const rightLoaded = right.kind === "skill" && loadedSkillNames.has(skillNameFromPath(right.path));
|
|
8372
|
+
if (leftLoaded !== rightLoaded) return leftLoaded ? -1 : 1;
|
|
8373
|
+
const rank = (kind) => kind === "instruction" ? 0 : kind === "skill" ? 1 : 2;
|
|
8374
|
+
return rank(left.kind) - rank(right.kind) || left.path.localeCompare(right.path);
|
|
8375
|
+
});
|
|
8376
|
+
for (const file of rankedFiles) {
|
|
8119
8377
|
if (!["instruction", "skill", "agent"].includes(file.kind) || file.visibility !== "policy" || !["text/markdown", "text/plain", "text/javascript"].includes(file.mediaType)) {
|
|
8120
8378
|
continue;
|
|
8121
8379
|
}
|
|
@@ -8156,6 +8414,18 @@ function isRefinerEvidenceEvent(runtimeEvent) {
|
|
|
8156
8414
|
"diagnostic"
|
|
8157
8415
|
].includes(runtimeEvent.name);
|
|
8158
8416
|
}
|
|
8417
|
+
function isRefinerReviewTimelineEvent(runtimeEvent) {
|
|
8418
|
+
return [
|
|
8419
|
+
"turn.completed",
|
|
8420
|
+
"turn.failed",
|
|
8421
|
+
"turn.interrupted",
|
|
8422
|
+
"tool.completed",
|
|
8423
|
+
"workspace_action_result",
|
|
8424
|
+
"skill.loaded",
|
|
8425
|
+
"validation.completed",
|
|
8426
|
+
"diagnostic"
|
|
8427
|
+
].includes(runtimeEvent.name);
|
|
8428
|
+
}
|
|
8159
8429
|
function compareRuntimeEvents(left, right) {
|
|
8160
8430
|
return (left.sequence ?? Number.MAX_SAFE_INTEGER) - (right.sequence ?? Number.MAX_SAFE_INTEGER);
|
|
8161
8431
|
}
|
|
@@ -9693,6 +9963,11 @@ async function refreshOpenAiSubscriptionToken(refreshToken) {
|
|
|
9693
9963
|
client_id: OPENAI_OAUTH_CLIENT_ID
|
|
9694
9964
|
}).toString()
|
|
9695
9965
|
});
|
|
9966
|
+
if (response.status === 401) {
|
|
9967
|
+
throw new Error(
|
|
9968
|
+
"Your OpenAI ChatGPT sign-in has expired or was invalidated. Reconnect it in Settings > Providers > OpenAI > Subscription by selecting Connect ChatGPT. This is an authentication issue, not a billing or model-access error."
|
|
9969
|
+
);
|
|
9970
|
+
}
|
|
9696
9971
|
if (!response.ok) throw new Error(`OpenAI token refresh failed: ${response.status}`);
|
|
9697
9972
|
return await response.json();
|
|
9698
9973
|
}
|
|
@@ -11078,41 +11353,13 @@ async function runLocalHarnessRefinerWorker(input) {
|
|
|
11078
11353
|
const boundedContext = await loadBoundedRefinerContext(
|
|
11079
11354
|
input.store,
|
|
11080
11355
|
trigger,
|
|
11081
|
-
observations
|
|
11082
|
-
|
|
11083
|
-
const currentObservationHashes = new Set(
|
|
11084
|
-
observations.map((observation) => observation.contentHash)
|
|
11356
|
+
observations,
|
|
11357
|
+
workspace.id
|
|
11085
11358
|
);
|
|
11086
|
-
const recentObservations = (await input.store.listHarnessImprovementArtifacts(
|
|
11087
|
-
workspace.id,
|
|
11088
|
-
"observation",
|
|
11089
|
-
100
|
|
11090
|
-
)).filter((observation) => !currentObservationHashes.has(observation.contentHash)).sort((left, right) => right.createdAt.localeCompare(left.createdAt)).slice(0, 20).map((observation) => ({
|
|
11091
|
-
...boundedObservationEvidence(observation),
|
|
11092
|
-
runRef: observation.runRef,
|
|
11093
|
-
turnId: observation.turnId,
|
|
11094
|
-
createdAt: observation.createdAt
|
|
11095
|
-
}));
|
|
11096
|
-
const recentOutcomes = (await input.store.listHarnessImprovementArtifacts(
|
|
11097
|
-
workspace.id,
|
|
11098
|
-
"refiner_outcome",
|
|
11099
|
-
100
|
|
11100
|
-
)).filter((outcome) => outcome.trigger.contentHash !== trigger.contentHash).sort((left, right) => right.createdAt.localeCompare(left.createdAt)).slice(0, 8).map((outcome) => ({
|
|
11101
|
-
id: outcome.id,
|
|
11102
|
-
decision: outcome.decision,
|
|
11103
|
-
reason: outcome.reason,
|
|
11104
|
-
createdAt: outcome.createdAt,
|
|
11105
|
-
triggerId: outcome.trigger.id
|
|
11106
|
-
}));
|
|
11107
11359
|
const refinerEvidence = {
|
|
11108
11360
|
trigger: boundedTriggerEvidence(trigger),
|
|
11109
11361
|
observations: observations.map(boundedObservationEvidence),
|
|
11110
|
-
|
|
11111
|
-
eventExcerpts: boundedContext.eventExcerpts,
|
|
11112
|
-
artifactDiagnostics: boundedContext.artifactDiagnostics,
|
|
11113
|
-
executionProfile: boundedContext.executionProfile,
|
|
11114
|
-
recentObservations,
|
|
11115
|
-
recentOutcomes,
|
|
11362
|
+
reviewPacket: boundedContext.reviewPacket,
|
|
11116
11363
|
sourceFiles: source.files,
|
|
11117
11364
|
sourceCatalog: source.catalog,
|
|
11118
11365
|
additionalEvidence: input.additionalEvidence ?? null
|
|
@@ -26537,6 +26784,66 @@ function collectJsonStrings(value, output, depth = 0) {
|
|
|
26537
26784
|
}
|
|
26538
26785
|
}
|
|
26539
26786
|
|
|
26787
|
+
// ../server/src/project-actions/hosted-project-action-model-tool.ts
|
|
26788
|
+
async function executeHostedProjectActionModelTool(input) {
|
|
26789
|
+
const { action, context, implementation, resultToolName } = input;
|
|
26790
|
+
if (!input.executeProjectAction) {
|
|
26791
|
+
return failedResult(context.callId, resultToolName, `Action ${action.id} is a hosted Project Action, but hosted action execution is not configured.`);
|
|
26792
|
+
}
|
|
26793
|
+
const projectId = stringValue7(implementation.projectId);
|
|
26794
|
+
const teamId = stringValue7(implementation.teamId);
|
|
26795
|
+
const releaseId = stringValue7(implementation.releaseId);
|
|
26796
|
+
const projectActionId = stringValue7(implementation.actionId) ?? action.id;
|
|
26797
|
+
if (!projectId || !teamId || !releaseId) {
|
|
26798
|
+
return failedResult(context.callId, resultToolName, `Action ${action.id} is missing its hosted Project Action release binding.`);
|
|
26799
|
+
}
|
|
26800
|
+
if (input.requestedProjectId && input.requestedProjectId !== projectId) {
|
|
26801
|
+
return failedResult(context.callId, resultToolName, `Project ${input.requestedProjectId} is not authorized for action ${action.id}.`);
|
|
26802
|
+
}
|
|
26803
|
+
const result = await input.executeProjectAction({
|
|
26804
|
+
action: projectActionId,
|
|
26805
|
+
input: input.actionInput,
|
|
26806
|
+
metadata: {
|
|
26807
|
+
source: "openpond_hosted_project_action",
|
|
26808
|
+
execution: "hosted",
|
|
26809
|
+
projectId,
|
|
26810
|
+
teamId,
|
|
26811
|
+
releaseId,
|
|
26812
|
+
selectedActionId: projectActionId,
|
|
26813
|
+
selectedActionLabel: action.label ?? action.name ?? projectActionId,
|
|
26814
|
+
selectedBy: "native_model_tool",
|
|
26815
|
+
displayPrompt: context.userPrompt,
|
|
26816
|
+
sessionId: context.session.id,
|
|
26817
|
+
turnId: context.turnId,
|
|
26818
|
+
toolCallId: context.callId
|
|
26819
|
+
}
|
|
26820
|
+
});
|
|
26821
|
+
return {
|
|
26822
|
+
toolCallId: context.callId,
|
|
26823
|
+
name: resultToolName,
|
|
26824
|
+
ok: true,
|
|
26825
|
+
contentText: JSON.stringify({
|
|
26826
|
+
ok: true,
|
|
26827
|
+
action: resultToolName,
|
|
26828
|
+
output: `Ran hosted Project Action ${projectActionId}.`,
|
|
26829
|
+
data: { result }
|
|
26830
|
+
}, null, 2),
|
|
26831
|
+
data: { result }
|
|
26832
|
+
};
|
|
26833
|
+
}
|
|
26834
|
+
function failedResult(callId, name, error) {
|
|
26835
|
+
return {
|
|
26836
|
+
toolCallId: callId,
|
|
26837
|
+
name,
|
|
26838
|
+
ok: false,
|
|
26839
|
+
contentText: JSON.stringify({ ok: false, action: name, error }, null, 2),
|
|
26840
|
+
data: { error }
|
|
26841
|
+
};
|
|
26842
|
+
}
|
|
26843
|
+
function stringValue7(value) {
|
|
26844
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
26845
|
+
}
|
|
26846
|
+
|
|
26540
26847
|
// ../server/src/openpond/model-tool-registry.ts
|
|
26541
26848
|
function enabledModelToolDefinitions(definitions, context) {
|
|
26542
26849
|
return definitions.filter((definition) => definition.enabled?.(context) ?? true);
|
|
@@ -27491,8 +27798,8 @@ function createOpenPondActionModelToolDefinitions(deps) {
|
|
|
27491
27798
|
resultToolName: "openpond_action_run",
|
|
27492
27799
|
compactProfileResultForModel: true,
|
|
27493
27800
|
input: asRecord7(context.args.input) ?? {},
|
|
27494
|
-
requestedProjectId:
|
|
27495
|
-
requestedAgentId:
|
|
27801
|
+
requestedProjectId: stringValue8(context.args.projectId) ?? void 0,
|
|
27802
|
+
requestedAgentId: stringValue8(context.args.agentId) ?? void 0
|
|
27496
27803
|
});
|
|
27497
27804
|
}
|
|
27498
27805
|
}
|
|
@@ -27505,7 +27812,7 @@ function directOpenPondActionToolName(action) {
|
|
|
27505
27812
|
return `agent_${slug}_${suffix}`;
|
|
27506
27813
|
}
|
|
27507
27814
|
function directOpenPondActionAliasName(action) {
|
|
27508
|
-
const name =
|
|
27815
|
+
const name = stringValue8(asRecord7(action.implementation)?.actionId) ?? action.sourceActionId ?? action.name ?? action.id;
|
|
27509
27816
|
return /^[A-Za-z0-9_-]{1,64}$/.test(name) ? name : null;
|
|
27510
27817
|
}
|
|
27511
27818
|
function actionInputSchema(action) {
|
|
@@ -27536,8 +27843,8 @@ async function executeScopedOpenPondAction(input) {
|
|
|
27536
27843
|
`Action ${action.id} is a profile action, but profile action execution is not configured.`
|
|
27537
27844
|
);
|
|
27538
27845
|
}
|
|
27539
|
-
const profileActionId =
|
|
27540
|
-
const prompt =
|
|
27846
|
+
const profileActionId = stringValue8(implementation.actionId) ?? action.id;
|
|
27847
|
+
const prompt = stringValue8(input.input.prompt) ?? stringValue8(input.input.message) ?? context.userPrompt;
|
|
27541
27848
|
const result2 = await deps.executeProfileAction({
|
|
27542
27849
|
action: profileActionId,
|
|
27543
27850
|
input: {
|
|
@@ -27573,11 +27880,88 @@ async function executeScopedOpenPondAction(input) {
|
|
|
27573
27880
|
data: { result: result2 }
|
|
27574
27881
|
};
|
|
27575
27882
|
}
|
|
27883
|
+
if (implementation?.type === "openpond-project-action") {
|
|
27884
|
+
const executionTarget = resolveWorkspaceExecutionTarget({ session: context.session });
|
|
27885
|
+
if (isSandboxExecutionTarget(executionTarget)) {
|
|
27886
|
+
return failedActionToolResult(
|
|
27887
|
+
context.callId,
|
|
27888
|
+
resultToolName,
|
|
27889
|
+
`Action ${action.id} is a local Project Action and cannot run while Working in Hybrid or sandbox. Switch Working in to Local.`
|
|
27890
|
+
);
|
|
27891
|
+
}
|
|
27892
|
+
if (!deps.executeProjectAction) {
|
|
27893
|
+
return failedActionToolResult(
|
|
27894
|
+
context.callId,
|
|
27895
|
+
resultToolName,
|
|
27896
|
+
`Action ${action.id} is a local Project Action, but local action execution is not configured.`
|
|
27897
|
+
);
|
|
27898
|
+
}
|
|
27899
|
+
const projectRoot = stringValue8(implementation.projectRoot) ?? action.sourcePath;
|
|
27900
|
+
const projectId = stringValue8(implementation.projectId);
|
|
27901
|
+
const projectActionId = stringValue8(implementation.actionId) ?? action.id;
|
|
27902
|
+
if (!projectRoot) {
|
|
27903
|
+
return failedActionToolResult(
|
|
27904
|
+
context.callId,
|
|
27905
|
+
resultToolName,
|
|
27906
|
+
`Action ${action.id} is missing its local Project root.`
|
|
27907
|
+
);
|
|
27908
|
+
}
|
|
27909
|
+
if (!projectId || projectId !== context.session.localProjectId) {
|
|
27910
|
+
return failedActionToolResult(
|
|
27911
|
+
context.callId,
|
|
27912
|
+
resultToolName,
|
|
27913
|
+
`Action ${action.id} is not authorized for the selected local Project.`
|
|
27914
|
+
);
|
|
27915
|
+
}
|
|
27916
|
+
const result2 = await deps.executeProjectAction({
|
|
27917
|
+
action: projectActionId,
|
|
27918
|
+
input: input.input,
|
|
27919
|
+
metadata: {
|
|
27920
|
+
source: "openpond_project_action",
|
|
27921
|
+
projectRoot,
|
|
27922
|
+
projectId,
|
|
27923
|
+
selectedActionId: projectActionId,
|
|
27924
|
+
selectedActionLabel: action.label ?? action.name ?? projectActionId,
|
|
27925
|
+
selectedBy: "native_model_tool",
|
|
27926
|
+
displayPrompt: context.userPrompt,
|
|
27927
|
+
sessionId: context.session.id,
|
|
27928
|
+
turnId: context.turnId,
|
|
27929
|
+
toolCallId: context.callId
|
|
27930
|
+
}
|
|
27931
|
+
});
|
|
27932
|
+
return {
|
|
27933
|
+
toolCallId: context.callId,
|
|
27934
|
+
name: resultToolName,
|
|
27935
|
+
ok: true,
|
|
27936
|
+
contentText: JSON.stringify(
|
|
27937
|
+
{
|
|
27938
|
+
ok: true,
|
|
27939
|
+
action: resultToolName,
|
|
27940
|
+
output: `Ran Project Action ${projectActionId}.`,
|
|
27941
|
+
data: { result: result2 }
|
|
27942
|
+
},
|
|
27943
|
+
null,
|
|
27944
|
+
2
|
|
27945
|
+
),
|
|
27946
|
+
data: { result: result2 }
|
|
27947
|
+
};
|
|
27948
|
+
}
|
|
27949
|
+
if (implementation?.type === "openpond-hosted-project-action") {
|
|
27950
|
+
return executeHostedProjectActionModelTool({
|
|
27951
|
+
action,
|
|
27952
|
+
context,
|
|
27953
|
+
implementation,
|
|
27954
|
+
actionInput: input.input,
|
|
27955
|
+
requestedProjectId: input.requestedProjectId,
|
|
27956
|
+
resultToolName,
|
|
27957
|
+
executeProjectAction: deps.executeProjectAction
|
|
27958
|
+
});
|
|
27959
|
+
}
|
|
27576
27960
|
const payloadArgs = {
|
|
27577
27961
|
actionName: action.sourceActionId ?? action.name ?? action.id,
|
|
27578
27962
|
input: input.input
|
|
27579
27963
|
};
|
|
27580
|
-
const allowedProjectId =
|
|
27964
|
+
const allowedProjectId = stringValue8(implementation?.projectId);
|
|
27581
27965
|
if (input.requestedProjectId) {
|
|
27582
27966
|
if (!allowedProjectId || input.requestedProjectId !== allowedProjectId) {
|
|
27583
27967
|
return failedActionToolResult(
|
|
@@ -27590,7 +27974,7 @@ async function executeScopedOpenPondAction(input) {
|
|
|
27590
27974
|
} else if (allowedProjectId) {
|
|
27591
27975
|
payloadArgs.projectId = allowedProjectId;
|
|
27592
27976
|
}
|
|
27593
|
-
const allowedAgentId = action.agentId ??
|
|
27977
|
+
const allowedAgentId = action.agentId ?? stringValue8(implementation?.agentId);
|
|
27594
27978
|
if (input.requestedAgentId) {
|
|
27595
27979
|
if (!allowedAgentId || input.requestedAgentId !== allowedAgentId) {
|
|
27596
27980
|
return failedActionToolResult(
|
|
@@ -27619,7 +28003,7 @@ async function executeScopedOpenPondAction(input) {
|
|
|
27619
28003
|
}
|
|
27620
28004
|
function compactProfileActionResult(value) {
|
|
27621
28005
|
const execution = asRecord7(value);
|
|
27622
|
-
const stdout =
|
|
28006
|
+
const stdout = stringValue8(execution?.stdout);
|
|
27623
28007
|
if (!stdout) return value;
|
|
27624
28008
|
let payload;
|
|
27625
28009
|
try {
|
|
@@ -27633,7 +28017,7 @@ function compactProfileActionResult(value) {
|
|
|
27633
28017
|
for (const key of ["snapshot", "decision", "submission", "receipt"]) {
|
|
27634
28018
|
if (metadata && Object.hasOwn(metadata, key)) return metadata[key];
|
|
27635
28019
|
}
|
|
27636
|
-
const text =
|
|
28020
|
+
const text = stringValue8(actionResultRecord?.text);
|
|
27637
28021
|
if (text) {
|
|
27638
28022
|
try {
|
|
27639
28023
|
return JSON.parse(text);
|
|
@@ -27895,23 +28279,23 @@ function gitChangedFileRefs(value, sandboxMode = false) {
|
|
|
27895
28279
|
const record9 = asRecord7(value);
|
|
27896
28280
|
const status = asRecord7(record9?.status);
|
|
27897
28281
|
const files = Array.isArray(record9?.files) ? record9.files : Array.isArray(status?.files) ? status.files : [];
|
|
27898
|
-
return files.filter((item) => Boolean(item) && typeof item === "object" && !Array.isArray(item)).map((item) =>
|
|
28282
|
+
return files.filter((item) => Boolean(item) && typeof item === "object" && !Array.isArray(item)).map((item) => stringValue8(item.path)).filter((item) => Boolean(item)).map((filePath) => `${sandboxMode ? "sandbox" : "workspace"}:file:${filePath}`);
|
|
27899
28283
|
}
|
|
27900
28284
|
function gitDiffText(value) {
|
|
27901
28285
|
const record9 = asRecord7(value);
|
|
27902
|
-
return
|
|
28286
|
+
return stringValue8(record9?.diff) ?? stringValue8(asRecord7(record9?.result)?.diff);
|
|
27903
28287
|
}
|
|
27904
28288
|
function sandboxPathItems(value) {
|
|
27905
28289
|
const records = nestedArraysForKeys(value, ["matches", "files", "entries"]);
|
|
27906
28290
|
const items = [];
|
|
27907
28291
|
for (const record9 of records) {
|
|
27908
|
-
const path48 =
|
|
28292
|
+
const path48 = stringValue8(record9.path) ?? stringValue8(record9.name);
|
|
27909
28293
|
if (!path48) continue;
|
|
27910
28294
|
items.push({
|
|
27911
28295
|
path: path48,
|
|
27912
|
-
snippet:
|
|
28296
|
+
snippet: stringValue8(record9.text) ?? stringValue8(record9.snippet) ?? stringValue8(record9.content) ?? void 0,
|
|
27913
28297
|
line: typeof record9.line === "number" ? record9.line : null,
|
|
27914
|
-
kind:
|
|
28298
|
+
kind: stringValue8(record9.kind) ?? stringValue8(record9.type)
|
|
27915
28299
|
});
|
|
27916
28300
|
}
|
|
27917
28301
|
return items;
|
|
@@ -27936,15 +28320,15 @@ function nestedArraysForKeys(value, keys) {
|
|
|
27936
28320
|
function sandboxFileContent(value) {
|
|
27937
28321
|
const record9 = asRecord7(value);
|
|
27938
28322
|
const file = sandboxFileRecord(value);
|
|
27939
|
-
const encoded =
|
|
27940
|
-
if (encoded && !sandboxFileMetadata(value,
|
|
28323
|
+
const encoded = stringValue8(file?.contentsBase64) ?? stringValue8(record9?.contentsBase64);
|
|
28324
|
+
if (encoded && !sandboxFileMetadata(value, stringValue8(file?.path) ?? "").binary) {
|
|
27941
28325
|
try {
|
|
27942
28326
|
return Buffer.from(encoded, "base64").toString("utf8");
|
|
27943
28327
|
} catch {
|
|
27944
28328
|
return null;
|
|
27945
28329
|
}
|
|
27946
28330
|
}
|
|
27947
|
-
return
|
|
28331
|
+
return stringValue8(record9?.content) ?? stringValue8(record9?.text) ?? stringValue8(record9?.contents) ?? stringValue8(file?.content) ?? stringValue8(file?.text);
|
|
27948
28332
|
}
|
|
27949
28333
|
function contentTypeForResourcePath(value) {
|
|
27950
28334
|
const lower = value.toLowerCase();
|
|
@@ -27959,7 +28343,7 @@ function sandboxFileRecord(value) {
|
|
|
27959
28343
|
}
|
|
27960
28344
|
function sandboxFileMetadata(value, resourcePath) {
|
|
27961
28345
|
const file = sandboxFileRecord(value);
|
|
27962
|
-
const contentType =
|
|
28346
|
+
const contentType = stringValue8(file?.contentType) ?? stringValue8(file?.mimeType) ?? contentTypeForResourcePath(resourcePath);
|
|
27963
28347
|
const sizeBytes = numberValue3(file?.sizeBytes) ?? numberValue3(file?.size);
|
|
27964
28348
|
const binary = file?.binary === true || file?.isBinary === true || (contentType ? isBinaryContentType(contentType) : isLikelyBinaryResourcePath(resourcePath));
|
|
27965
28349
|
return { binary, contentType, ...sizeBytes !== null ? { sizeBytes } : {} };
|
|
@@ -28045,8 +28429,8 @@ function actionCatalogItemForModel(action) {
|
|
|
28045
28429
|
directRunAllowed,
|
|
28046
28430
|
inputSchema: action.inputSchema ?? null,
|
|
28047
28431
|
outputSchema: action.outputSchema ?? null,
|
|
28048
|
-
agentId: action.agentId ??
|
|
28049
|
-
projectId:
|
|
28432
|
+
agentId: action.agentId ?? stringValue8(implementation?.agentId),
|
|
28433
|
+
projectId: stringValue8(implementation?.projectId),
|
|
28050
28434
|
sourceActionId: action.sourceActionId ?? null
|
|
28051
28435
|
};
|
|
28052
28436
|
}
|
|
@@ -28069,7 +28453,7 @@ function failedActionToolResult(callId, name, message) {
|
|
|
28069
28453
|
function asRecord7(value) {
|
|
28070
28454
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
28071
28455
|
}
|
|
28072
|
-
function
|
|
28456
|
+
function stringValue8(value) {
|
|
28073
28457
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
28074
28458
|
}
|
|
28075
28459
|
function numberValue3(value) {
|
|
@@ -33236,7 +33620,7 @@ function redactConnectedAppToolArguments(toolName, args) {
|
|
|
33236
33620
|
return redacted && typeof redacted === "object" && !Array.isArray(redacted) ? redacted : {};
|
|
33237
33621
|
}
|
|
33238
33622
|
async function executeConnectedAppToolDefinition(input) {
|
|
33239
|
-
const provider = normalizeConnectedAppProviderFamilyId(
|
|
33623
|
+
const provider = normalizeConnectedAppProviderFamilyId(stringValue9(input.context.args.provider));
|
|
33240
33624
|
if (!provider) {
|
|
33241
33625
|
return connectedAppToolFailure(input.context.callId, input.toolName, "Connected app provider is required.");
|
|
33242
33626
|
}
|
|
@@ -33276,7 +33660,7 @@ async function executeConnectedAppToolDefinition(input) {
|
|
|
33276
33660
|
}
|
|
33277
33661
|
);
|
|
33278
33662
|
}
|
|
33279
|
-
if (input.operation === "write" && !
|
|
33663
|
+
if (input.operation === "write" && !stringValue9(input.context.args.explicitUserIntent)) {
|
|
33280
33664
|
return connectedAppToolFailure(
|
|
33281
33665
|
input.context.callId,
|
|
33282
33666
|
input.toolName,
|
|
@@ -33368,7 +33752,7 @@ async function executeConnectedAppToolDefinition(input) {
|
|
|
33368
33752
|
function inferredProviderOperationCapabilityIds(input) {
|
|
33369
33753
|
const providerOperation = connectedAppProviderOperationById(
|
|
33370
33754
|
input.provider,
|
|
33371
|
-
|
|
33755
|
+
stringValue9(input.args.operation)
|
|
33372
33756
|
);
|
|
33373
33757
|
if (!providerOperation || providerOperation.operation !== input.operation) return null;
|
|
33374
33758
|
return providerOperation.capabilityIds;
|
|
@@ -33385,8 +33769,8 @@ function connectedAppProviderErrorSummary(data) {
|
|
|
33385
33769
|
const result = isRecord5(record9.result) ? record9.result : null;
|
|
33386
33770
|
const metadata = isRecord5(record9.metadata) ? record9.metadata : null;
|
|
33387
33771
|
const httpStatus = numberValue4(metadata?.httpStatus) ?? numberValue4(result?.status);
|
|
33388
|
-
const title =
|
|
33389
|
-
const detail =
|
|
33772
|
+
const title = stringValue9(result?.title);
|
|
33773
|
+
const detail = stringValue9(result?.detail);
|
|
33390
33774
|
if (!httpStatus && !title && !detail) return null;
|
|
33391
33775
|
const statusText = httpStatus ? `Provider returned HTTP ${httpStatus}` : "Provider returned an error";
|
|
33392
33776
|
const titleText = title ? ` ${title}` : "";
|
|
@@ -33464,7 +33848,7 @@ function dedupeContexts(contexts) {
|
|
|
33464
33848
|
}
|
|
33465
33849
|
return [...byProvider.values()];
|
|
33466
33850
|
}
|
|
33467
|
-
function
|
|
33851
|
+
function stringValue9(value) {
|
|
33468
33852
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
33469
33853
|
}
|
|
33470
33854
|
function numberValue4(value) {
|
|
@@ -37887,6 +38271,7 @@ function createCapabilityCatalogRuntime(deps) {
|
|
|
37887
38271
|
actionCatalog: openPondActionCatalog,
|
|
37888
38272
|
executeWorkspaceTool: deps.executeWorkspaceTool,
|
|
37889
38273
|
executeProfileAction: deps.executeProfileAction,
|
|
38274
|
+
executeProjectAction: deps.executeProjectAction,
|
|
37890
38275
|
trainingHarness: options.trainingHarness
|
|
37891
38276
|
});
|
|
37892
38277
|
}
|
|
@@ -37976,7 +38361,8 @@ function createCapabilityCatalogRuntime(deps) {
|
|
|
37976
38361
|
...createOpenPondActionModelToolDefinitions({
|
|
37977
38362
|
actionCatalog: openPondActionCatalog,
|
|
37978
38363
|
executeWorkspaceTool: deps.executeWorkspaceTool,
|
|
37979
|
-
executeProfileAction: deps.executeProfileAction
|
|
38364
|
+
executeProfileAction: deps.executeProfileAction,
|
|
38365
|
+
executeProjectAction: deps.executeProjectAction
|
|
37980
38366
|
})
|
|
37981
38367
|
);
|
|
37982
38368
|
}
|
|
@@ -38887,7 +39273,7 @@ async function assertGeneratedSdkArtifacts(target, requireEvalPass = true) {
|
|
|
38887
39273
|
);
|
|
38888
39274
|
}
|
|
38889
39275
|
const missingMetadata = actions.filter(
|
|
38890
|
-
(action) => typeof action.id === "string" && (!
|
|
39276
|
+
(action) => typeof action.id === "string" && (!stringValue10(action.label) || !stringValue10(action.description) || typeof action.timeoutSeconds !== "number")
|
|
38891
39277
|
);
|
|
38892
39278
|
if (missingMetadata.length > 0) {
|
|
38893
39279
|
throw new Error(
|
|
@@ -38897,7 +39283,7 @@ async function assertGeneratedSdkArtifacts(target, requireEvalPass = true) {
|
|
|
38897
39283
|
const setupGate = buildOpenPondProfileSetupGate({
|
|
38898
39284
|
actionCatalog: actions.filter((action) => typeof action.id === "string").map((action) => ({
|
|
38899
39285
|
id: action.id,
|
|
38900
|
-
name:
|
|
39286
|
+
name: stringValue10(action.name),
|
|
38901
39287
|
setupRequirements: recordArray(action.setupRequirements) ?? []
|
|
38902
39288
|
})),
|
|
38903
39289
|
actionId: target.defaultAction
|
|
@@ -38939,7 +39325,7 @@ function recordArray(value) {
|
|
|
38939
39325
|
}
|
|
38940
39326
|
function traceRefFromCommandResult(value) {
|
|
38941
39327
|
const record9 = asRecord13(value);
|
|
38942
|
-
const ref =
|
|
39328
|
+
const ref = stringValue10(record9?.traceArtifactRef);
|
|
38943
39329
|
return ref?.startsWith(".openpond/") ? ref : null;
|
|
38944
39330
|
}
|
|
38945
39331
|
function summaryFromCommandResult(commandName, value) {
|
|
@@ -38970,7 +39356,7 @@ function summaryFromCommandResult(commandName, value) {
|
|
|
38970
39356
|
}
|
|
38971
39357
|
return null;
|
|
38972
39358
|
}
|
|
38973
|
-
function
|
|
39359
|
+
function stringValue10(value) {
|
|
38974
39360
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
38975
39361
|
}
|
|
38976
39362
|
|
|
@@ -39762,7 +40148,7 @@ async function executeAgentTasksetEvaluation(input) {
|
|
|
39762
40148
|
task.id,
|
|
39763
40149
|
0
|
|
39764
40150
|
]).slice(0, 24)}`;
|
|
39765
|
-
const traceRef =
|
|
40151
|
+
const traceRef = stringValue11(parsed?.traceArtifactRef);
|
|
39766
40152
|
const attempt = TaskAttemptResultSchema.parse({
|
|
39767
40153
|
schemaVersion: "openpond.taskAttempt.v1",
|
|
39768
40154
|
id: attemptId,
|
|
@@ -39832,7 +40218,7 @@ function parseAgentRunPayload(stdout) {
|
|
|
39832
40218
|
function recordValue(value) {
|
|
39833
40219
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
39834
40220
|
}
|
|
39835
|
-
function
|
|
40221
|
+
function stringValue11(value) {
|
|
39836
40222
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
39837
40223
|
}
|
|
39838
40224
|
|
|
@@ -39850,12 +40236,12 @@ async function runNormalizedAgentEvaluation(input) {
|
|
|
39850
40236
|
const failed = numberValue6(payload.summary?.failed) ?? Math.max(0, total - passed);
|
|
39851
40237
|
const publishGate = payload.publishGate?.status === "passed" ? "passed" : "failed";
|
|
39852
40238
|
const results = Array.isArray(payload.results) ? payload.results : [];
|
|
39853
|
-
const sdkEvalRefs = results.map((evaluation) =>
|
|
40239
|
+
const sdkEvalRefs = results.map((evaluation) => stringValue12(evaluation.name)).filter((value) => Boolean(value));
|
|
39854
40240
|
const artifactRefs = /* @__PURE__ */ new Set([
|
|
39855
40241
|
path40.posix.join(input.sourceRef, ".openpond/eval-results.json")
|
|
39856
40242
|
]);
|
|
39857
40243
|
for (const evaluation of results) {
|
|
39858
|
-
const trace =
|
|
40244
|
+
const trace = stringValue12(evaluation.traceArtifactRef);
|
|
39859
40245
|
if (trace)
|
|
39860
40246
|
artifactRefs.add(path40.posix.join(input.sourceRef, normalizeRef(trace)));
|
|
39861
40247
|
for (const artifact of stringArray4(evaluation.artifacts)) {
|
|
@@ -39909,15 +40295,15 @@ async function runNormalizedAgentEvaluation(input) {
|
|
|
39909
40295
|
summary: `${input.subject === "active" ? "Active" : input.subject === "candidate" ? "Candidate" : "Post-release"} Agent SDK and Taskset Evals: ${combinedPassed}/${combinedTotal} passed${combinedPublishGate === "failed" ? "; publish gate failed" : ""}.`,
|
|
39910
40296
|
createdAt: timestamp,
|
|
39911
40297
|
metadata: {
|
|
39912
|
-
schemaVersion:
|
|
39913
|
-
schema:
|
|
40298
|
+
schemaVersion: stringValue12(payload.schemaVersion),
|
|
40299
|
+
schema: stringValue12(payload.schema),
|
|
39914
40300
|
project: {
|
|
39915
|
-
name:
|
|
39916
|
-
version:
|
|
40301
|
+
name: stringValue12(payload.project?.name),
|
|
40302
|
+
version: stringValue12(payload.project?.version)
|
|
39917
40303
|
},
|
|
39918
40304
|
source: {
|
|
39919
|
-
configPath:
|
|
39920
|
-
configHash:
|
|
40305
|
+
configPath: stringValue12(payload.source?.configPath),
|
|
40306
|
+
configHash: stringValue12(payload.source?.configHash)
|
|
39921
40307
|
},
|
|
39922
40308
|
publishGate: {
|
|
39923
40309
|
total: numberValue6(payload.publishGate?.total),
|
|
@@ -39935,10 +40321,10 @@ async function runNormalizedAgentEvaluation(input) {
|
|
|
39935
40321
|
executionContractHash: tasksetExecution?.executionContractHash ?? null,
|
|
39936
40322
|
gradeRefs: tasksetExecution?.gradeRefs ?? [],
|
|
39937
40323
|
results: results.map((evaluation) => ({
|
|
39938
|
-
name:
|
|
39939
|
-
status:
|
|
39940
|
-
error:
|
|
39941
|
-
traceArtifactRef:
|
|
40324
|
+
name: stringValue12(evaluation.name),
|
|
40325
|
+
status: stringValue12(evaluation.status),
|
|
40326
|
+
error: stringValue12(evaluation.error),
|
|
40327
|
+
traceArtifactRef: stringValue12(evaluation.traceArtifactRef)
|
|
39942
40328
|
}))
|
|
39943
40329
|
}
|
|
39944
40330
|
};
|
|
@@ -39977,14 +40363,14 @@ function parseAgentEvalPayload(stdout) {
|
|
|
39977
40363
|
function normalizeRef(value) {
|
|
39978
40364
|
return value.replace(/^\.\//, "").replaceAll("\\", "/");
|
|
39979
40365
|
}
|
|
39980
|
-
function
|
|
40366
|
+
function stringValue12(value) {
|
|
39981
40367
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
39982
40368
|
}
|
|
39983
40369
|
function numberValue6(value) {
|
|
39984
40370
|
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
39985
40371
|
}
|
|
39986
40372
|
function stringArray4(value) {
|
|
39987
|
-
return Array.isArray(value) ? value.map(
|
|
40373
|
+
return Array.isArray(value) ? value.map(stringValue12).filter((item) => Boolean(item)) : [];
|
|
39988
40374
|
}
|
|
39989
40375
|
|
|
39990
40376
|
// ../server/src/runtime/create-pipeline/agent-improvement-git.ts
|
|
@@ -40207,13 +40593,13 @@ async function listPullRequestsForBranch(command, cwd, branch) {
|
|
|
40207
40593
|
function normalizePullRequest(raw, openedAt = (/* @__PURE__ */ new Date()).toISOString(), updatedAt = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
40208
40594
|
const number = typeof raw.number === "number" ? raw.number : Number(raw.number);
|
|
40209
40595
|
const stateValue = typeof raw.state === "string" ? raw.state.toLowerCase() : "";
|
|
40210
|
-
const mergedAt =
|
|
40596
|
+
const mergedAt = stringValue13(raw.mergedAt);
|
|
40211
40597
|
const state = mergedAt || stateValue === "merged" ? "merged" : stateValue === "open" ? "open" : "closed";
|
|
40212
40598
|
const mergeCommitRecord = raw.mergeCommit && typeof raw.mergeCommit === "object" ? raw.mergeCommit : null;
|
|
40213
|
-
const mergeCommit =
|
|
40214
|
-
const url =
|
|
40215
|
-
const baseBranch =
|
|
40216
|
-
const headBranch =
|
|
40599
|
+
const mergeCommit = stringValue13(mergeCommitRecord?.oid) ?? stringValue13(raw.mergeCommit);
|
|
40600
|
+
const url = stringValue13(raw.url);
|
|
40601
|
+
const baseBranch = stringValue13(raw.baseRefName);
|
|
40602
|
+
const headBranch = stringValue13(raw.headRefName);
|
|
40217
40603
|
if (!Number.isInteger(number) || number <= 0 || !url || !baseBranch || !headBranch) {
|
|
40218
40604
|
throw new Error("GitHub returned an incomplete pull request payload.");
|
|
40219
40605
|
}
|
|
@@ -40265,7 +40651,7 @@ function assertCommand(result, message) {
|
|
|
40265
40651
|
if (result.code === 0) return;
|
|
40266
40652
|
throw new Error(result.stderr.trim() || result.stdout.trim() || message);
|
|
40267
40653
|
}
|
|
40268
|
-
function
|
|
40654
|
+
function stringValue13(value) {
|
|
40269
40655
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
40270
40656
|
}
|
|
40271
40657
|
function defaultCommandRunner(command, args, cwd, env = {}) {
|
|
@@ -40838,8 +41224,8 @@ async function readAgentPackageOrigin(agentRootPath, manifestHash) {
|
|
|
40838
41224
|
"agent-package-origin.json"
|
|
40839
41225
|
);
|
|
40840
41226
|
const origin = await fs20.readFile(originPath, "utf8").then((raw) => asRecord15(JSON.parse(raw))).catch(() => ({}));
|
|
40841
|
-
const versionId =
|
|
40842
|
-
const digest =
|
|
41227
|
+
const versionId = stringValue14(origin.versionId);
|
|
41228
|
+
const digest = stringValue14(origin.digest);
|
|
40843
41229
|
if (versionId && digest && /^[a-f0-9]{64}$/.test(digest) && versionId === `agent-${digest.slice(0, 20)}`) {
|
|
40844
41230
|
return {
|
|
40845
41231
|
versionId,
|
|
@@ -40858,7 +41244,7 @@ async function readAgentPackageOrigin(agentRootPath, manifestHash) {
|
|
|
40858
41244
|
function asRecord15(value) {
|
|
40859
41245
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
40860
41246
|
}
|
|
40861
|
-
function
|
|
41247
|
+
function stringValue14(value) {
|
|
40862
41248
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
40863
41249
|
}
|
|
40864
41250
|
function stringArray5(value) {
|
|
@@ -41932,7 +42318,7 @@ function uniqueEvidence(run, evidence) {
|
|
|
41932
42318
|
}
|
|
41933
42319
|
async function verifyAppliedProfileCommit(input) {
|
|
41934
42320
|
const command = input.command ?? (async (name, args, cwd, env) => {
|
|
41935
|
-
const { runWorkspaceCommand } = await import("./workspaces-
|
|
42321
|
+
const { runWorkspaceCommand } = await import("./workspaces-N2WWI77O.js");
|
|
41936
42322
|
return runWorkspaceCommand(name, args, cwd, env);
|
|
41937
42323
|
});
|
|
41938
42324
|
const result = await command("git", ["rev-parse", "HEAD"], input.repoPath);
|
|
@@ -46242,6 +46628,7 @@ function createTurnRunner(deps) {
|
|
|
46242
46628
|
workInputsForSession,
|
|
46243
46629
|
executeOpenPondCommand,
|
|
46244
46630
|
executeProfileAction,
|
|
46631
|
+
executeProjectAction,
|
|
46245
46632
|
executeDatasetBuilderAction,
|
|
46246
46633
|
loadOpenPondProfileState: loadOpenPondProfileState2,
|
|
46247
46634
|
loadOpenPondProfileStateForRef: loadOpenPondProfileStateForRef2,
|
|
@@ -46682,6 +47069,7 @@ function createTurnRunner(deps) {
|
|
|
46682
47069
|
executeWebSearch,
|
|
46683
47070
|
createScheduledWork,
|
|
46684
47071
|
executeProfileAction,
|
|
47072
|
+
executeProjectAction,
|
|
46685
47073
|
loadOpenPondProfileStateForRef: loadOpenPondProfileStateForRef2
|
|
46686
47074
|
});
|
|
46687
47075
|
function createNativeModelToolDefinitions(openPondActionCatalog, runtimeEvents, profileSkillRuntime, connectedApps, options = {}) {
|