@north-light/cli 0.3.614 → 0.3.615
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var g=Object.defineProperty;var u=(e,t)=>g(e,"name",{value:t,configurable:!0});import{Type as i}from"typebox";import{envNodeId as q}from"../shared/env.js";import{localClient as p}from"../api/node-transport.js";import{ApiError as w}from"../api/index.js";import{SUBMIT_RESULT_TOOL as c}from"../core/runtime/structured-output.js";function O(e){const t=JSON.stringify(e.schema,null,2),r=`call the ${`\`${c}\` tool with \`request_id: "${e.request_id}"\``} and the JSON in \`result\``,n=`call \`${c}\` with \`decline: { reason, code }\` instead`;return`<structured-output-request>
|
|
2
2
|
${e.mode==="terminal"?`This node owes a terminal structured result. When the work is complete, submit it: ${r}. That records it and pushes your final report in one step, finishing this node. Do NOT call \`crtr push final\` yourself; it is blocked while this request is pending. If the schema cannot be honestly satisfied (blocked, unavailable, bad input), ${n} of inventing a value \u2014 that finishes the node with a declined outcome. You cannot stop or go dormant until the result is accepted or declined.`:`This node owes a one-off structured result. Submit it: ${r}. That records it and pushes an update report to your subscribers, then you continue working normally. If the schema cannot be honestly satisfied, ${n} of inventing a value. You cannot stop or go dormant until the result is accepted or declined.`}
|
|
3
3
|
|
|
4
4
|
The submitted JSON is validated against this schema; a mismatch rejects with field errors and records nothing, so fix it and call the tool again.
|
|
@@ -8,11 +8,11 @@ Required schema:
|
|
|
8
8
|
\`\`\`json
|
|
9
9
|
${t}
|
|
10
10
|
\`\`\`
|
|
11
|
-
</structured-output-request>`}
|
|
11
|
+
</structured-output-request>`}u(O,"structuredOutputPromptBlock");function $(e){const t=e.declined,s=e.mode==="terminal"?`${t?"Decline recorded":"Result recorded"} \u2014 node finished; its engine shuts down on next stop.`:`${t?"One-off request declined":"One-off result recorded"} and pushed \u2014 the structured-output gate is cleared; continue working normally.`,r=t===void 0?"":`
|
|
12
12
|
- code: ${t.code} (${t.retryable?"retryable":"not retryable"})`;return`${s}
|
|
13
13
|
|
|
14
|
-
- report: ${e.report}${r}`}
|
|
14
|
+
- report: ${e.report}${r}`}u($,"submitResultText");async function f(e){return(await p({autostart:!1}).brokerStructuredRequest(e)).request}u(f,"readPendingRequest");function T(e,t){if(typeof t!="string")return t;const s=e?.schema.type;if(s!=="object"&&s!=="array")return t;try{return JSON.parse(t)}catch{return t}}u(T,"normalizeResult");function l(e){return{content:[{type:"text",text:e}],details:void 0,isError:!0}}u(l,"errorResult");function S(e,t=r=>p({autostart:!1}).submitResult(e,r),s=()=>f(e)){return{name:c,label:"Submit result",description:"Answer this node's pending structured-output request. Pass the request id from the structured-output instruction and either `result` (the JSON value matching the required schema) or `decline` when the schema cannot be honestly satisfied. The result is validated against the schema; a mismatch is rejected with field errors and nothing is recorded.",promptSnippet:"Submit the JSON result for a pending structured-output request (or decline it)",parameters:i.Object({request_id:i.String({description:"The request id named in the structured-output instruction."}),result:i.Optional(i.Unknown({description:"The JSON value matching the required schema. Omit when declining."})),decline:i.Optional(i.Object({reason:i.String({description:"One sentence on why the schema cannot be honestly satisfied."}),code:i.String({description:"A whitespace-free token naming the decline class, as the requester documented."}),retryable:i.Optional(i.Boolean({description:"Whether a retry could succeed. Default false."}))},{description:"Decline the request instead of submitting a result."}))}),defaultActive:!1,async execute(r,n){const a=typeof n.request_id=="string"?n.request_id.trim():"";if(a==="")return l("request_id is required: pass the request id named in the structured-output instruction.");const h=Object.hasOwn(n,"result")&&n.result!==void 0,d=n.decline;if(h&&d!==void 0)return l("Pass either `result` or `decline`, not both.");if(!h&&d===void 0)return l("Pass `result` (the JSON value matching the required schema), or `decline` when the schema cannot be honestly satisfied.");const y=d!==void 0?{request_id:a,decline:d.reason,code:d.code,retryable:d.retryable===!0}:{request_id:a,value:T(await s(),n.result)};try{const o=await t(y);return{content:[{type:"text",text:$(o)}],details:o,...o.mode==="terminal"?{terminate:!0}:{}}}catch(o){if(o instanceof w){const m=o.details,b=typeof m?.next=="string"?`
|
|
15
15
|
|
|
16
|
-
${
|
|
16
|
+
${m.next}`:"";return l(`${o.code}: ${o.message}${b}`)}return l(`The result was not submitted: ${o.message}`)}}}}u(S,"createSubmitResultTool");function x(e){const t=q();if(t===void 0||t.trim()==="")return;e.registerTool(S(t));const s=u(r=>{const n=e.getActiveTools(),a=n.includes(c);r&&!a?e.setActiveTools([...n,c]):!r&&a&&e.setActiveTools(n.filter(h=>h!==c))},"syncTool");e.on("before_agent_start",async r=>{const n=await f(t);if(s(n!==null),n!==null)return{systemPrompt:`${r.systemPrompt}
|
|
17
17
|
|
|
18
|
-
${O(n)}`}}),e.on("turn_end",async()=>{
|
|
18
|
+
${O(n)}`}}),e.on("turn_end",async()=>{await f(t)!==null&&s(!0)})}u(x,"registerCanvasStructuredOutput");var j=x;export{c as SUBMIT_RESULT_TOOL,S as createSubmitResultTool,j as default,x as registerCanvasStructuredOutput,O as structuredOutputPromptBlock,$ as submitResultText};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.615",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
},
|
|
146
146
|
"license": "UNLICENSED",
|
|
147
147
|
"dependencies": {
|
|
148
|
-
"@north-light/identity": "0.3.
|
|
148
|
+
"@north-light/identity": "0.3.615",
|
|
149
149
|
"@earendil-works/chord": "1.1.0",
|
|
150
150
|
"@earendil-works/pi-agent-core": "1.1.0",
|
|
151
151
|
"@earendil-works/pi-ai": "1.1.0",
|
package/runtime.lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.615",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@north-light/cli",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.615",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "UNLICENSED",
|
|
12
12
|
"workspaces": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@milkdown/preset-gfm": "^7.22.3",
|
|
29
29
|
"@milkdown/prose": "^7.22.3",
|
|
30
30
|
"@milkdown/utils": "^7.22.3",
|
|
31
|
-
"@north-light/identity": "0.3.
|
|
31
|
+
"@north-light/identity": "0.3.615",
|
|
32
32
|
"cron-parser": "^5.6.0",
|
|
33
33
|
"esbuild": "^0.27.7",
|
|
34
34
|
"jose": "^6.2.12",
|
|
@@ -11956,17 +11956,17 @@
|
|
|
11956
11956
|
},
|
|
11957
11957
|
"packages/crouter-api": {
|
|
11958
11958
|
"name": "@north-light/api",
|
|
11959
|
-
"version": "0.3.
|
|
11959
|
+
"version": "0.3.615",
|
|
11960
11960
|
"license": "UNLICENSED"
|
|
11961
11961
|
},
|
|
11962
11962
|
"packages/crouter-env-docker": {
|
|
11963
11963
|
"name": "@north-light/env-docker",
|
|
11964
|
-
"version": "0.3.
|
|
11964
|
+
"version": "0.3.615",
|
|
11965
11965
|
"license": "UNLICENSED"
|
|
11966
11966
|
},
|
|
11967
11967
|
"packages/crouter-identity": {
|
|
11968
11968
|
"name": "@north-light/identity",
|
|
11969
|
-
"version": "0.3.
|
|
11969
|
+
"version": "0.3.615",
|
|
11970
11970
|
"license": "UNLICENSED",
|
|
11971
11971
|
"dependencies": {
|
|
11972
11972
|
"jose": "^6.2.1"
|
|
@@ -11974,21 +11974,21 @@
|
|
|
11974
11974
|
},
|
|
11975
11975
|
"packages/crouter-plugin": {
|
|
11976
11976
|
"name": "@north-light/plugin",
|
|
11977
|
-
"version": "0.3.
|
|
11977
|
+
"version": "0.3.615",
|
|
11978
11978
|
"license": "UNLICENSED",
|
|
11979
11979
|
"dependencies": {
|
|
11980
|
-
"@north-light/api": "0.3.
|
|
11981
|
-
"@north-light/identity": "0.3.
|
|
11980
|
+
"@north-light/api": "0.3.615",
|
|
11981
|
+
"@north-light/identity": "0.3.615"
|
|
11982
11982
|
}
|
|
11983
11983
|
},
|
|
11984
11984
|
"packages/crouter-sdk": {
|
|
11985
11985
|
"name": "@north-light/sdk",
|
|
11986
|
-
"version": "0.3.
|
|
11986
|
+
"version": "0.3.615",
|
|
11987
11987
|
"license": "UNLICENSED",
|
|
11988
11988
|
"dependencies": {
|
|
11989
|
-
"@north-light/api": "0.3.
|
|
11990
|
-
"@north-light/identity": "0.3.
|
|
11991
|
-
"@north-light/plugin": "0.3.
|
|
11989
|
+
"@north-light/api": "0.3.615",
|
|
11990
|
+
"@north-light/identity": "0.3.615",
|
|
11991
|
+
"@north-light/plugin": "0.3.615",
|
|
11992
11992
|
"jose": "^6.2.1"
|
|
11993
11993
|
},
|
|
11994
11994
|
"bin": {
|