@vecteur/cli 0.5.0 → 0.5.2
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/package.json +1 -1
- package/src/contract.js +2 -2
- package/src/format.js +23 -0
package/package.json
CHANGED
package/src/contract.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// GENERATED by scripts/gen-contract.mjs from owner TypeScript projections.
|
|
2
|
-
export const OWNER_CONTRACT_IDENTITY = "api-sha256:
|
|
2
|
+
export const OWNER_CONTRACT_IDENTITY = "api-sha256:059cf98af8091e6da04305db996a2b7e4971d1b5114a1257a29bf16fb327159e;run-wire-sha256:b3d36080eb87ef8e01b24fa832a9c16ff06b0011bc5fc37fa520ea61303d2884";
|
|
3
3
|
export const RECOVERY_ACTIONS = Object.freeze({"delete_project":{"label":"Delete a project","href":"/projects"},"upgrade_plan":{"label":"Upgrade your plan","href":"/dashboard/billing"},"wait_for_reset":{"label":"Wait until the UTC reset","href":null}});
|
|
4
|
-
export const EVENT_KINDS = Object.freeze(["source","step_started","step_finished","tool_call","tool_result","synthesis","artifact","terminal","heartbeat","assistant_delta","knowledge_binding","engineering_projection","provider_attempt","clarification"]);
|
|
4
|
+
export const EVENT_KINDS = Object.freeze(["source","step_started","step_finished","tool_call","tool_result","synthesis","artifact","terminal","heartbeat","assistant_delta","knowledge_binding","engineering_projection","provider_attempt","clarification","input_rows"]);
|
|
5
5
|
export const RETIRED_EVENT_KINDS = Object.freeze(["context_frame","cta","step_label"]);
|
|
6
6
|
export const TERMINAL_FIELDS = Object.freeze(["answer","defect","deliverable_asked","evidence_dag","instruction_source","intent","missing_input_need","missing_inputs","provider_retry_offer","recovery","refusal_unfounded","state","steps","unmet_wanted"]);
|
|
7
7
|
export const ARTIFACT_MEDIA_TYPES = Object.freeze({"binary":"application/octet-stream","code":"text/plain","csv":"text/csv","docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document","drive":"application/vnd.google-drive","html":"text/html","jpeg":"image/jpeg","json":"application/json","md":"text/markdown","pdf":"application/pdf","png":"image/png","svg":"image/svg+xml","xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});
|
package/src/format.js
CHANGED
|
@@ -103,6 +103,27 @@ export function taskLines(events) {
|
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
* SOURCES › ASSUMPTIONS, SPOKEN BY THIS DOOR TOO (RunWire v2 `input_rows`, CONTRACTS S1).
|
|
108
|
+
*
|
|
109
|
+
* One block per owner verb the turn's programs called, the LAST ledger event of the run
|
|
110
|
+
* standing: what the customer stated (`your brief`), what the program assumed, what the
|
|
111
|
+
* method's declared default was let stand, and how many arguments the program set from a
|
|
112
|
+
* variable (no value the record can read). Rows print through `inputLines`, the same shape
|
|
113
|
+
* as the legacy step inputs, so the origin words are the contract's.
|
|
114
|
+
*/
|
|
115
|
+
export function assumptionLines(events) {
|
|
116
|
+
const ledger = events.filter((event) => event?.kind === "input_rows").at(-1);
|
|
117
|
+
const blocks = Array.isArray(ledger?.payload?.blocks) ? ledger.payload.blocks : [];
|
|
118
|
+
return blocks.flatMap((block) => {
|
|
119
|
+
if (!block || typeof block.verb !== "string") return [];
|
|
120
|
+
const set = Number.isInteger(block.program_set) && block.program_set > 0
|
|
121
|
+
? ` · ${block.program_set} set by the program` : "";
|
|
122
|
+
const rows = Array.isArray(block.rows) ? block.rows : [];
|
|
123
|
+
return [` ${plainLine(block.verb)}${set}`, ...inputLines(rows)];
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
106
127
|
function shellQuote(value) {
|
|
107
128
|
return `'${String(value).replaceAll("'", `'"'"'`)}'`;
|
|
108
129
|
}
|
|
@@ -194,10 +215,12 @@ export function humanRun(value, { projectId, cost } = {}) {
|
|
|
194
215
|
throw new CliError("artifact_invalid", "Run carries malformed artifact metadata");
|
|
195
216
|
}
|
|
196
217
|
const tasks = taskLines(value.events);
|
|
218
|
+
const assumptions = assumptionLines(value.events);
|
|
197
219
|
const lines = [];
|
|
198
220
|
if (terminal.answer !== undefined) lines.push(terminal.answer, "");
|
|
199
221
|
if (tasks.length) lines.push("Steps:", ...tasks, "");
|
|
200
222
|
if (origins.length) lines.push("Inputs and origins:", ...origins, "");
|
|
223
|
+
if (assumptions.length) lines.push("Assumptions:", ...assumptions, "");
|
|
201
224
|
if (artifacts.length) {
|
|
202
225
|
lines.push("Artifacts:");
|
|
203
226
|
for (const artifact of artifacts) {
|