@crewx/app 0.1.0-rc.31 → 0.1.0-rc.33

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/src/usage.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NO_MANUAL_TEXT=void 0;exports.describeSchema=d;exports.describeInputs=h;exports.effectiveAccess=$;exports.describeBackend=m;exports.buildActionRows=g;exports.renderActionsSection=j;exports.renderServerOnlyActions=w;exports.manualBody=q;exports.renderConnectsTo=A;exports.renderUsage=O;exports.NO_MANUAL_TEXT="No manual for this App.";const f="## Actions (generated from this App's declaration; * = required)";const p=128*1024;function l(e,n,t){if(e!==void 0&&n!==void 0)return` ${e}\u2013${n}`;if(n!==void 0)return` \u2264${n}`;if(e!==void 0&&!(t&&e===0))return` \u2265${e}`;return""}function b(e){return JSON.stringify(e)}function d(e){if(Array.isArray(e.enum))return`one of ${e.enum.map(b).join(", ")}`;switch(e.type){case"string":return`string${l(e.minLength,e.maxLength,true)}`;case"integer":case"number":return`${e.type}${l(e.minimum,e.maximum,false)}`;case"boolean":return"boolean";case"null":return"null";case"array":{const n=e.items?` of ${d(e.items)}`:"";return`array${l(e.minItems,e.maxItems,true)}${n}`}case"object":{const n=Object.entries(e.properties??{});if(n.length===0)return"object";const t=new Set(e.required??[]);return`{${n.map(([r,s])=>`${r}${t.has(r)?"*":""}: ${d(s)}`).join(", ")}}`}default:return String(e.type)}}function h(e){const n=new Set(e.required??[]);return Object.entries(e.properties??{}).map(([t,r])=>`${t}${n.has(t)?"*":""}: ${d(r)}`)}function $(e,n){if(e==="allowed")return{access:n?"allowed":"denied",disputed:false};if(e==="approval_required")return{access:"approval_required",disputed:false};return n?{access:"approval_required",disputed:true}:{access:"denied",disputed:false}}function m(e){if(e.type==="core")return e.handler;return e.entry!==void 0?"server.ts":e.command.join(" ")}function g(e,n,t,r){return e.manifest.actions.map(s=>{const c=e.definition.actions[s.actionId];const a=c?.confirmation;const i=r?.get(s.actionId);const o=i!==void 0?{access:i,disputed:false}:$(t({actionId:s.actionId,confirmation:a,content:c?.content,backend:e.handlers[s.actionId]?.backend??s.backend}),n.has(s.actionId));return{actionId:s.actionId,backend:m(e.handlers[s.actionId]?.backend??s.backend),inputs:h(s.inputSchema),access:o.access,source:i!==void 0?"server":"declaration",disputed:o.disputed,confirmation:a??"native"}})}function y(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ")}function v(e){if(Array.isArray(e.enum))return e.enum[0];switch(e.type){case"string":return"\u2026";case"integer":case"number":return e.minimum??0;case"boolean":return true;case"null":return null;case"array":return[];case"object":return{};default:return null}}function S(e,n,t){const r=t.filter(o=>o.access!=="denied");const s=o=>n.manifest.actions.find(u=>u.actionId===o.actionId);const c=r.find(o=>(s(o)?.inputSchema.required??[]).length>0)??r[0];const a=c&&s(c);if(!c||!a)return void 0;const i={};for(const o of a.inputSchema.required??[]){const u=a.inputSchema.properties[o];if(u)i[o]=v(u)}return`crewx app run ${e} ${c.actionId} --input '${JSON.stringify(i)}'`}const I="agent: allowed = `crewx app run` runs it now; approval_required = the user approves once per task (exit 8 until then); denied = only the user operates it.";function _(e){if(e.length>0&&e.every(n=>n.source==="server"))return"Access source: the server, per action.";return"Access source: this App's declaration, checked against the server's agent-callable list. `crewx app state <instanceId>` shows the server's value per action once the App is open."}function j(e,n,t){const r=[f,"","| actionId | input | agent | confirmation |","|---|---|---|---|"];for(const i of t){const o=i.inputs.length>0?i.inputs.map(u=>`\`${y(u)}\``).join("<br>"):"(none)";r.push(`| \`${i.actionId}\` | ${o} | ${i.access} | ${i.confirmation} |`)}if(t.length===0)r.push("| (this App declares no actions) | | | |");r.push("",I,_(t));if(t.some(i=>i.backend==="server.ts"))r.push("Backend: server.ts (this App has no CLI command; its actions run from the App itself).");const s=t.filter(i=>i.disputed).map(i=>`\`${i.actionId}\``);if(s.length>0){r.push(`${s.join(", ")}: this directory's declaration denies the action but the server lists it as callable, so it is shown as approval_required. Open the App and read \`crewx app state <instanceId>\` for the server's value.`)}const c=n.manifest.actions.every(i=>i.inputSchema.additionalProperties===false);if(c&&t.length>0)r.push("Send exactly the keys listed; any other key is rejected.");const a=S(e,n,t);if(a)r.push(`Example: \`${a}\``);return r.join("\n")}function w(e,n){const t=n.length>0?`Agent-callable actions according to \`crewx app list\`: ${n.map(r=>`\`${r}\``).join(", ")}.`:"The server lists no agent-callable actions for this App; only the user operates it.";return[f,"","This App's declaration is not readable from this directory, so input shapes are not available here.",t,`To see the inputs and access of each action: \`crewx app open ${e}\`, then \`crewx app state <instanceId>\`.`].join("\n")}function q(e){const n=e.replace(/^?---\r?\n[\s\S]*?\r?\n---\r?\n?/,"");const t=Buffer.from(n,"utf8");if(t.length<=p)return n.trimEnd();return`${t.subarray(0,p).toString("utf8").replace(/�$/,"").trimEnd()}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NO_MANUAL_TEXT=void 0;exports.describeSchema=d;exports.describeInputs=h;exports.effectiveAccess=$;exports.describeBackend=m;exports.buildActionRows=g;exports.renderActionsSection=j;exports.renderServerOnlyActions=w;exports.manualBody=q;exports.renderConnectsTo=A;exports.renderUsage=O;exports.NO_MANUAL_TEXT="No manual for this App.";const f="## Actions (generated from this App's declaration; * = required)";const p=128*1024;function l(e,n,t){if(e!==void 0&&n!==void 0)return` ${e}\u2013${n}`;if(n!==void 0)return` \u2264${n}`;if(e!==void 0&&!(t&&e===0))return` \u2265${e}`;return""}function b(e){return JSON.stringify(e)}function d(e){if(Array.isArray(e.enum))return`one of ${e.enum.map(b).join(", ")}`;switch(e.type){case"string":return`string${l(e.minLength,e.maxLength,true)}`;case"integer":case"number":return`${e.type}${l(e.minimum,e.maximum,false)}`;case"boolean":return"boolean";case"null":return"null";case"array":{const n=e.items?` of ${d(e.items)}`:"";return`array${l(e.minItems,e.maxItems,true)}${n}`}case"object":{const n=Object.entries(e.properties??{});if(n.length===0)return"object";const t=new Set(e.required??[]);return`{${n.map(([r,s])=>`${r}${t.has(r)?"*":""}: ${d(s)}`).join(", ")}}`}default:return String(e.type)}}function h(e){const n=new Set(e.required??[]);return Object.entries(e.properties??{}).map(([t,r])=>`${t}${n.has(t)?"*":""}: ${d(r)}`)}function $(e,n){if(e==="allowed")return{access:n?"allowed":"denied",disputed:false};if(e==="approval_required")return{access:"approval_required",disputed:false};return n?{access:"approval_required",disputed:true}:{access:"denied",disputed:false}}function m(e){if(e.type==="core")return e.handler;return e.entry!==void 0?"server.ts":e.command.join(" ")}function g(e,n,t,r){return e.manifest.actions.map(s=>{const c=e.definition.actions[s.actionId];const a=c?.confirmation;const i=r?.get(s.actionId);const o=i!==void 0?{access:i,disputed:false}:$(t({actionId:s.actionId,confirmation:a,content:c?.content,backend:e.handlers[s.actionId]?.backend??s.backend}),n.has(s.actionId));return{actionId:s.actionId,backend:m(e.handlers[s.actionId]?.backend??s.backend),inputs:h(s.inputSchema),access:o.access,source:i!==void 0?"server":"declaration",disputed:o.disputed,confirmation:a??"native"}})}function v(e){return e.replace(/\|/g,"\\|").replace(/\r?\n/g," ")}function y(e){if(Array.isArray(e.enum))return e.enum[0];switch(e.type){case"string":return"\u2026";case"integer":case"number":return e.minimum??0;case"boolean":return true;case"null":return null;case"array":return[];case"object":return{};default:return null}}function S(e,n,t){const r=t.filter(o=>o.access!=="denied");const s=o=>n.manifest.actions.find(u=>u.actionId===o.actionId);const c=r.find(o=>(s(o)?.inputSchema.required??[]).length>0)??r[0];const a=c&&s(c);if(!c||!a)return void 0;const i={};for(const o of a.inputSchema.required??[]){const u=a.inputSchema.properties[o];if(u)i[o]=y(u)}return`crewx app run ${e} ${c.actionId} --input '${JSON.stringify(i)}'`}const I="agent: allowed = `crewx app run` runs it now; approval_required = the user approves per task or per conversation (exit 8 until then); denied = only the user operates it.";function _(e){if(e.length>0&&e.every(n=>n.source==="server"))return"Access source: the server, per action.";return"Access source: this App's declaration, checked against the server's agent-callable list. `crewx app state <instanceId>` shows the server's value per action once the App is open."}function j(e,n,t){const r=[f,"","| actionId | input | agent | confirmation |","|---|---|---|---|"];for(const i of t){const o=i.inputs.length>0?i.inputs.map(u=>`\`${v(u)}\``).join("<br>"):"(none)";r.push(`| \`${i.actionId}\` | ${o} | ${i.access} | ${i.confirmation} |`)}if(t.length===0)r.push("| (this App declares no actions) | | | |");r.push("",I,_(t));if(t.some(i=>i.backend==="server.ts"))r.push("Backend: server.ts (this App has no CLI command; its actions run from the App itself).");const s=t.filter(i=>i.disputed).map(i=>`\`${i.actionId}\``);if(s.length>0){r.push(`${s.join(", ")}: this directory's declaration denies the action but the server lists it as callable, so it is shown as approval_required. Open the App and read \`crewx app state <instanceId>\` for the server's value.`)}const c=n.manifest.actions.every(i=>i.inputSchema.additionalProperties===false);if(c&&t.length>0)r.push("Send exactly the keys listed; any other key is rejected.");const a=S(e,n,t);if(a)r.push(`Example: \`${a}\``);return r.join("\n")}function w(e,n){const t=n.length>0?`Agent-callable actions according to \`crewx app list\`: ${n.map(r=>`\`${r}\``).join(", ")}.`:"The server lists no agent-callable actions for this App; only the user operates it.";return[f,"","This App's declaration is not readable from this directory, so input shapes are not available here.",t,`To see the inputs and access of each action: \`crewx app open ${e}\`, then \`crewx app state <instanceId>\`.`].join("\n")}function q(e){const n=e.replace(/^?---\r?\n[\s\S]*?\r?\n---\r?\n?/,"");const t=Buffer.from(n,"utf8");if(t.length<=p)return n.trimEnd();return`${t.subarray(0,p).toString("utf8").replace(/�$/,"").trimEnd()}
2
2
 
3
3
  (manual truncated at ${p} bytes)`}function A(e){return e!==void 0&&e.length>0?`Connects to: ${e.join(", ")}
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewx/app",
3
- "version": "0.1.0-rc.31",
3
+ "version": "0.1.0-rc.33",
4
4
  "description": "Task-scoped CLI access to CrewX Apps",
5
5
  "type": "commonjs",
6
6
  "main": "dist/src/engine.js",
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "dependencies": {
30
30
  "esbuild": "0.27.7",
31
- "@crewx/sdk": "0.9.0-rc.150"
31
+ "@crewx/sdk": "0.9.0-rc.152"
32
32
  },
33
33
  "keywords": [
34
34
  "crewx",