@hugomrdias/fil 0.0.0-stage → 0.0.0
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/LICENSE +21 -0
- package/README.md +136 -2
- package/bin/fil.js +7 -0
- package/dist/chunks/_esm-BBXTTBLC.js +9 -0
- package/dist/chunks/_esm-BBXTTBLC.js.map +7 -0
- package/dist/chunks/ccip-TGFMQFIR.js +3 -0
- package/dist/chunks/ccip-TGFMQFIR.js.map +7 -0
- package/dist/chunks/chunk-2KPBBDBJ.js +3 -0
- package/dist/chunks/chunk-2KPBBDBJ.js.map +7 -0
- package/dist/chunks/chunk-35V77X3C.js +12 -0
- package/dist/chunks/chunk-35V77X3C.js.map +7 -0
- package/dist/chunks/chunk-46FBFEBX.js +3 -0
- package/dist/chunks/chunk-46FBFEBX.js.map +7 -0
- package/dist/chunks/chunk-4BBXH7CB.js +6 -0
- package/dist/chunks/chunk-4BBXH7CB.js.map +7 -0
- package/dist/chunks/chunk-4DUACCJB.js +186 -0
- package/dist/chunks/chunk-4DUACCJB.js.map +7 -0
- package/dist/chunks/chunk-5EYSPKTK.js +3 -0
- package/dist/chunks/chunk-5EYSPKTK.js.map +7 -0
- package/dist/chunks/chunk-7MEK5RQ7.js +11 -0
- package/dist/chunks/chunk-7MEK5RQ7.js.map +7 -0
- package/dist/chunks/chunk-7WN6TT5U.js +4 -0
- package/dist/chunks/chunk-7WN6TT5U.js.map +7 -0
- package/dist/chunks/chunk-CU3SGKNA.js +3 -0
- package/dist/chunks/chunk-CU3SGKNA.js.map +7 -0
- package/dist/chunks/chunk-EDF5XCIN.js +4 -0
- package/dist/chunks/chunk-EDF5XCIN.js.map +7 -0
- package/dist/chunks/chunk-GVAFHRPJ.js +124 -0
- package/dist/chunks/chunk-GVAFHRPJ.js.map +7 -0
- package/dist/chunks/chunk-IJ2NNDTJ.js +3 -0
- package/dist/chunks/chunk-IJ2NNDTJ.js.map +7 -0
- package/dist/chunks/chunk-ISML2NA2.js +3 -0
- package/dist/chunks/chunk-ISML2NA2.js.map +7 -0
- package/dist/chunks/chunk-KAQPCD23.js +4 -0
- package/dist/chunks/chunk-KAQPCD23.js.map +7 -0
- package/dist/chunks/chunk-LOTWVNDB.js +3 -0
- package/dist/chunks/chunk-LOTWVNDB.js.map +7 -0
- package/dist/chunks/chunk-NPYAGWD6.js +4 -0
- package/dist/chunks/chunk-NPYAGWD6.js.map +7 -0
- package/dist/chunks/chunk-QYPR6473.js +3 -0
- package/dist/chunks/chunk-QYPR6473.js.map +7 -0
- package/dist/chunks/chunk-RK6JJQZL.js +41 -0
- package/dist/chunks/chunk-RK6JJQZL.js.map +7 -0
- package/dist/chunks/chunk-UJQDDRQD.js +59 -0
- package/dist/chunks/chunk-UJQDDRQD.js.map +7 -0
- package/dist/chunks/chunk-UVXTIEPU.js +4 -0
- package/dist/chunks/chunk-UVXTIEPU.js.map +7 -0
- package/dist/chunks/chunk-VTR7BON5.js +4 -0
- package/dist/chunks/chunk-VTR7BON5.js.map +7 -0
- package/dist/chunks/chunk-XQRC2SUG.js +4 -0
- package/dist/chunks/chunk-XQRC2SUG.js.map +7 -0
- package/dist/chunks/chunk-YIAP3JO3.js +3 -0
- package/dist/chunks/chunk-YIAP3JO3.js.map +7 -0
- package/dist/chunks/chunk-ZD6MKB4J.js +5 -0
- package/dist/chunks/chunk-ZD6MKB4J.js.map +7 -0
- package/dist/chunks/delete-XVYLEMHB.js +3 -0
- package/dist/chunks/delete-XVYLEMHB.js.map +7 -0
- package/dist/chunks/doctor-2W65SQJS.js +3 -0
- package/dist/chunks/doctor-2W65SQJS.js.map +7 -0
- package/dist/chunks/get-ZP66WVWT.js +3 -0
- package/dist/chunks/get-ZP66WVWT.js.map +7 -0
- package/dist/chunks/inspect-HV2SQPTB.js +3 -0
- package/dist/chunks/inspect-HV2SQPTB.js.map +7 -0
- package/dist/chunks/inspect-PQCV7LQT.js +3 -0
- package/dist/chunks/inspect-PQCV7LQT.js.map +7 -0
- package/dist/chunks/login-GQ4PM7SA.js +4 -0
- package/dist/chunks/login-GQ4PM7SA.js.map +7 -0
- package/dist/chunks/logout-7N23QWWM.js +3 -0
- package/dist/chunks/logout-7N23QWWM.js.map +7 -0
- package/dist/chunks/ls-7XYH5VPL.js +3 -0
- package/dist/chunks/ls-7XYH5VPL.js.map +7 -0
- package/dist/chunks/ls-ARM57VNR.js +3 -0
- package/dist/chunks/ls-ARM57VNR.js.map +7 -0
- package/dist/chunks/map-error-7POTPJ7R.js +3 -0
- package/dist/chunks/map-error-7POTPJ7R.js.map +7 -0
- package/dist/chunks/put-EHRNCZHT.js +3 -0
- package/dist/chunks/put-EHRNCZHT.js.map +7 -0
- package/dist/chunks/resume-RLZB7L3C.js +3 -0
- package/dist/chunks/resume-RLZB7L3C.js.map +7 -0
- package/dist/chunks/secp256k1-2OHXXNYZ.js +3 -0
- package/dist/chunks/secp256k1-2OHXXNYZ.js.map +7 -0
- package/dist/chunks/skills.run-IDY347MW.js +5 -0
- package/dist/chunks/skills.run-IDY347MW.js.map +7 -0
- package/dist/chunks/status-D4CXVYRA.js +3 -0
- package/dist/chunks/status-D4CXVYRA.js.map +7 -0
- package/dist/main.js +3 -0
- package/dist/main.js.map +7 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +52 -3
- package/skills/fil/SKILL.md +28 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
var x=Symbol.for("clipact.ok");function W(e){return typeof e=="object"&&e!==null&&x in e}function H(e,t){return{[x]:!0,data:e,next:t}}var O=Symbol.for("clipact.handler");function K(e){return typeof e=="object"&&e!==null&&O in e}function p(e){if(e.readOnly&&e.confirm)throw new TypeError(`Command "${e.name}" cannot be readOnly and require confirmation`);for(let t of e.secrets??[])if(!e.env?.[t])throw new TypeError(`Secret field "${t}" of command "${e.name}" needs an env mapping`);return Object.freeze({kind:"command",...e,idempotent:e.readOnly===!0||e.idempotent===!0})}var d=new WeakMap;function F(e,t={}){return d.set(e,t),e}function M(e){return d.has(e)}function V(e){return d.get(e)?.plainText===!0}function Q(e){return d.get(e)?.commandPath}function $(e){return Object.freeze({kind:"group",...e})}function X(e,t){return{[O]:!0,run:async r=>await t(r)}}function a(e){let t=()=>({$schema:"https://json-schema.org/draft/2020-12/schema",...structuredClone(e)});return{"~standard":{version:1,vendor:"clipact",validate(r){let i=[],o=f(e,r,[],i);return i.length>0?{issues:i}:{value:o}},jsonSchema:{input:t,output:t}}}}function f(e,t,r,i){if(t===void 0&&e.default!==void 0)return structuredClone(e.default);if(e.type==="object"){if(typeof t!="object"||t===null||Array.isArray(t))return i.push({message:"Expected an object",path:r}),t;let o=t,c=e.properties??{},s={};for(let n of Object.keys(o))!(n in c)&&e.additionalProperties===!1&&i.push({message:"Unknown field",path:[...r,n]});for(let[n,j]of Object.entries(c)){if(o[n]===void 0&&j.default===void 0){e.required?.includes(n)&&i.push({message:"Required",path:[...r,n]});continue}s[n]=f(j,o[n],[...r,n],i)}return s}if(e.type==="array"){if(!Array.isArray(t))return i.push({message:"Expected an array",path:r}),t;let o=e.items;return o?t.map((c,s)=>f(o,c,[...r,s],i)):t}return typeof t!==e.type?i.push({message:`Expected a ${e.type}`,path:r}):e.enum&&!e.enum.includes(t)&&i.push({message:`Expected one of: ${e.enum.join(", ")}`,path:r}),t}var T=a({type:"array",items:{type:"object",properties:{path:{type:"string"},message:{type:"string"},source:{type:"string"}},required:["path","message"],additionalProperties:!1}}),A=a({type:"object",properties:{reason:{type:"string"}},required:["reason"],additionalProperties:!1}),S=Object.freeze({invalid_input:{description:"The arguments, flags, --input JSON, or environment variables are invalid.",details:T},confirmation_required:{description:"The command needs confirmation; a human approves it and runs it with --yes.",details:A},interrupted:{description:"A signal stopped the command; follow the next steps to inspect or resume it."},internal_error:{description:"An unexpected failure in the CLI; report it."},rate_limited:{description:"A service limited the request rate."},service_unavailable:{description:"A service the command depends on is unavailable."},timeout:{description:"A request took too long."}}),te=Object.freeze(Object.keys(S)),C=Object.freeze({skill_conflict:{description:"Installed skill directories have local changes, are symbolic links, or were not installed by this CLI.",details:a({type:"array",items:{type:"object",properties:{name:{type:"string"},target:{type:"string",enum:["agents","claude"]},path:{type:"string"},reason:{type:"string",enum:["edited","unmanaged","symlink"]},files:{type:"array",items:{type:"string"}},resolvesTo:{type:"string"}},required:["name","target","path","reason"],additionalProperties:!1}})}});function re(e,t){let r={...S,...t?C:{}};for(let i of Object.keys(e??{}))if(i in r)throw new TypeError(`Error code "${i}" is built in and cannot be redefined`);return Object.freeze({...r,...e})}var ne=new Set(["rate_limited","service_unavailable","timeout"]),y=class extends Error{code;retryable;retryAfterSeconds;details;next;constructor(t){super(t.message,{cause:t.cause}),this.name="CliError",this.code=t.code,this.retryable=t.retryable,this.retryAfterSeconds=t.retryAfterSeconds,this.details=t.details,this.next=t.next}};function ie(e){return e instanceof y||e instanceof Error&&e.name==="CliError"&&typeof e.code=="string"}var E=class extends Error{constructor(t,r){super(`Invalid definition for "${t}": ${r}`),this.name="DefinitionError"}};import{homedir as P}from"node:os";import{relative as L,sep as R}from"node:path";import{fileURLToPath as q}from"node:url";var k=["agents","claude"],v=["project","global"],b={type:"string",enum:v},u={...b,description:"project installs under the current directory; global under the home directory"},w={type:"array",items:{type:"string",enum:k},default:k,description:"Skills directories: agents (.agents/skills) and claude (.claude/skills)"},l={type:"string"},I={type:"string",enum:k};function m(e,t=[]){return{type:"object",properties:e,required:Object.keys(e).filter(r=>!t.includes(r)),additionalProperties:!1}}function _(e,t={}){return m({scope:b,skills:{type:"array",items:m({name:l,target:I,path:l,action:{type:"string",enum:e},...t},Object.keys(t))}})}var N=a({type:"object",properties:{scope:{...u,default:"project"},target:w,force:{type:"boolean",default:!1,description:"Replace skill directories that were edited or not installed by this CLI"}},additionalProperties:!1}),z=a(_(["installed","updated","unchanged"])),B=a({type:"object",properties:{scope:{...u,default:"project"},target:w},additionalProperties:!1}),U=a(_(["removed","missing","unmanaged","symlink"],{kept:{type:"array",items:l}})),D=a({type:"object",properties:{scope:{...u,description:`${u.description}; both when omitted`}},additionalProperties:!1}),G=a(m({version:{type:"string",description:"Version of the running CLI"},skills:{type:"array",items:m({name:l,scope:b,target:I,path:l,status:{type:"string",enum:["missing","unmanaged","symlink","current","stale","edited"]},version:l},["version"])}}));function h(e){let t=process.cwd();if(e.startsWith(`${t}${R}`))return L(t,e);let r=P();return e.startsWith(`${r}${R}`)?`~${e.slice(r.length)}`:e}function J(e){return typeof e=="string"&&!e.startsWith("file:")?e:q(e)}function g(e){return async()=>({default:e(await import("./skills.run-IDY347MW.js"))})}function de(e,t){let r=J(t),i=p({name:"install",description:"Install the bundled agent skills",examples:[`${e.name} skills install`,`${e.name} skills install --scope global --target claude`],input:N,output:z,errors:["skill_conflict"],idempotent:!0,dryRun:!0,human:s=>s.skills.map(n=>`${n.action}: ${h(n.path)}`).join(`
|
|
3
|
+
`),handler:g(s=>s.install(e,r,i))}),o=p({name:"uninstall",description:"Remove installed skill files that were not edited",examples:[`${e.name} skills uninstall`],input:B,output:U,idempotent:!0,dryRun:!0,human:s=>s.skills.map(n=>`${n.action}: ${h(n.path)}${n.kept?` (kept ${n.kept.join(", ")})`:""}`).join(`
|
|
4
|
+
`),handler:g(s=>s.uninstall(e,r,o))}),c=p({name:"status",description:"Report installed skills and whether they are stale or edited",examples:[`${e.name} skills status --json`],input:D,output:G,readOnly:!0,human:s=>s.skills.map(n=>`${n.status.padEnd(9)} ${h(n.path)}${n.version?` (${n.version})`:""}`).join(`
|
|
5
|
+
`),handler:g(s=>s.status(e,r,c))});return $({name:"skills",description:"Install the agent skills bundled with this CLI",commands:[i,c,o]})}export{W as a,H as b,K as c,p as d,F as e,M as f,V as g,Q as h,$ as i,X as j,a as k,te as l,re as m,ne as n,y as o,ie as p,E as q,k as r,J as s,de as t};
|
|
6
|
+
//# sourceMappingURL=chunk-4BBXH7CB.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../clipact/src/define.ts", "../../../clipact/src/json-schema.ts", "../../../clipact/src/errors.ts", "../../../clipact/src/skills.ts"],
|
|
4
|
+
"sourcesContent": ["import type {\n StandardJSONSchemaV1,\n StandardSchemaV1,\n} from '@standard-schema/spec'\nimport type { CliError, ErrorRegistry, Next } from './errors.ts'\n\n/**\n * A schema that validates and exports JSON Schema, such as a zod v4 schema.\n *\n * @see https://standardschema.dev/json-schema\n */\nexport type Schema = StandardSchemaV1 & StandardJSONSchemaV1\n\n/** Values accepted by an input schema; field names come from here. */\nexport type InputOf<S> = S extends StandardSchemaV1\n ? StandardSchemaV1.InferInput<S>\n : Record<string, never>\n\n/** Values produced by an input schema after defaults and transforms. */\nexport type ParsedOf<S> = S extends StandardSchemaV1\n ? StandardSchemaV1.InferOutput<S>\n : Record<string, never>\n\n/** Data a handler returns for an output schema, or any object without one. */\nexport type DataOf<S> = S extends StandardSchemaV1\n ? StandardSchemaV1.InferInput<S>\n : Record<string, unknown>\n\n/** Names of an input schema's fields. */\nexport type FieldOf<S> = Extract<keyof InputOf<S>, string>\n\n/** A module whose default export is created by {@link defineHandler}. */\nexport type HandlerLoader = () => Promise<unknown>\n\n/** Properties accepted by {@link defineCommand}. */\nexport interface CommandOptions<\n I extends Schema | undefined,\n O extends Schema | undefined,\n> {\n /** One word; the command's path is its group names plus this name. */\n name: string\n /** One line, used in help and `schema --list`. */\n description: string\n /** Runnable command lines, shown first in agent help. */\n examples?: string[]\n /** One object schema for everything the command accepts. */\n input?: I\n /** Input fields that may be given as positional arguments, in order. */\n positionals?: FieldOf<I>[]\n /** Environment variables used as fallbacks for input fields. */\n env?: { [K in FieldOf<I>]?: string }\n /** Fields read only from their environment variable and always redacted. */\n secrets?: FieldOf<I>[]\n /** Schema of `data` in a successful result: an object or an array. */\n output?: O\n /** Codes from the CLI's error registry the command may return, besides the built-in codes. */\n errors?: string[]\n /** The command changes no state. Implies `idempotent`. */\n readOnly?: boolean\n /** Repeating the command with the same input has no additional effect; set by `readOnly`. */\n idempotent?: boolean\n /** A reason to confirm, or a function of the input that returns one. */\n confirm?: string | ((input: ParsedOf<I>) => string | undefined)\n /** The command supports `--dry-run` through `ctx.dryRun`. */\n dryRun?: boolean\n /** Formats a successful result for human mode. */\n human?: (data: DataOf<O>) => string\n /** Lazily imports the module that default-exports the handler. */\n handler: HandlerLoader\n}\n\n/** A command definition created by {@link defineCommand}. */\nexport interface Command<\n I extends Schema | undefined = Schema | undefined,\n O extends Schema | undefined = Schema | undefined,\n> extends CommandOptions<I, O> {\n readonly kind: 'command'\n}\n\n/** Any command definition, regardless of its schemas. */\n// biome-ignore lint/suspicious/noExplicitAny: variance of handler types\nexport type AnyCommand = Command<any, any>\n\n/** A named group of commands created by {@link defineGroup}. */\nexport interface Group {\n readonly kind: 'group'\n name: string\n description: string\n commands: CommandNode[]\n}\n\n/** An entry of a command tree. */\nexport type CommandNode = AnyCommand | Group\n\n/** Options for a progress update. */\nexport interface ProgressEvent {\n phase: string\n message: string\n data?: Record<string, unknown>\n}\n\n/** A long-running job registered with `ctx.checkpoint`. */\nexport interface Checkpoint {\n id: string\n next?: Next[]\n}\n\n/** How the current invocation presents output. */\nexport interface Mode {\n /** `json` writes one result object to stdout; `human` writes text. */\n format: 'json' | 'human'\n /** Detected or forced agent name, or `false`. */\n agent: string | false\n /** A human can answer prompts. */\n interactive: boolean\n}\n\nconst OK = Symbol.for('clipact.ok')\n\n/** A successful handler result created by `ctx.ok`. */\nexport interface Ok<T> {\n readonly [OK]: true\n readonly data: T\n readonly next: Next[] | undefined\n}\n\n/** Returns `true` for a value created by `ctx.ok`. */\nexport function isOk(value: unknown): value is Ok<unknown> {\n return typeof value === 'object' && value !== null && OK in value\n}\n\n/** Creates an {@link Ok} value. */\nexport function createOk<T>(data: T, next?: Next[]): Ok<T> {\n return { [OK]: true, data, next }\n}\n\n/** The context passed to a handler. */\nexport interface Context<\n I extends Schema | undefined,\n O extends Schema | undefined,\n> {\n /** Validated input with defaults applied. */\n input: ParsedOf<I>\n /** Aborted on the first SIGINT, SIGTERM, or SIGHUP; pass it to all I/O. */\n signal: AbortSignal\n mode: Mode\n /** `--dry-run` was given; perform no side effects. */\n dryRun: boolean\n /** Reports progress on stderr: a status line for humans, periodic lines for agents. */\n progress(event: ProgressEvent): void\n /** Writes a human-readable line to stderr. */\n log(message: string): void\n /** Registers a long-running job; its ID is printed now and `next` is used if interrupted. */\n checkpoint(checkpoint: Checkpoint): void\n /** Creates the successful result; `data` defaults to `{}`. */\n ok(\n ...args: O extends Schema\n ? [data: DataOf<O>, options?: { next?: Next[] }]\n : [data?: Record<string, unknown>, options?: { next?: Next[] }]\n ): Ok<DataOf<O>>\n}\n\nconst HANDLER = Symbol.for('clipact.handler')\n\n/** A handler created by {@link defineHandler}. */\nexport interface Handler {\n readonly [HANDLER]: true\n // biome-ignore lint/suspicious/noExplicitAny: erased to keep definitions and handlers acyclic\n readonly run: (ctx: Context<any, any>) => Promise<Ok<unknown>>\n}\n\n/** Returns `true` for a value created by {@link defineHandler}. */\nexport function isHandler(value: unknown): value is Handler {\n return typeof value === 'object' && value !== null && HANDLER in value\n}\n\n/** Translates a third-party error into a {@link CliError}, or returns `undefined`. */\nexport type MapError = (\n error: unknown\n) => CliError | undefined | Promise<CliError | undefined>\n\n/** Options for {@link defineCli}. */\nexport interface CliOptions {\n /** The binary name, used in help and `next` commands. */\n name: string\n version: string\n description?: string\n /** Prefix of framework variables (`<PREFIX>_OUTPUT`, `<PREFIX>_AGENT`); defaults to the name. */\n envPrefix?: string\n commands: CommandNode[]\n /** Extra paths that resolve to a canonical command path, such as `{ publish: 'artifacts put' }`. */\n aliases?: Record<string, string>\n /**\n * Directory of bundled skills (`<name>/SKILL.md`), such as\n * `new URL('../skills/', import.meta.url)`; adds the `skills` commands.\n *\n * @see https://github.com/hugomrdias/fil/blob/main/docs/agent-cli/guidelines.md#agent-skills\n */\n skills?: URL | string\n /** Lazily imports a module that default-exports a {@link MapError} function. */\n mapError?: () => Promise<{ default: MapError }>\n /**\n * Every error code the commands may return besides the built-in codes,\n * with a description and an optional `details` schema.\n *\n * @see https://github.com/hugomrdias/fil/blob/main/docs/agent-cli/guidelines.md#errors-next-steps-and-retries\n */\n errors?: ErrorRegistry\n}\n\n/**\n * Defines a command. Handlers are loaded lazily, so this module should\n * import only the schema library.\n *\n * @see https://github.com/hugomrdias/fil/blob/main/docs/agent-cli/framework-design.md#defining-commands\n */\nexport function defineCommand<\n I extends Schema | undefined = undefined,\n O extends Schema | undefined = undefined,\n>(options: CommandOptions<I, O>): Command<I, O> {\n if (options.readOnly && options.confirm) {\n throw new TypeError(\n `Command \"${options.name}\" cannot be readOnly and require confirmation`\n )\n }\n for (const secret of options.secrets ?? []) {\n if (!options.env?.[secret]) {\n throw new TypeError(\n `Secret field \"${secret}\" of command \"${options.name}\" needs an env mapping`\n )\n }\n }\n return Object.freeze({\n kind: 'command',\n ...options,\n // readOnly implies idempotent; consumers read only `idempotent`.\n idempotent: options.readOnly === true || options.idempotent === true,\n }) as Command<I, O>\n}\n\n/** Options for {@link markBuiltin}. */\ninterface BuiltinOptions {\n /**\n * A successful result prints the command's `human` text in every mode\n * instead of a JSON result, such as a shell script read by `eval`.\n */\n plainText?: boolean\n /**\n * The input field whose positional words are a command path, such as\n * `schema <group> <command>`; completion offers command names for it.\n */\n commandPath?: string\n}\n\n/** Framework commands routed like any other but kept out of command lists. */\nconst BUILTIN_NODES = new WeakMap<CommandNode, BuiltinOptions>()\n\n/**\n * Marks a framework-owned command as built-in: it is listed under \"Built-in\"\n * in root help instead of with the application's commands.\n */\nexport function markBuiltin<T extends CommandNode>(\n node: T,\n options: BuiltinOptions = {}\n): T {\n BUILTIN_NODES.set(node, options)\n return node\n}\n\n/** Returns `true` for a command marked with {@link markBuiltin}. */\nexport function isBuiltin(node: CommandNode): boolean {\n return BUILTIN_NODES.has(node)\n}\n\n/** Returns `true` for a built-in whose successful result is plain text. */\nexport function printsPlainText(node: CommandNode): boolean {\n return BUILTIN_NODES.get(node)?.plainText === true\n}\n\n/** Returns the input field of a built-in whose positionals are a command path. */\nexport function commandPathField(node: CommandNode): string | undefined {\n return BUILTIN_NODES.get(node)?.commandPath\n}\n\n/** Defines a group of commands, such as `artifacts` in `acme artifacts put`. */\nexport function defineGroup(options: Omit<Group, 'kind'>): Group {\n return Object.freeze({ kind: 'group', ...options })\n}\n\n/**\n * Defines the handler for a command; default-export the result from the\n * module that the command's `handler` loader imports.\n */\nexport function defineHandler<\n I extends Schema | undefined,\n O extends Schema | undefined,\n>(\n _command: Command<I, O>,\n run: (ctx: Context<I, O>) => Promise<Ok<DataOf<O>>> | Ok<DataOf<O>>\n): Handler {\n return {\n [HANDLER]: true,\n run: async (ctx) => await run(ctx),\n }\n}\n", "import type {\n StandardJSONSchemaV1,\n StandardSchemaV1,\n} from '@standard-schema/spec'\n\n/** The subset of JSON Schema that {@link fromJsonSchema} validates. */\nexport interface JsonSchemaNode {\n type: 'object' | 'array' | 'string' | 'boolean'\n description?: string\n enum?: readonly string[]\n default?: unknown\n properties?: Record<string, JsonSchemaNode>\n required?: readonly string[]\n items?: JsonSchemaNode\n additionalProperties?: false\n}\n\n/**\n * Creates a Standard Schema from a small JSON Schema, for framework-owned\n * commands that cannot depend on an application's schema library.\n *\n * @see https://standardschema.dev/json-schema\n */\nexport function fromJsonSchema<Input, Output = Input>(\n schema: JsonSchemaNode\n): StandardSchemaV1<Input, Output> & StandardJSONSchemaV1<Input, Output> {\n const jsonSchema = () => ({\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n ...structuredClone(schema),\n })\n return {\n '~standard': {\n version: 1,\n vendor: 'clipact',\n validate(value) {\n const issues: StandardSchemaV1.Issue[] = []\n const result = check(schema, value, [], issues)\n return issues.length > 0 ? { issues } : { value: result as Output }\n },\n jsonSchema: { input: jsonSchema, output: jsonSchema },\n },\n }\n}\n\n/** Validates one value, applying defaults, and returns the result. */\nfunction check(\n node: JsonSchemaNode,\n value: unknown,\n path: PropertyKey[],\n issues: StandardSchemaV1.Issue[]\n): unknown {\n if (value === undefined && node.default !== undefined) {\n return structuredClone(node.default)\n }\n if (node.type === 'object') {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n issues.push({ message: 'Expected an object', path })\n return value\n }\n const record = value as Record<string, unknown>\n const properties = node.properties ?? {}\n const result: Record<string, unknown> = {}\n for (const key of Object.keys(record)) {\n if (!(key in properties) && node.additionalProperties === false) {\n issues.push({ message: 'Unknown field', path: [...path, key] })\n }\n }\n for (const [key, property] of Object.entries(properties)) {\n if (record[key] === undefined && property.default === undefined) {\n if (node.required?.includes(key)) {\n issues.push({ message: 'Required', path: [...path, key] })\n }\n continue\n }\n result[key] = check(property, record[key], [...path, key], issues)\n }\n return result\n }\n if (node.type === 'array') {\n if (!Array.isArray(value)) {\n issues.push({ message: 'Expected an array', path })\n return value\n }\n const items = node.items\n return items\n ? value.map((item, index) => check(items, item, [...path, index], issues))\n : value\n }\n if (typeof value !== node.type) {\n issues.push({ message: `Expected a ${node.type}`, path })\n } else if (node.enum && !node.enum.includes(value as string)) {\n issues.push({\n message: `Expected one of: ${node.enum.join(', ')}`,\n path,\n })\n }\n return value\n}\n", "import type { Schema } from './define.ts'\nimport { fromJsonSchema } from './json-schema.ts'\n\n/**\n * A follow-up step for the agent or the user.\n *\n * A step with `by: 'user'` is the action-required signal: the agent should\n * stop and relay it to a human.\n *\n * @see https://github.com/hugomrdias/fil/blob/main/docs/agent-cli/guidelines.md#errors-next-steps-and-retries\n */\nexport interface Next {\n by: 'agent' | 'user'\n description: string\n command?: string\n}\n\n/** Machine-readable error body of a failed result. */\nexport interface ErrorBody {\n code: string\n message: string\n retryable: boolean\n retryAfterSeconds?: number\n details?: unknown\n}\n\n/** One problem with a command's input, as reported in `invalid_input` details. */\nexport interface InputIssue {\n path: string\n message: string\n source?: string\n}\n\n/**\n * One entry of the CLI's error registry: what a code means and, when its\n * `details` has a fixed shape, the schema of `details`.\n *\n * @see https://github.com/hugomrdias/fil/blob/main/docs/agent-cli/guidelines.md#errors-next-steps-and-retries\n */\nexport interface ErrorDefinition {\n /** One sentence, published by `schema <command>`. */\n description: string\n /** Schema of `error.details`, checked in strict mode. */\n details?: Schema\n}\n\n/** Error codes mapped to their definitions. */\nexport type ErrorRegistry = Record<string, ErrorDefinition>\n\n/** `details` of `invalid_input`: every problem with the input. */\nconst inputIssues = fromJsonSchema<InputIssue[]>({\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: { type: 'string' },\n message: { type: 'string' },\n source: { type: 'string' },\n },\n required: ['path', 'message'],\n additionalProperties: false,\n },\n})\n\n/** `details` of `confirmation_required`: why the command asks. */\nconst confirmationReason = fromJsonSchema<{ reason: string }>({\n type: 'object',\n properties: { reason: { type: 'string' } },\n required: ['reason'],\n additionalProperties: false,\n})\n\n/** Error codes every command may return, with their definitions. */\nexport const BUILTIN_ERRORS: Readonly<ErrorRegistry> = Object.freeze({\n invalid_input: {\n description:\n 'The arguments, flags, --input JSON, or environment variables are invalid.',\n details: inputIssues,\n },\n confirmation_required: {\n description:\n 'The command needs confirmation; a human approves it and runs it with --yes.',\n details: confirmationReason,\n },\n interrupted: {\n description:\n 'A signal stopped the command; follow the next steps to inspect or resume it.',\n },\n internal_error: {\n description: 'An unexpected failure in the CLI; report it.',\n },\n rate_limited: {\n description: 'A service limited the request rate.',\n },\n service_unavailable: {\n description: 'A service the command depends on is unavailable.',\n },\n timeout: {\n description: 'A request took too long.',\n },\n})\n\n/** Error codes every command may return. */\nexport const BUILTIN_ERROR_CODES: readonly string[] = Object.freeze(\n Object.keys(BUILTIN_ERRORS)\n)\n\n/** Error codes of the framework's `skills` commands, registered when they are installed. */\nexport const SKILLS_ERRORS: Readonly<ErrorRegistry> = Object.freeze({\n skill_conflict: {\n description:\n 'Installed skill directories have local changes, are symbolic links, or were not installed by this CLI.',\n details: fromJsonSchema({\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: { type: 'string' },\n target: { type: 'string', enum: ['agents', 'claude'] },\n path: { type: 'string' },\n reason: { type: 'string', enum: ['edited', 'unmanaged', 'symlink'] },\n files: { type: 'array', items: { type: 'string' } },\n resolvesTo: { type: 'string' },\n },\n required: ['name', 'target', 'path', 'reason'],\n additionalProperties: false,\n },\n }),\n },\n})\n\n/**\n * Returns a CLI's full error registry: the framework's codes and its own.\n * Throws a `TypeError` when the CLI redefines a framework code.\n *\n * @param own - The CLI's `errors` option.\n * @param skills - Whether the framework's `skills` commands are installed.\n */\nexport function errorRegistry(\n own: ErrorRegistry | undefined,\n skills: boolean\n): Readonly<ErrorRegistry> {\n const framework = { ...BUILTIN_ERRORS, ...(skills ? SKILLS_ERRORS : {}) }\n for (const code of Object.keys(own ?? {})) {\n if (code in framework) {\n throw new TypeError(\n `Error code \"${code}\" is built in and cannot be redefined`\n )\n }\n }\n return Object.freeze({ ...framework, ...own })\n}\n\n/** Codes whose `retryable` defaults to `true` for read-only or idempotent commands. */\nexport const TRANSIENT_ERROR_CODES: ReadonlySet<string> = new Set([\n 'rate_limited',\n 'service_unavailable',\n 'timeout',\n])\n\n/** Options for {@link CliError}. */\nexport interface CliErrorOptions {\n code: string\n message: string\n /** Defaults by code and command side effects; see the design doc. */\n retryable?: boolean\n retryAfterSeconds?: number\n details?: unknown\n next?: Next[]\n cause?: unknown\n}\n\n/**\n * An expected failure with a stable code, rendered as an `error` result.\n */\nexport class CliError extends Error {\n readonly code: string\n readonly retryable: boolean | undefined\n readonly retryAfterSeconds: number | undefined\n readonly details: unknown\n readonly next: Next[] | undefined\n\n /** Creates an error from its result fields. */\n constructor(options: CliErrorOptions) {\n super(options.message, { cause: options.cause })\n this.name = 'CliError'\n this.code = options.code\n this.retryable = options.retryable\n this.retryAfterSeconds = options.retryAfterSeconds\n this.details = options.details\n this.next = options.next\n }\n}\n\n/** Returns `true` for a {@link CliError}, including instances from another copy of the module. */\nexport function isCliError(value: unknown): value is CliError {\n return (\n value instanceof CliError ||\n (value instanceof Error &&\n value.name === 'CliError' &&\n typeof (value as { code?: unknown }).code === 'string')\n )\n}\n\n/**\n * Thrown for a mistake in command definitions; rendered as `internal_error`.\n */\nexport class DefinitionError extends Error {\n /** Creates an error naming the faulty command. */\n constructor(command: string, message: string) {\n super(`Invalid definition for \"${command}\": ${message}`)\n this.name = 'DefinitionError'\n }\n}\n", "import { homedir } from 'node:os'\nimport { relative, sep } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport {\n type CliOptions,\n type Command,\n defineCommand,\n defineGroup,\n type Group,\n type Handler,\n} from './define.ts'\nimport { fromJsonSchema, type JsonSchemaNode } from './json-schema.ts'\n\n/** Where skills are installed: the current directory or the home directory. */\nexport type Scope = 'project' | 'global'\n\n/** A skills directory: `.agents/skills` or `.claude/skills`. */\nexport type Target = 'agents' | 'claude'\n\n/** Every skills directory, in installation order. */\nexport const TARGETS: readonly Target[] = ['agents', 'claude']\n\n/** Input of `skills install`. */\nexport interface InstallInput {\n scope: Scope\n target: Target[]\n force: boolean\n}\n\n/** One installed copy reported by `skills install`. */\nexport interface InstalledCopy {\n name: string\n target: Target\n path: string\n action: 'installed' | 'updated' | 'unchanged'\n}\n\n/** Input of `skills uninstall`. */\nexport type UninstallInput = Omit<InstallInput, 'force'>\n\n/** One copy reported by `skills uninstall`. */\nexport interface RemovedCopy {\n name: string\n target: Target\n path: string\n action: 'removed' | 'missing' | 'unmanaged' | 'symlink'\n /** Files left in place because they were edited or added locally. */\n kept?: string[]\n}\n\n/** Input of `skills status`. */\nexport interface StatusInput {\n scope?: Scope\n}\n\n/** The state of one copy reported by `skills status`. */\nexport interface CopyStatus {\n name: string\n scope: Scope\n target: Target\n path: string\n status: 'missing' | 'unmanaged' | 'symlink' | 'current' | 'stale' | 'edited'\n /** CLI version that installed the copy. */\n version?: string\n}\n\nconst SCOPES = ['project', 'global'] as const\n\nconst scopeName: JsonSchemaNode = { type: 'string', enum: SCOPES }\nconst scope: JsonSchemaNode = {\n ...scopeName,\n description:\n 'project installs under the current directory; global under the home directory',\n}\n\nconst target: JsonSchemaNode = {\n type: 'array',\n items: { type: 'string', enum: TARGETS },\n default: TARGETS,\n description:\n 'Skills directories: agents (.agents/skills) and claude (.claude/skills)',\n}\n\nconst string: JsonSchemaNode = { type: 'string' }\nconst targetName: JsonSchemaNode = { type: 'string', enum: TARGETS }\n\n/** A closed object schema whose fields are required unless listed in `optional`. */\nfunction object(\n properties: Record<string, JsonSchemaNode>,\n optional: string[] = []\n): JsonSchemaNode {\n return {\n type: 'object',\n properties,\n required: Object.keys(properties).filter((key) => !optional.includes(key)),\n additionalProperties: false,\n }\n}\n\n/** The output of `install` and `uninstall`: the scope and one entry per copy. */\nfunction copiesOutput(\n actions: string[],\n extra: Record<string, JsonSchemaNode> = {}\n): JsonSchemaNode {\n return object({\n scope: scopeName,\n skills: {\n type: 'array',\n items: object(\n {\n name: string,\n target: targetName,\n path: string,\n action: { type: 'string', enum: actions },\n ...extra,\n },\n Object.keys(extra)\n ),\n },\n })\n}\n\nconst installInput = fromJsonSchema<Partial<InstallInput>, InstallInput>({\n type: 'object',\n properties: {\n scope: { ...scope, default: 'project' },\n target,\n force: {\n type: 'boolean',\n default: false,\n description:\n 'Replace skill directories that were edited or not installed by this CLI',\n },\n },\n additionalProperties: false,\n})\n\nconst installOutput = fromJsonSchema<{\n scope: Scope\n skills: InstalledCopy[]\n}>(copiesOutput(['installed', 'updated', 'unchanged']))\n\nconst uninstallInput = fromJsonSchema<Partial<UninstallInput>, UninstallInput>({\n type: 'object',\n properties: { scope: { ...scope, default: 'project' }, target },\n additionalProperties: false,\n})\n\nconst uninstallOutput = fromJsonSchema<{\n scope: Scope\n skills: RemovedCopy[]\n}>(\n copiesOutput(['removed', 'missing', 'unmanaged', 'symlink'], {\n kept: { type: 'array', items: string },\n })\n)\n\nconst statusInput = fromJsonSchema<StatusInput>({\n type: 'object',\n properties: {\n scope: { ...scope, description: `${scope.description}; both when omitted` },\n },\n additionalProperties: false,\n})\n\nconst statusOutput = fromJsonSchema<{ version: string; skills: CopyStatus[] }>(\n object({\n version: { type: 'string', description: 'Version of the running CLI' },\n skills: {\n type: 'array',\n items: object(\n {\n name: string,\n scope: scopeName,\n target: targetName,\n path: string,\n status: {\n type: 'string',\n enum: [\n 'missing',\n 'unmanaged',\n 'symlink',\n 'current',\n 'stale',\n 'edited',\n ],\n },\n version: string,\n },\n ['version']\n ),\n },\n })\n)\n\n/** The `skills install` command. */\nexport type InstallCommand = Command<typeof installInput, typeof installOutput>\n\n/** The `skills uninstall` command. */\nexport type UninstallCommand = Command<\n typeof uninstallInput,\n typeof uninstallOutput\n>\n\n/** The `skills status` command. */\nexport type StatusCommand = Command<typeof statusInput, typeof statusOutput>\n\n/** Shortens a path for human output: relative to the current directory, or under `~`. */\nfunction display(path: string): string {\n const cwd = process.cwd()\n if (path.startsWith(`${cwd}${sep}`)) {\n return relative(cwd, path)\n }\n const home = homedir()\n return path.startsWith(`${home}${sep}`) ? `~${path.slice(home.length)}` : path\n}\n\n/** Converts the `skills` option, a path or `file:` URL, to a path. */\nexport function skillsPath(source: URL | string): string {\n return typeof source === 'string' && !source.startsWith('file:')\n ? source\n : fileURLToPath(source)\n}\n\n/** Loads a handler from `skills.run.ts` only when its command runs. */\nfunction lazy(create: (run: typeof import('./skills.run.ts')) => Handler) {\n return async () => ({ default: create(await import('./skills.run.ts')) })\n}\n\n/**\n * Builds the `skills` group that installs the skills bundled in `source`, a\n * directory of `<name>/SKILL.md` skill directories.\n *\n * @see https://github.com/hugomrdias/fil/blob/main/docs/agent-cli/guidelines.md#a-setup-command\n */\nexport function skillsGroup(cli: CliOptions, skills: URL | string): Group {\n const source = skillsPath(skills)\n const install: InstallCommand = defineCommand({\n name: 'install',\n description: 'Install the bundled agent skills',\n examples: [\n `${cli.name} skills install`,\n `${cli.name} skills install --scope global --target claude`,\n ],\n input: installInput,\n output: installOutput,\n errors: ['skill_conflict'],\n idempotent: true,\n dryRun: true,\n human: (data) =>\n data.skills\n .map((copy) => `${copy.action}: ${display(copy.path)}`)\n .join('\\n'),\n handler: lazy((run) => run.install(cli, source, install)),\n })\n const uninstall: UninstallCommand = defineCommand({\n name: 'uninstall',\n description: 'Remove installed skill files that were not edited',\n examples: [`${cli.name} skills uninstall`],\n input: uninstallInput,\n output: uninstallOutput,\n idempotent: true,\n dryRun: true,\n human: (data) =>\n data.skills\n .map(\n (copy) =>\n `${copy.action}: ${display(copy.path)}${copy.kept ? ` (kept ${copy.kept.join(', ')})` : ''}`\n )\n .join('\\n'),\n handler: lazy((run) => run.uninstall(cli, source, uninstall)),\n })\n const status: StatusCommand = defineCommand({\n name: 'status',\n description: 'Report installed skills and whether they are stale or edited',\n examples: [`${cli.name} skills status --json`],\n input: statusInput,\n output: statusOutput,\n readOnly: true,\n human: (data) =>\n data.skills\n .map(\n (copy) =>\n `${copy.status.padEnd(9)} ${display(copy.path)}${copy.version ? ` (${copy.version})` : ''}`\n )\n .join('\\n'),\n handler: lazy((run) => run.status(cli, source, status)),\n })\n return defineGroup({\n name: 'skills',\n description: 'Install the agent skills bundled with this CLI',\n commands: [install, status, uninstall],\n })\n}\n"],
|
|
5
|
+
"mappings": ";AAqHA,IAAMA,EAAK,OAAO,IAAI,YAAY,EAU5B,SAAUC,EAAKC,EAAc,CACjC,OAAO,OAAOA,GAAU,UAAYA,IAAU,MAAQF,KAAME,CAC9D,CAGM,SAAUC,EAAYC,EAASC,EAAa,CAChD,MAAO,CAAE,CAACL,CAAE,EAAG,GAAM,KAAAI,EAAM,KAAAC,CAAI,CACjC,CA4BA,IAAMC,EAAU,OAAO,IAAI,iBAAiB,EAUtC,SAAUC,EAAUL,EAAc,CACtC,OAAO,OAAOA,GAAU,UAAYA,IAAU,MAAQI,KAAWJ,CACnE,CA0CM,SAAUM,EAGdC,EAA6B,CAC7B,GAAIA,EAAQ,UAAYA,EAAQ,QAC9B,MAAM,IAAI,UACR,YAAYA,EAAQ,IAAI,+CAA+C,EAG3E,QAAWC,KAAUD,EAAQ,SAAW,CAAA,EACtC,GAAI,CAACA,EAAQ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AI,mBAAmB,EACzC,MAAOjB,EACP,OAAQC,EACR,WAAY,GACZ,OAAQ,GACR,MAAQoB,GACNA,EAAK,OACF,IACEC,GACC,GAAGA,EAAK,MAAM,KAAKlB,EAAQkB,EAAK,IAAI,CAAC,GAAGA,EAAK,KAAO,UAAUA,EAAK,KAAK,KAAK,IAAI,CAAC,IAAM,EAAE,EAAE,EAE/F,KAAK;CAAI,EACd,QAASR,EAAMS,GAAQA,EAAI,UAAUN,EAAKL,EAAQY,CAAS,CAAC,EAC7D,EACKC,EAAwBL,EAAc,CAC1C,KAAM,SACN,YAAa,+DACb,SAAU,CAAC,GAAGH,EAAI,IAAI,uBAAuB,EAC7C,MAAOf,EACP,OAAQC,EACR,SAAU,GACV,MAAQkB,GACNA,EAAK,OACF,IACEC,GACC,GAAGA,EAAK,OAAO,OAAO,CAAC,CAAC,IAAIlB,EAAQkB,EAAK,IAAI,CAAC,GAAGA,EAAK,QAAU,KAAKA,EAAK,OAAO,IAAM,EAAE,EAAE,EAE9F,KAAK;CAAI,EACd,QAASR,EAAMS,GAAQA,EAAI,OAAON,EAAKL,EAAQa,CAAM,CAAC,EACvD,EACD,OAAOC,EAAY,CACjB,KAAM,SACN,YAAa,iDACb,SAAU,CAACP,EAASM,EAAQD,CAAS,EACtC,CACH",
|
|
6
|
+
"names": ["OK", "isOk", "value", "createOk", "data", "next", "HANDLER", "isHandler", "defineCommand", "options", "secret", "BUILTIN_NODES", "markBuiltin", "node", "isBuiltin", "printsPlainText", "commandPathField", "defineGroup", "defineHandler", "_command", "run", "ctx", "fromJsonSchema", "schema", "jsonSchema", "value", "issues", "result", "check", "node", "path", "record", "properties", "key", "property", "items", "item", "index", "inputIssues", "fromJsonSchema", "confirmationReason", "BUILTIN_ERRORS", "BUILTIN_ERROR_CODES", "SKILLS_ERRORS", "errorRegistry", "own", "skills", "framework", "code", "TRANSIENT_ERROR_CODES", "CliError", "options", "isCliError", "value", "DefinitionError", "command", "message", "homedir", "relative", "sep", "fileURLToPath", "TARGETS", "SCOPES", "scopeName", "scope", "target", "string", "targetName", "object", "properties", "optional", "key", "copiesOutput", "actions", "extra", "installInput", "fromJsonSchema", "installOutput", "uninstallInput", "uninstallOutput", "statusInput", "statusOutput", "display", "path", "cwd", "sep", "relative", "home", "homedir", "skillsPath", "source", "fileURLToPath", "lazy", "create", "skillsGroup", "cli", "skills", "install", "defineCommand", "data", "copy", "run", "uninstall", "status", "defineGroup"]
|
|
7
|
+
}
|