@oracle-agent/oracle 0.35.34 → 0.35.36

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.
Files changed (64) hide show
  1. package/README.md +43 -8
  2. package/artifacts/specialist-packs/oracle-full-crypto.json +11 -0
  3. package/dist/address-book.mjs +2 -2
  4. package/dist/agent-sessions.mjs +8 -8
  5. package/dist/assets/profiles/canton-agent/SOUL.md +44 -0
  6. package/dist/assets/profiles/canton-agent/profile.json +30 -0
  7. package/dist/assets/profiles/oracle/SOUL.md +1 -0
  8. package/dist/assets/skills/oracle-canton/SKILL.md +49 -0
  9. package/dist/assets/skills/oracle-desk-product/SKILL.md +1 -1
  10. package/dist/bin/desk-server.mjs +35 -35
  11. package/dist/bin/oracle-data-mcp.mjs +17 -17
  12. package/dist/bin/oracle-gateway.mjs +14 -14
  13. package/dist/bin/oracle-launch-radar-shadow.mjs +4 -4
  14. package/dist/bin/oracle-mev-arb-shadow.mjs +4 -4
  15. package/dist/bin/oracle-mev-shadow.mjs +4 -4
  16. package/dist/bin/oracle-public-server.mjs +4 -4
  17. package/dist/bin/oracle-route.mjs +8 -8
  18. package/dist/bin/oracle-scan.mjs +10 -10
  19. package/dist/bin/oracle.mjs +8 -6
  20. package/dist/cli/commands/agent-session.mjs +10 -10
  21. package/dist/cli/commands/airdrop.mjs +16 -0
  22. package/dist/cli/commands/chain.mjs +1 -1
  23. package/dist/cli/commands/chat.mjs +215 -204
  24. package/dist/cli/commands/doctor.mjs +5 -5
  25. package/dist/cli/commands/eval.mjs +151 -141
  26. package/dist/cli/commands/extension-policy.mjs +3 -3
  27. package/dist/cli/commands/farm.mjs +22 -22
  28. package/dist/cli/commands/mint.mjs +22 -0
  29. package/dist/cli/commands/model.mjs +219 -208
  30. package/dist/cli/commands/plugins.mjs +42 -39
  31. package/dist/cli/commands/quickstart.mjs +6 -6
  32. package/dist/cli/commands/session-vault.mjs +1 -1
  33. package/dist/cli/commands/sign.mjs +12 -12
  34. package/dist/cli/commands/signer.mjs +25 -23
  35. package/dist/cli/commands/snipe.mjs +6 -6
  36. package/dist/cli/commands/swap.mjs +12 -12
  37. package/dist/cli/commands/venues.mjs +2 -2
  38. package/dist/control/receipt-lineage.mjs +1 -0
  39. package/dist/data/desk-data.mjs +33 -33
  40. package/dist/data/providers/farming.mjs +2 -2
  41. package/dist/data/providers/lp-destination-discovery.mjs +4 -4
  42. package/dist/index.mjs +50 -49
  43. package/dist/launch-radar/index.mjs +4 -4
  44. package/dist/local-signer/anvil-attestation-worker.mjs +1 -1
  45. package/dist/local-signer/index.mjs +3 -3
  46. package/dist/local-signer/runtime.mjs +22 -20
  47. package/dist/router/index.mjs +3 -3
  48. package/dist/router/prepare-bridge.mjs +1 -1
  49. package/dist/scanner/index.mjs +4 -4
  50. package/dist/task.mjs +2 -2
  51. package/dist/teams/index.mjs +3 -1
  52. package/dist/tui/standalone-client.mjs +85 -75
  53. package/package.json +3 -2
  54. package/public/eval-report.json +6 -6
  55. package/public/oracle-splash/assets/desktop-app.jpg +0 -0
  56. package/public/oracle-splash/assets/hero/agent-session-poster.jpg +0 -0
  57. package/public/oracle-splash/assets/hero/agent-session.mp4 +0 -0
  58. package/public/oracle-splash/assets/hero/agent-session.webm +0 -0
  59. package/public/oracle-splash/assets/oracle-cli-v03535-poster.jpg +0 -0
  60. package/public/oracle-splash/assets/oracle-cli-v03535.gif +0 -0
  61. package/public/oracle-splash/assets/protocol-build-time.jpg +0 -0
  62. package/public/oracle-splash/downloads/index.html +2 -2
  63. package/public/oracle-splash/index.html +132 -54
  64. package/server.json +2 -2
@@ -1,43 +1,46 @@
1
- import a from"node:fs";import l from"node:path";import{spawnSync as I}from"node:child_process";import v from"node:fs";import R from"node:os";import g from"node:path";import{fileURLToPath as L}from"node:url";var x=g.dirname(L(import.meta.url)),V=g.resolve(x,"../..");function w(){return process.env.ORACLE_FAKE_HOME||R.homedir()}function C(){return process.env.ORACLE_PUBLIC_DESKTOP==="1"}function y(){return C()?process.env.ORACLE_CONFIG_DIR||g.join(w(),".config","oracle"):g.join(w(),".config","oracle")}function b(){return g.join(y(),"desk.json")}function D(){return g.join(y(),"env")}function d({force:e=!1}={}){if(d._done&&!e)return d._result||null;d._done=!0;let n={},t=(r,i)=>{if(i==null)return;let o=String(i).trim();o&&(process.env[r]!=null&&String(process.env[r]).trim()!==""||(process.env[r]=o,n[r]=o))};try{let r=D();if(v.existsSync(r))for(let i of v.readFileSync(r,"utf8").split(/\r?\n/)){let o=i.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*?)\s*$/);if(!o||o[2].startsWith("#"))continue;let c=o[2];(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),t(o[1],c)}}catch{}try{let r=b();if(v.existsSync(r)){let i=JSON.parse(v.readFileSync(r,"utf8"));i&&typeof i=="object"&&(t("ORACLE_DESK_URL",i.deskUrl||i.dataUrl||i.url),t("ORACLE_DATA_URL",i.dataUrl||i.deskUrl||i.url),t("ORACLE_API_URL",i.apiUrl||i.dataUrl||i.deskUrl),t("ORACLE_PUBLIC_URL",i.publicUrl||i.deskUrl||i.dataUrl),t("ORACLE_EXEC_URL",i.execUrl),t("MAD_DESK_URL",i.deskUrl||i.dataUrl))}}catch{}let s=process.env.ORACLE_DESK_URL||process.env.ORACLE_DATA_URL||"";return s&&(t("ORACLE_DESK_URL",s),t("ORACLE_DATA_URL",s),t("ORACLE_API_URL",s),t("ORACLE_PUBLIC_URL",s),t("MAD_DESK_URL",s)),d._result=Object.keys(n).length?n:null,d._result}try{d()}catch{}import u from"node:fs";import p from"node:path";var m="https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",O=/^[a-z0-9]+(?:[._-][a-z0-9]+)*(?:\.[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/;function h(e){try{let n=u.lstatSync(e);return n.isDirectory()&&!n.isSymbolicLink()}catch{return!1}}function P(){return u.constants.O_NOFOLLOW||0}function k(e){try{let n=u.lstatSync(e);return n.isFile()&&!n.isSymbolicLink()}catch{return!1}}function j(e){if(!k(e))return null;let n=u.openSync(e,u.constants.O_RDONLY|P());try{return u.readFileSync(n,"utf8")}finally{u.closeSync(n)}}function U(e){let n=[],t=[];if(!e||typeof e!="object"||Array.isArray(e))return n.push("plugin.json must be a JSON object"),{valid:!1,errors:n,warnings:t};e.$schema!==m&&(e.$schema?n.push(`unsupported $schema: ${e.$schema} (expected ${m})`):n.push("$schema is required \u2014 must be "+m)),!e.name||typeof e.name!="string"?n.push("name is required (string)"):O.test(e.name)||n.push(`name "${e.name}" must be kebab-case dot-separated (e.g. deployment.tools)`),(e.version===void 0||e.version===null||e.version==="")&&t.push("version is missing \u2014 semantic versioning recommended"),e.description!==void 0&&typeof e.description!="string"&&t.push("description must be a string"),e.author!==void 0&&(typeof e.author!="object"||Array.isArray(e.author))&&t.push("author must be an object with optional name, email, url"),e.keywords!==void 0&&(Array.isArray(e.keywords)||t.push("keywords must be an array")),e.license!==void 0&&typeof e.license!="string"&&t.push("license must be a string");let s=new Set(["$schema","name","version","description","author","homepage","repository","license","keywords","extensions"]);for(let r of Object.keys(e))s.has(r)||t.push(`unknown field "${r}" \u2014 will be ignored (use extensions.<namespace> for client data)`);return{valid:n.length===0,errors:n,warnings:t}}function N(e){let n=p.join(e,"skills"),t=[];if(!h(n))return t;function s(r,i=""){for(let o of u.readdirSync(r,{withFileTypes:!0})){let c=p.join(r,o.name);if(o.isDirectory()){if(!h(c))continue;s(c,i?`${i}/${o.name}`:o.name)}else if(o.name.endsWith(".md")){if(!k(c))continue;let f=i?`${i}/${o.name.replace(/\.md$/,"")}`:o.name.replace(/\.md$/,"");t.push({name:f,path:c,relativePath:p.relative(n,c)})}}}return s(n),t}function F(e){let n=p.join(e,"mcp"),t=[];if(!h(n))return t;for(let s of u.readdirSync(n,{withFileTypes:!0})){if(!s.isFile()||!s.name.endsWith(".json"))continue;let r=p.join(n,s.name);if(k(r))try{let i=j(r);if(i===null)continue;let o=JSON.parse(i);t.push({name:s.name.replace(/\.json$/,""),path:r,config:o})}catch(i){t.push({name:s.name.replace(/\.json$/,""),path:r,error:`invalid JSON: ${i.message}`})}}return t}function $(e){let n=p.resolve(e);if(!h(n))return{ok:!1,error:`plugin directory not found: ${n}`};let t=p.join(n,"plugin.json");if(!u.existsSync(t))return{ok:!1,error:`missing plugin.json in ${n}`};let s;try{let c=j(t);if(c===null)return{ok:!1,error:`plugin.json must be a regular file in ${n}`};s=JSON.parse(c)}catch(c){return{ok:!1,error:`invalid plugin.json: ${c.message}`}}let r=U(s);if(!r.valid)return{ok:!1,error:"manifest validation failed",errors:r.errors};let i=N(n),o=F(n);return{ok:!0,plugin:{name:s.name,version:s.version||"0.0.0",description:s.description||"",author:s.author||{},license:s.license||"UNLICENSED",root:n,manifest:s,skills:i,mcpServers:o,warnings:[...r.warnings]}}}function A(e){let n=[];if(!h(e))return n;for(let t of u.readdirSync(e,{withFileTypes:!0})){if(!t.isDirectory())continue;let s=p.join(e,t.name),r=$(s);r.ok&&n.push(r.plugin)}return n}var M=/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/;function S(){let e=l.join(y(),"plugins");return a.existsSync(e)||a.mkdirSync(e,{recursive:!0}),e}function _(){return["oracle plugins \u2014 manage Agent Plugins (https://agent-plugins.org/)",""," oracle plugins install <path> install from a local directory"," oracle plugins install <git-url> clone a repo and install"," oracle plugins list show installed plugins"," oracle plugins remove <name> uninstall a plugin"," oracle plugins scan <path> validate without installing"," oracle plugins setup interactive setup wizard","","plugins are installed to ~/.config/oracle/plugins/<name>/",`schema: ${m}`].join(`
2
- `)}function E(e,{name:n}={}){let t=l.resolve(e);if(!a.existsSync(t)||!a.statSync(t).isDirectory())return process.stderr.write(`error: ${e} is not a directory
3
- `),1;let s=$(t);if(!s.ok){if(process.stderr.write(`error: invalid plugin at ${t}
4
- `),s.errors)for(let c of s.errors)process.stderr.write(` - ${c}
5
- `);return 1}let r=s.plugin,i=n||r.name.replace(/\//g,"-"),o=l.join(S(),i);if(a.existsSync(o))return process.stderr.write(`plugin "${i}" already installed. use oracle plugins remove first.
6
- `),1;if(a.cpSync(t,o,{recursive:!0}),process.stdout.write(`installed ${r.name} (v${r.version}) to ${o}
7
- `),process.stdout.write(` ${r.skills.length} skills, ${r.mcpServers.length} MCP servers
8
- `),r.warnings.length)for(let c of r.warnings)process.stdout.write(` warning: ${c}
9
- `);return 0}function W(e){let n=l.join(S(),".tmp-"+Date.now());try{let t=I("git",["clone","--depth","1",e,n],{stdio:"pipe",timeout:6e4});return t.status!==0?(process.stderr.write(`error: git clone failed: ${String(t.stderr).slice(0,200)}
10
- `),1):E(n)}finally{try{a.rmSync(n,{recursive:!0,force:!0})}catch{}}}function T(){let e=A(S());if(!e.length)return process.stdout.write(`no plugins installed
1
+ import a from"node:fs";import l from"node:path";import{spawnSync as k}from"node:child_process";import v from"node:fs";import R from"node:os";import m from"node:path";import{fileURLToPath as C}from"node:url";var b=m.dirname(C(import.meta.url)),X=m.resolve(b,"../..");function j(){return process.env.ORACLE_FAKE_HOME||R.homedir()}function x(){return process.env.ORACLE_PUBLIC_DESKTOP==="1"}function y(){return x()?process.env.ORACLE_CONFIG_DIR||m.join(j(),".config","oracle"):m.join(j(),".config","oracle")}function D(){return m.join(y(),"desk.json")}function O(){return m.join(y(),"env")}function d({force:n=!1}={}){if(d._done&&!n)return d._result||null;d._done=!0;let e={},t=(s,i)=>{if(i==null)return;let o=String(i).trim();o&&(process.env[s]!=null&&String(process.env[s]).trim()!==""||(process.env[s]=o,e[s]=o))};try{let s=O();if(v.existsSync(s))for(let i of v.readFileSync(s,"utf8").split(/\r?\n/)){let o=i.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*?)\s*$/);if(!o||o[2].startsWith("#"))continue;let c=o[2];(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),t(o[1],c)}}catch{}try{let s=D();if(v.existsSync(s)){let i=JSON.parse(v.readFileSync(s,"utf8"));i&&typeof i=="object"&&(t("ORACLE_DESK_URL",i.deskUrl||i.dataUrl||i.url),t("ORACLE_DATA_URL",i.dataUrl||i.deskUrl||i.url),t("ORACLE_API_URL",i.apiUrl||i.dataUrl||i.deskUrl),t("ORACLE_PUBLIC_URL",i.publicUrl||i.deskUrl||i.dataUrl),t("ORACLE_EXEC_URL",i.execUrl),t("MAD_DESK_URL",i.deskUrl||i.dataUrl))}}catch{}let r=process.env.ORACLE_DESK_URL||process.env.ORACLE_DATA_URL||"";return r&&(t("ORACLE_DESK_URL",r),t("ORACLE_DATA_URL",r),t("ORACLE_API_URL",r),t("ORACLE_PUBLIC_URL",r),t("MAD_DESK_URL",r)),d._result=Object.keys(e).length?e:null,d._result}try{d()}catch{}import u from"node:fs";import f from"node:path";var g="https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",P=/^[a-z0-9]+(?:[._-][a-z0-9]+)*(?:\.[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/;function h(n){try{let e=u.lstatSync(n);return e.isDirectory()&&!e.isSymbolicLink()}catch{return!1}}function U(){return u.constants.O_NOFOLLOW||0}function w(n){try{let e=u.lstatSync(n);return e.isFile()&&!e.isSymbolicLink()}catch{return!1}}function A(n){if(!w(n))return null;let e=u.openSync(n,u.constants.O_RDONLY|U());try{return u.readFileSync(e,"utf8")}finally{u.closeSync(e)}}function F(n){let e=[],t=[];if(!n||typeof n!="object"||Array.isArray(n))return e.push("plugin.json must be a JSON object"),{valid:!1,errors:e,warnings:t};n.$schema!==g&&(n.$schema?e.push(`unsupported $schema: ${n.$schema} (expected ${g})`):e.push("$schema is required \u2014 must be "+g)),!n.name||typeof n.name!="string"?e.push("name is required (string)"):P.test(n.name)||e.push(`name "${n.name}" must be kebab-case dot-separated (e.g. deployment.tools)`),(n.version===void 0||n.version===null||n.version==="")&&t.push("version is missing \u2014 semantic versioning recommended"),n.description!==void 0&&typeof n.description!="string"&&t.push("description must be a string"),n.author!==void 0&&(typeof n.author!="object"||Array.isArray(n.author))&&t.push("author must be an object with optional name, email, url"),n.keywords!==void 0&&(Array.isArray(n.keywords)||t.push("keywords must be an array")),n.license!==void 0&&typeof n.license!="string"&&t.push("license must be a string");let r=new Set(["$schema","name","version","description","author","homepage","repository","license","keywords","extensions"]);for(let s of Object.keys(n))r.has(s)||t.push(`unknown field "${s}" \u2014 will be ignored (use extensions.<namespace> for client data)`);return{valid:e.length===0,errors:e,warnings:t}}function N(n){let e=f.join(n,"skills"),t=[];if(!h(e))return t;function r(s,i=""){for(let o of u.readdirSync(s,{withFileTypes:!0})){let c=f.join(s,o.name);if(o.isDirectory()){if(!h(c))continue;r(c,i?`${i}/${o.name}`:o.name)}else if(o.name.endsWith(".md")){if(!w(c))continue;let p=i?`${i}/${o.name.replace(/\.md$/,"")}`:o.name.replace(/\.md$/,"");t.push({name:p,path:c,relativePath:f.relative(e,c)})}}}return r(e),t}function I(n){let e=f.join(n,"mcp"),t=[];if(!h(e))return t;for(let r of u.readdirSync(e,{withFileTypes:!0})){if(!r.isFile()||!r.name.endsWith(".json"))continue;let s=f.join(e,r.name);if(w(s))try{let i=A(s);if(i===null)continue;let o=JSON.parse(i);t.push({name:r.name.replace(/\.json$/,""),path:s,config:o})}catch(i){t.push({name:r.name.replace(/\.json$/,""),path:s,error:`invalid JSON: ${i.message}`})}}return t}function $(n){let e=f.resolve(n);if(!h(e))return{ok:!1,error:`plugin directory not found: ${e}`};let t=f.join(e,"plugin.json");if(!u.existsSync(t))return{ok:!1,error:`missing plugin.json in ${e}`};let r;try{let c=A(t);if(c===null)return{ok:!1,error:`plugin.json must be a regular file in ${e}`};r=JSON.parse(c)}catch(c){return{ok:!1,error:`invalid plugin.json: ${c.message}`}}let s=F(r);if(!s.valid)return{ok:!1,error:"manifest validation failed",errors:s.errors};let i=N(e),o=I(e);return{ok:!0,plugin:{name:r.name,version:r.version||"0.0.0",description:r.description||"",author:r.author||{},license:r.license||"UNLICENSED",root:e,manifest:r,skills:i,mcpServers:o,warnings:[...s.warnings]}}}function E(n){let e=[];if(!h(n))return e;for(let t of u.readdirSync(n,{withFileTypes:!0})){if(!t.isDirectory())continue;let r=f.join(n,t.name),s=$(r);s.ok&&e.push(s.plugin)}return e}var M=/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/;function S(){let n=l.join(y(),"plugins");return a.existsSync(n)||a.mkdirSync(n,{recursive:!0}),n}function _(){return["oracle plugins \u2014 manage Agent Plugins (https://agent-plugins.org/)",""," oracle plugins install <path> install from a local directory"," oracle plugins install <git-url#commit> clone and verify an immutable commit"," oracle plugins list show installed plugins"," oracle plugins remove <name> uninstall a plugin"," oracle plugins scan <path> validate without installing"," oracle plugins setup interactive setup wizard","","plugins are installed to ~/.config/oracle/plugins/<name>/",`schema: ${g}`].join(`
2
+ `)}function L(n,{name:e,provenance:t=null}={}){let r=l.resolve(n);if(!a.existsSync(r)||!a.statSync(r).isDirectory())return process.stderr.write(`error: ${n} is not a directory
3
+ `),1;let s=$(r);if(!s.ok){if(process.stderr.write(`error: invalid plugin at ${r}
4
+ `),s.errors)for(let p of s.errors)process.stderr.write(` - ${p}
5
+ `);return 1}let i=s.plugin,o=e||i.name.replace(/\//g,"-"),c=l.join(S(),o);if(a.existsSync(c))return process.stderr.write(`plugin "${o}" already installed. use oracle plugins remove first.
6
+ `),1;if(a.cpSync(r,c,{recursive:!0}),t&&a.writeFileSync(l.join(c,".oracle-provenance.json"),`${JSON.stringify(t,null,2)}
7
+ `,{encoding:"utf8",mode:384,flag:"wx"}),process.stdout.write(`installed ${i.name} (v${i.version}) to ${c}
8
+ `),process.stdout.write(` ${i.skills.length} skills, ${i.mcpServers.length} MCP servers
9
+ `),i.warnings.length)for(let p of i.warnings)process.stdout.write(` warning: ${p}
10
+ `);return 0}function W(n){let e=String(n||"").match(/^(.*)#([0-9a-fA-F]{40})$/);if(!e||!e[1])return null;let t=e[1];if(t.startsWith("git@"))return/\s/.test(t)?null:{url:t,commit:e[2].toLowerCase()};try{let r=new URL(t);return!["https:","ssh:"].includes(r.protocol)||r.username||r.password||r.search?null:{url:r.toString(),commit:e[2].toLowerCase()}}catch{return null}}function T(n){let e=W(n);if(!e)return process.stderr.write(`error: remote plugin installs require an immutable #<40-hex-commit> pin
11
+ `),1;let t=l.join(S(),".tmp-"+Date.now());try{if(k("git",["clone","--no-checkout","--filter=blob:none",e.url,t],{stdio:"pipe",timeout:6e4,shell:!1}).status!==0)return process.stderr.write(`error: git clone failed (details withheld to avoid leaking source credentials)
12
+ `),1;let s=k("git",["-C",t,"checkout","--detach",e.commit],{stdio:"pipe",timeout:3e4,shell:!1}),i=k("git",["-C",t,"rev-parse","HEAD"],{encoding:"utf8",stdio:["ignore","pipe","pipe"],timeout:1e4,shell:!1});return s.status!==0||i.status!==0||i.stdout.trim().toLowerCase()!==e.commit?(process.stderr.write(`error: pinned plugin commit could not be verified
13
+ `),1):L(t,{provenance:{type:"git",source:e.url,commit:e.commit}})}finally{try{a.rmSync(t,{recursive:!0,force:!0})}catch{}}}function H(){let n=E(S());if(!n.length)return process.stdout.write(`no plugins installed
11
14
  `),process.stdout.write(`install with: oracle plugins install <path|url>
12
- `),0;process.stdout.write(`${e.length} plugin(s) installed
15
+ `),0;process.stdout.write(`${n.length} plugin(s) installed
13
16
 
14
- `);for(let n of e){let t=l.basename(n.root);process.stdout.write(` ${n.name} (v${n.version})
15
- `),process.stdout.write(` path: ${n.root}
16
- `),n.description&&process.stdout.write(` desc: ${n.description}
17
- `),process.stdout.write(` ${n.skills.length} skills, ${n.mcpServers.length} MCP servers
18
- `),n.license!=="UNLICENSED"&&process.stdout.write(` license: ${n.license}
17
+ `);for(let e of n){let t=l.basename(e.root);process.stdout.write(` ${e.name} (v${e.version})
18
+ `),process.stdout.write(` path: ${e.root}
19
+ `),e.description&&process.stdout.write(` desc: ${e.description}
20
+ `),process.stdout.write(` ${e.skills.length} skills, ${e.mcpServers.length} MCP servers
21
+ `),e.license!=="UNLICENSED"&&process.stdout.write(` license: ${e.license}
19
22
  `),process.stdout.write(`
20
- `)}return 0}function H(e){if(!e)return process.stderr.write(`usage: oracle plugins remove <name>
21
- `),1;if(!M.test(e)||l.basename(e)!==e||l.isAbsolute(e))return process.stderr.write(`invalid plugin name "${e}"
22
- `),1;let n=S(),t=a.lstatSync(n);if(t.isSymbolicLink()||!t.isDirectory())return process.stderr.write(`refusing to remove plugin: plugin root is not a regular directory
23
- `),1;let s=l.resolve(n,e),r=l.relative(n,s);if(!r||r===".."||r.startsWith(`..${l.sep}`)||l.isAbsolute(r))return process.stderr.write(`invalid plugin name "${e}"
24
- `),1;if(!a.existsSync(s))return process.stderr.write(`plugin "${e}" not found
25
- `),1;let i=a.lstatSync(s);if(i.isSymbolicLink()||!i.isDirectory())return process.stderr.write(`refusing to remove plugin "${e}": path is not a regular plugin directory
26
- `),1;let o=a.realpathSync(n),c=a.realpathSync(s),f=l.relative(o,c);return!f||f===".."||f.startsWith(`..${l.sep}`)||l.isAbsolute(f)?(process.stderr.write(`refusing to remove plugin "${e}": path escapes the plugin directory
27
- `),1):(a.rmSync(s,{recursive:!0,force:!0}),process.stdout.write(`removed plugin "${e}"
28
- `),0)}function K(e){let n=l.resolve(e),t=$(n);if(!t.ok){if(process.stderr.write(`invalid plugin: ${t.error}
29
- `),t.errors)for(let r of t.errors)process.stderr.write(` error: ${r}
30
- `);return 1}let s=t.plugin;process.stdout.write(`valid plugin: ${s.name} (v${s.version})
31
- `),process.stdout.write(` schema: ${s.manifest.$schema}
32
- `),process.stdout.write(` skills: ${s.skills.length} found
33
- `);for(let r of s.skills)process.stdout.write(` - ${r.name} (${r.relativePath})
34
- `);process.stdout.write(` mcp servers: ${s.mcpServers.length} found
35
- `);for(let r of s.mcpServers){let i=r.error?`ERROR: ${r.error}`:"ok";process.stdout.write(` - ${r.name}: ${i}
36
- `)}if(s.warnings.length){process.stdout.write(` warnings:
37
- `);for(let r of s.warnings)process.stdout.write(` - ${r}
38
- `)}return 0}function z(){return process.stdout.write(["oracle plugins setup","","Agent Plugins (https://agent-plugins.org/) is an open standard for","portable AI agent tooling. Plugins ship skills and MCP servers in a","standard package format that works across compatible clients.","","To create a plugin:"," 1. Create a directory with a plugin.json manifest"," 2. Add skills as .md files in skills/"," 3. Add MCP server configs as .json files in mcp/"," 4. Validate: oracle plugins scan <dir>"," 5. Install: oracle plugins install <dir>","","To install an existing plugin:"," oracle plugins install <path> local directory"," oracle plugins install <git-url> git repository","",`schema: ${m}`,""].join(`
39
- `)),0}var ie={name:"plugins",summary:"manage Agent Plugins (open-standard portable agent tooling)",group:"read",usage:_(),async run(e){let n=[...e.argv],t=(n[0]||"help").toLowerCase(),s=n.slice(1);if(t==="-h"||t==="--help"||t==="help")return process.stdout.write(_()+`
40
- `),0;if(t==="list"||t==="ls")return T();if(t==="install"||t==="add"){let r=s[0];return r?r.startsWith("http://")||r.startsWith("https://")||r.startsWith("git@")?W(r):E(r):(process.stderr.write(`usage: oracle plugins install <path|url>
41
- `),1)}return t==="remove"||t==="rm"||t==="uninstall"?H(s[0]):t==="scan"||t==="validate"?K(s[0]||"."):t==="setup"?z():(process.stderr.write(`oracle plugins: unknown verb '${t}'
23
+ `)}return 0}function K(n){if(!n)return process.stderr.write(`usage: oracle plugins remove <name>
24
+ `),1;if(!M.test(n)||l.basename(n)!==n||l.isAbsolute(n))return process.stderr.write(`invalid plugin name "${n}"
25
+ `),1;let e=S(),t=a.lstatSync(e);if(t.isSymbolicLink()||!t.isDirectory())return process.stderr.write(`refusing to remove plugin: plugin root is not a regular directory
26
+ `),1;let r=l.resolve(e,n),s=l.relative(e,r);if(!s||s===".."||s.startsWith(`..${l.sep}`)||l.isAbsolute(s))return process.stderr.write(`invalid plugin name "${n}"
27
+ `),1;if(!a.existsSync(r))return process.stderr.write(`plugin "${n}" not found
28
+ `),1;let i=a.lstatSync(r);if(i.isSymbolicLink()||!i.isDirectory())return process.stderr.write(`refusing to remove plugin "${n}": path is not a regular plugin directory
29
+ `),1;let o=a.realpathSync(e),c=a.realpathSync(r),p=l.relative(o,c);return!p||p===".."||p.startsWith(`..${l.sep}`)||l.isAbsolute(p)?(process.stderr.write(`refusing to remove plugin "${n}": path escapes the plugin directory
30
+ `),1):(a.rmSync(r,{recursive:!0,force:!0}),process.stdout.write(`removed plugin "${n}"
31
+ `),0)}function z(n){let e=l.resolve(n),t=$(e);if(!t.ok){if(process.stderr.write(`invalid plugin: ${t.error}
32
+ `),t.errors)for(let s of t.errors)process.stderr.write(` error: ${s}
33
+ `);return 1}let r=t.plugin;process.stdout.write(`valid plugin: ${r.name} (v${r.version})
34
+ `),process.stdout.write(` schema: ${r.manifest.$schema}
35
+ `),process.stdout.write(` skills: ${r.skills.length} found
36
+ `);for(let s of r.skills)process.stdout.write(` - ${s.name} (${s.relativePath})
37
+ `);process.stdout.write(` mcp servers: ${r.mcpServers.length} found
38
+ `);for(let s of r.mcpServers){let i=s.error?`ERROR: ${s.error}`:"ok";process.stdout.write(` - ${s.name}: ${i}
39
+ `)}if(r.warnings.length){process.stdout.write(` warnings:
40
+ `);for(let s of r.warnings)process.stdout.write(` - ${s}
41
+ `)}return 0}function J(){return process.stdout.write(["oracle plugins setup","","Agent Plugins (https://agent-plugins.org/) is an open standard for","portable AI agent tooling. Plugins ship skills and MCP servers in a","standard package format that works across compatible clients.","","To create a plugin:"," 1. Create a directory with a plugin.json manifest"," 2. Add skills as .md files in skills/"," 3. Add MCP server configs as .json files in mcp/"," 4. Validate: oracle plugins scan <dir>"," 5. Install: oracle plugins install <dir>","","To install an existing plugin:"," oracle plugins install <path> local directory"," oracle plugins install <git-url#commit> pinned git repository","",`schema: ${g}`,""].join(`
42
+ `)),0}var oe={name:"plugins",summary:"manage Agent Plugins (open-standard portable agent tooling)",group:"read",usage:_(),async run(n){let e=[...n.argv],t=(e[0]||"help").toLowerCase(),r=e.slice(1);if(t==="-h"||t==="--help"||t==="help")return process.stdout.write(_()+`
43
+ `),0;if(t==="list"||t==="ls")return H();if(t==="install"||t==="add"){let s=r[0];return s?s.startsWith("https://")||s.startsWith("ssh://")||s.startsWith("git@")?T(s):L(s):(process.stderr.write(`usage: oracle plugins install <path|url>
44
+ `),1)}return t==="remove"||t==="rm"||t==="uninstall"?K(r[0]):t==="scan"||t==="validate"?z(r[0]||"."):t==="setup"?J():(process.stderr.write(`oracle plugins: unknown verb '${t}'
42
45
  ${_()}
43
- `),1)}};export{ie as default};
46
+ `),1)}};export{oe as default,W as parsePinnedGitSource};