@aparte/plugin-approval 0.23.0 → 0.25.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-B7URDqOS.js","sources":["../src/policy.ts","../src/approval.ts"],"sourcesContent":["/**\n * The modes, the classes, and the table that joins them.\n *\n * A MODE is what the person switches (\"plan\", \"auto\"); a CLASS is what a tool does\n * (`read`, `write`, `exec`), declared by the host on ITS tool names — the names are\n * wire format the host owns, and no library can know that `run_command` executes and\n * `search_docs` reads. The table below is the whole policy: nine cells, no\n * configuration, so a consumer can read it in one glance and predict every ruling.\n *\n * Nothing here executes anything, remembers anything, or draws anything: it is a pure\n * function from (mode, class, call) to a ruling core already knows how to honour.\n */\nimport type { AparteApprovalPolicy, AparteApprovalRuling, AparteToolCall } from '@aparte/core';\n\n/**\n * `plan` runs read-only tools and refuses the rest with a sentence the model reads;\n * `ask` asks before every write or execution; `auto-edit` lets writes through and asks\n * before an execution; `auto` never asks.\n */\nexport type ApprovalMode = 'plan' | 'ask' | 'auto-edit' | 'auto';\n\n/** The four modes, in the order a switch presents them. */\nexport const APPROVAL_MODES: readonly ApprovalMode[] = ['plan', 'ask', 'auto-edit', 'auto'];\n\n/** What a tool does — the axis the modes decide on. */\nexport type ToolClass = 'read' | 'write' | 'exec';\n\n/** A tool name, exactly, or a pattern over names. */\nexport type ToolMatcher = string | RegExp;\n\n/**\n * The host's tool names, by what they do. A name in no list is UNCLASSIFIED: its\n * own `needsApproval` decides (and `auto` still lets it through — auto is auto).\n */\nexport interface ApprovalClassification {\n read?: readonly ToolMatcher[];\n write?: readonly ToolMatcher[];\n exec?: readonly ToolMatcher[];\n}\n\n// `search`, not `test`: `test` advances `lastIndex` on a `g` or `y` regex the caller\n// owns, so the same name would classify differently on alternate calls — and the gate\n// predicate and the answering channel evaluate the policy one after the other.\nconst matches = (name: string, m: ToolMatcher): boolean =>\n typeof m === 'string' ? m === name : name.search(m) !== -1;\n\n/** The class of a tool name under a classification, or `undefined` when it is in no list. */\nexport function classifyTool(name: string, classification: ApprovalClassification): ToolClass | undefined {\n if (classification.exec?.some((m) => matches(name, m))) return 'exec';\n if (classification.write?.some((m) => matches(name, m))) return 'write';\n if (classification.read?.some((m) => matches(name, m))) return 'read';\n return undefined;\n}\n\nconst NOUN: Record<ToolClass, string> = { read: 'reads', write: 'changes files or state', exec: 'runs a command' };\n\n/**\n * The ruling for one call, from the table. `undefined` means \"no opinion\" — the tool's\n * own `needsApproval` decides, which is what core does when a policy says nothing.\n */\nexport function rulingFor(mode: ApprovalMode, cls: ToolClass | undefined, call: AparteToolCall): AparteApprovalRuling | undefined {\n if (mode === 'auto') return { verdict: 'allow' };\n if (cls === undefined) return undefined;\n if (cls === 'read') return { verdict: 'allow' };\n if (mode === 'plan') {\n return {\n verdict: 'deny',\n reason: `Plan mode: \\`${call.name}\\` ${NOUN[cls]}, and only read-only tools run in this mode. ` +\n 'Describe what you would do instead; the user can switch the mode to let you do it.',\n };\n }\n if (mode === 'auto-edit') return cls === 'write' ? { verdict: 'allow' } : { verdict: 'ask' };\n return { verdict: 'ask' };\n}\n\n/**\n * A core `AparteApprovalPolicy` that reads the CURRENT mode on every call — so a\n * switch flipped mid-run applies to the next tool call, not the next conversation.\n */\nexport function createApprovalPolicy(getMode: () => ApprovalMode, classification: ApprovalClassification): AparteApprovalPolicy {\n return (call) => rulingFor(getMode(), classifyTool(call.name, classification), call);\n}\n","/**\n * `setupApproval` — one call installs a mode-driven approval policy on a config.\n *\n * The plugin owns the MODE (a value the person switches) and the TABLE (policy.ts);\n * core owns the mechanism — `setApprovalPolicy`, the gate, the panel that asks, the\n * refusal the model reads. Nothing is executed here and nothing is stored: a mode\n * survives exactly as long as the page, and a host that wants it remembered reads\n * `getMode()` / `onModeChange` and writes wherever it keeps its preferences.\n */\nimport { aparteGlobalConfig, type AparteConfig, type AparteApprovalPolicy } from '@aparte/core';\nimport {\n APPROVAL_MODES, createApprovalPolicy, classifyTool,\n type ApprovalMode, type ApprovalClassification, type ToolClass,\n} from './policy.js';\n\nexport interface ApprovalSetupOptions {\n /** Your tool names, by what they do. Unlisted names keep their own `needsApproval`. */\n classify: ApprovalClassification;\n /** The starting mode. Default: `ask`. */\n mode?: ApprovalMode;\n /** Called after every switch, with the new and the previous mode. */\n onModeChange?: (mode: ApprovalMode, previous: ApprovalMode) => void;\n}\n\n/** What `setupApproval` returns: the mode, readable and switchable, and the way out. */\nexport interface ApprovalController {\n /** The four modes, in the order a switch presents them. */\n readonly modes: readonly ApprovalMode[];\n getMode(): ApprovalMode;\n /** Switch the mode; the next tool call is ruled under it. Unknown values are ignored. */\n setMode(mode: ApprovalMode): void;\n /** The class this setup gives a tool name, or `undefined`. */\n classify(name: string): ToolClass | undefined;\n /** Be told of every switch — from `setMode` or from a `<aparte-approval-mode>`. Returns the unsubscribe. */\n subscribe(listener: (mode: ApprovalMode, previous: ApprovalMode) => void): () => void;\n /** Remove the policy from the config and forget this controller. */\n dispose(): void;\n}\n\nconst controllers = new WeakMap<AparteConfig, ApprovalController>();\n// The policy each controller installed, so a controller whose policy is gone — a\n// `config.reset()`, a `setApprovalPolicy(null)` from elsewhere — reads as no setup\n// rather than as a switch wired to nothing.\nconst installed = new WeakMap<AparteConfig, AparteApprovalPolicy>();\n/** Whether the policy on `config` is still the one this module installed there. */\nconst isInstalled = (config: AparteConfig): boolean =>\n config.getApprovalPolicy() === installed.get(config);\n\n/**\n * Install the policy on `config` (the global one by default) and return its controller.\n *\n * Calling it twice on one config replaces the first setup — its policy is removed and\n * its listeners dropped — so a hot-reloading host does not stack policies.\n *\n * @example\n * ```ts\n * import { setupApproval } from '@aparte/plugin-approval';\n *\n * const approval = setupApproval({\n * classify: {\n * read: ['read_file', 'search', /^list_/],\n * write: ['write_file', 'edit_file'],\n * exec: ['run_command'],\n * },\n * mode: 'ask',\n * }); // the config last, like every setup*: it defaults to the global\n * approval.setMode('plan'); // or drop <aparte-approval-mode> in the composer's toolbar\n * ```\n */\nexport function setupApproval(options: ApprovalSetupOptions, config: AparteConfig = aparteGlobalConfig): ApprovalController {\n controllers.get(config)?.dispose();\n\n let mode: ApprovalMode = options.mode ?? 'ask';\n const listeners = new Set<(mode: ApprovalMode, previous: ApprovalMode) => void>();\n if (options.onModeChange) listeners.add(options.onModeChange);\n\n const controller: ApprovalController = {\n modes: APPROVAL_MODES,\n getMode: () => mode,\n setMode(next) {\n if (!APPROVAL_MODES.includes(next) || next === mode) return;\n const previous = mode;\n mode = next;\n for (const l of listeners) l(next, previous);\n },\n classify: (name) => classifyTool(name, options.classify),\n subscribe(listener) {\n listeners.add(listener);\n return () => { listeners.delete(listener); };\n },\n dispose() {\n if (controllers.get(config) === controller) {\n // Only the policy this setup installed: a config whose policy was since\n // replaced by someone else keeps that replacement.\n if (isInstalled(config)) config.setApprovalPolicy(null);\n controllers.delete(config);\n installed.delete(config);\n }\n listeners.clear();\n },\n };\n\n const policy = createApprovalPolicy(() => mode, options.classify);\n // Bookkeeping BEFORE the config is told: `setApprovalPolicy` notifies, and a mounted\n // switch re-resolves its controller on that notify — it must find this one.\n controllers.set(config, controller);\n installed.set(config, policy);\n config.setApprovalPolicy(policy);\n return controller;\n}\n\n/**\n * The controller `setupApproval` installed on a config, or `undefined` — also when\n * its policy has since been removed from the config (a `reset()`, a\n * `setApprovalPolicy(null)`): a switch must not look wired to a policy that is gone.\n * What a `<aparte-approval-mode>` element resolves through the config it sits in.\n */\nexport function getApprovalController(config: AparteConfig = aparteGlobalConfig): ApprovalController | undefined {\n const controller = controllers.get(config);\n if (!controller) return undefined;\n return isInstalled(config) ? controller : undefined;\n}\n"],"names":[],"mappings":";AAsBO,MAAM,iBAA0C,CAAC,QAAQ,OAAO,aAAa,MAAM;AAqB1F,MAAM,UAAU,CAAC,MAAc,MAC3B,OAAO,MAAM,WAAW,MAAM,OAAO,KAAK,OAAO,CAAC,MAAM;AAGrD,SAAS,aAAa,MAAc,gBAA+D;AACt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IACP,SAAS,MAAM;AAAA,IACf,QAAQ,MAAM;AACV,UAAI,CAAC,eAAe,SAAS,IAAI,KAAK,SAAS,KAAM;AACrD,YAAM,WAAW;AACjB,aAAO;AACP,iBAAW,KAAK,UAAW,GAAE,MAAM,QAAQ;AAAA,IAC/C;AAAA,IACA,UAAU,CAAC,SAAS,aAAa,MAAM,QAAQ,QAAQ;AAAA,IACvD,UAAU,UAAU;AAChB,gBAAU,IAAI,QAAQ;AACtB,aAAO,MAAM;AAAE,kBAAU,OAAO,QAAQ;AAAA,MAAG;AAAA,IAC/C;AAAA,IACA,UAAU;AACN,UAAI,YAAY,IAAI,MAAM,MAAM,YAAY;AAGxC,YAAI,YAAY,MAAM,EAAG,QAAO,kBAAkB,IAAI;AACtD,oBAAY,OAAO,MAAM;AACzB,kBAAU,OAAO,MAAM;AAAA,MAC3B;AACA,gBAAU,MAAA;AAAA,IACd;AAAA,EAAA;AAGJ,QAAM,SAAS,qBAAqB,MAAM,MAAM,QAAQ,QAAQ;AAGhE,cAAY,IAAI,QAAQ,UAAU;AAClC,YAAU,IAAI,QAAQ,MAAM;AAC5B,SAAO,kBAAkB,MAAM;AAC/B,SAAO;AACX;AAQO,SAAS,sBAAsB,SAAuB,oBAAoD;AAC7G,QAAM,aAAa,YAAY,IAAI,MAAM;AACzC,MAAI,CAAC,WAAY,QAAO;AACxB,SAAO,YAAY,MAAM,IAAI,aAAa;AAC9C;"}
|
|
1
|
+
{"version":3,"file":"approval-CcnXye95.js","sources":["../src/policy.ts","../src/approval.ts"],"sourcesContent":["/**\n * The modes, the classes, and the table that joins them.\n *\n * A MODE is what the person switches (\"plan\", \"auto\"); a CLASS is what a tool does\n * (`read`, `write`, `exec`), declared by the host on ITS tool names — the names are\n * wire format the host owns, and no library can know that `run_command` executes and\n * `search_docs` reads. The table below is the whole policy: nine cells, no\n * configuration, so a consumer can read it in one glance and predict every ruling.\n *\n * Nothing here executes anything, remembers anything, or draws anything: it is a pure\n * function from (mode, class, call) to a ruling core already knows how to honour.\n */\nimport type { AparteApprovalPolicy, AparteApprovalRuling, AparteToolCall } from '@aparte/core';\n\n/**\n * `plan` runs read-only tools and refuses the rest with a sentence the model reads;\n * `ask` asks before every write or execution; `auto-edit` lets writes through and asks\n * before an execution; `auto` never asks.\n */\nexport type ApprovalMode = 'plan' | 'ask' | 'auto-edit' | 'auto';\n\n/** The four modes, in the order a switch presents them. */\nexport const APPROVAL_MODES: readonly ApprovalMode[] = ['plan', 'ask', 'auto-edit', 'auto'];\n\n/** What a tool does — the axis the modes decide on. */\nexport type ToolClass = 'read' | 'write' | 'exec';\n\n/** A tool name, exactly, or a pattern over names. */\nexport type ToolMatcher = string | RegExp;\n\n/**\n * The host's tool names, by what they do. A name in no list is UNCLASSIFIED: its\n * own `needsApproval` decides (and `auto` still lets it through — auto is auto).\n */\nexport interface ApprovalClassification {\n read?: readonly ToolMatcher[];\n write?: readonly ToolMatcher[];\n exec?: readonly ToolMatcher[];\n}\n\n// `search`, not `test`: `test` advances `lastIndex` on a `g` or `y` regex the caller\n// owns, so the same name would classify differently on alternate calls — and the gate\n// predicate and the answering channel evaluate the policy one after the other.\nconst matches = (name: string, m: ToolMatcher): boolean =>\n typeof m === 'string' ? m === name : name.search(m) !== -1;\n\n/** The class of a tool name under a classification, or `undefined` when it is in no list. */\nexport function classifyTool(name: string, classification: ApprovalClassification): ToolClass | undefined {\n if (classification.exec?.some((m) => matches(name, m))) return 'exec';\n if (classification.write?.some((m) => matches(name, m))) return 'write';\n if (classification.read?.some((m) => matches(name, m))) return 'read';\n return undefined;\n}\n\nconst NOUN: Record<ToolClass, string> = { read: 'reads', write: 'changes files or state', exec: 'runs a command' };\n\n/**\n * The ruling for one call, from the table. `undefined` means \"no opinion\" — the tool's\n * own `needsApproval` decides, which is what core does when a policy says nothing.\n */\nexport function rulingFor(mode: ApprovalMode, cls: ToolClass | undefined, call: AparteToolCall): AparteApprovalRuling | undefined {\n if (mode === 'auto') return { verdict: 'allow' };\n if (cls === undefined) return undefined;\n if (cls === 'read') return { verdict: 'allow' };\n if (mode === 'plan') {\n return {\n verdict: 'deny',\n reason: `Plan mode: \\`${call.name}\\` ${NOUN[cls]}, and only read-only tools run in this mode. ` +\n 'Describe what you would do instead; the user can switch the mode to let you do it.',\n };\n }\n if (mode === 'auto-edit') return cls === 'write' ? { verdict: 'allow' } : { verdict: 'ask' };\n return { verdict: 'ask' };\n}\n\n/**\n * A core `AparteApprovalPolicy` that reads the CURRENT mode on every call — so a\n * switch flipped mid-run applies to the next tool call, not the next conversation.\n */\nexport function createApprovalPolicy(getMode: () => ApprovalMode, classification: ApprovalClassification): AparteApprovalPolicy {\n return (call) => rulingFor(getMode(), classifyTool(call.name, classification), call);\n}\n","/**\n * `setupApproval` — one call installs a mode-driven approval policy on a config.\n *\n * The plugin owns the MODE (a value the person switches) and the TABLE (policy.ts);\n * core owns the mechanism — `setApprovalPolicy`, the gate, the panel that asks, the\n * refusal the model reads. Nothing is executed here and nothing is stored: a mode\n * survives exactly as long as the page, and a host that wants it remembered reads\n * `getMode()` / `onModeChange` and writes wherever it keeps its preferences.\n */\nimport { aparteGlobalConfig, type AparteConfig, type AparteApprovalPolicy } from '@aparte/core';\nimport {\n APPROVAL_MODES, createApprovalPolicy, classifyTool,\n type ApprovalMode, type ApprovalClassification, type ToolClass,\n} from './policy.js';\n\nexport interface ApprovalSetupOptions {\n /** Your tool names, by what they do. Unlisted names keep their own `needsApproval`. */\n classify: ApprovalClassification;\n /** The starting mode. Default: `ask`. */\n mode?: ApprovalMode;\n /** Called after every switch, with the new and the previous mode. */\n onModeChange?: (mode: ApprovalMode, previous: ApprovalMode) => void;\n}\n\n/** What `setupApproval` returns: the mode, readable and switchable, and the way out. */\nexport interface ApprovalController {\n /** The four modes, in the order a switch presents them. */\n readonly modes: readonly ApprovalMode[];\n getMode(): ApprovalMode;\n /** Switch the mode; the next tool call is ruled under it. Unknown values are ignored. */\n setMode(mode: ApprovalMode): void;\n /** The class this setup gives a tool name, or `undefined`. */\n classify(name: string): ToolClass | undefined;\n /** Be told of every switch — from `setMode` or from a `<aparte-approval-mode>`. Returns the unsubscribe. */\n subscribe(listener: (mode: ApprovalMode, previous: ApprovalMode) => void): () => void;\n /** Remove the policy from the config and forget this controller. */\n dispose(): void;\n}\n\nconst controllers = new WeakMap<AparteConfig, ApprovalController>();\n// The policy each controller installed, so a controller whose policy is gone — a\n// `config.reset()`, a `setApprovalPolicy(null)` from elsewhere — reads as no setup\n// rather than as a switch wired to nothing.\nconst installed = new WeakMap<AparteConfig, AparteApprovalPolicy>();\n/** Whether the policy on `config` is still the one this module installed there. */\nconst isInstalled = (config: AparteConfig): boolean =>\n config.getApprovalPolicy() === installed.get(config);\n\n/**\n * Install the policy on `config` (the global one by default) and return its controller.\n *\n * Calling it twice on one config replaces the first setup — its policy is removed and\n * its listeners dropped — so a hot-reloading host does not stack policies.\n *\n * @example\n * ```ts\n * import { setupApproval } from '@aparte/plugin-approval';\n *\n * const approval = setupApproval({\n * classify: {\n * read: ['read_file', 'search', /^list_/],\n * write: ['write_file', 'edit_file'],\n * exec: ['run_command'],\n * },\n * mode: 'ask',\n * }); // the config last, like every setup*: it defaults to the global\n * approval.setMode('plan'); // or drop <aparte-approval-mode> in the composer's toolbar\n * ```\n */\nexport function setupApproval(options: ApprovalSetupOptions, config: AparteConfig = aparteGlobalConfig): ApprovalController {\n controllers.get(config)?.dispose();\n\n let mode: ApprovalMode = options.mode ?? 'ask';\n const listeners = new Set<(mode: ApprovalMode, previous: ApprovalMode) => void>();\n if (options.onModeChange) listeners.add(options.onModeChange);\n\n const controller: ApprovalController = {\n modes: APPROVAL_MODES,\n getMode: () => mode,\n setMode(next) {\n if (!APPROVAL_MODES.includes(next) || next === mode) return;\n const previous = mode;\n mode = next;\n for (const l of listeners) l(next, previous);\n },\n classify: (name) => classifyTool(name, options.classify),\n subscribe(listener) {\n listeners.add(listener);\n return () => { listeners.delete(listener); };\n },\n dispose() {\n if (controllers.get(config) === controller) {\n // Only the policy this setup installed: a config whose policy was since\n // replaced by someone else keeps that replacement.\n if (isInstalled(config)) config.setApprovalPolicy(null);\n controllers.delete(config);\n installed.delete(config);\n }\n listeners.clear();\n },\n };\n\n const policy = createApprovalPolicy(() => mode, options.classify);\n // Bookkeeping BEFORE the config is told: `setApprovalPolicy` notifies, and a mounted\n // switch re-resolves its controller on that notify — it must find this one.\n controllers.set(config, controller);\n installed.set(config, policy);\n config.setApprovalPolicy(policy);\n return controller;\n}\n\n/**\n * The controller `setupApproval` installed on a config, or `undefined` — also when\n * its policy has since been removed from the config (a `reset()`, a\n * `setApprovalPolicy(null)`): a switch must not look wired to a policy that is gone.\n * What a `<aparte-approval-mode>` element resolves through the config it sits in.\n */\nexport function getApprovalController(config: AparteConfig = aparteGlobalConfig): ApprovalController | undefined {\n const controller = controllers.get(config);\n if (!controller) return undefined;\n return isInstalled(config) ? controller : undefined;\n}\n"],"names":[],"mappings":";AAsBO,MAAM,iBAA0C,CAAC,QAAQ,OAAO,aAAa,MAAM;AAqB1F,MAAM,UAAU,CAAC,MAAc,MAC3B,OAAO,MAAM,WAAW,MAAM,OAAO,KAAK,OAAO,CAAC,MAAM;AAGrD,SAAS,aAAa,MAAc,gBAA+D;AACtG,MAAI,eAAe,MAAM,KAAK,CAAC,MAAM,QAAQ,MAAM,CAAC,CAAC,EAAG,QAAO;AAC/D,MAAI,eAAe,OAAO,KAAK,CAAC,MAAM,QAAQ,MAAM,CAAC,CAAC,EAAG,QAAO;AAChE,MAAI,eAAe,MAAM,KAAK,CAAC,MAAM,QAAQ,MAAM,CAAC,CAAC,EAAG,QAAO;AAC/D,SAAO;AACX;AAEA,MAAM,OAAkC,EAAE,MAAM,SAAS,OAAO,0BAA0B,MAAM,iBAAA;AAMzF,SAAS,UAAU,MAAoB,KAA4B,MAAwD;AAC9H,MAAI,SAAS,OAAQ,QAAO,EAAE,SAAS,QAAA;AACvC,MAAI,QAAQ,OAAW,QAAO;AAC9B,MAAI,QAAQ,OAAQ,QAAO,EAAE,S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O,MAAM;AACzB,kBAAU,OAAO,MAAM;AAAA,MAC3B;AACA,gBAAU,MAAA;AAAA,IACd;AAAA,EAAA;AAGJ,QAAM,SAAS,qBAAqB,MAAM,MAAM,QAAQ,QAAQ;AAGhE,cAAY,IAAI,QAAQ,UAAU;AAClC,YAAU,IAAI,QAAQ,MAAM;AAC5B,SAAO,kBAAkB,MAAM;AAC/B,SAAO;AACX;AAQO,SAAS,sBAAsB,SAAuB,oBAAoD;AAC7G,QAAM,aAAa,YAAY,IAAI,MAAM;AACzC,MAAI,CAAC,WAAY,QAAO;AACxB,SAAO,YAAY,MAAM,IAAI,aAAa;AAC9C;"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as APPROVAL_MODES, g as getApprovalController } from "./approval-
|
|
2
|
-
import { c, a, r, s } from "./approval-
|
|
3
|
-
import { resolveConfig, subscribeConfigChange, escapeAttr, escapeHtml } from "@aparte/core";
|
|
1
|
+
import { A as APPROVAL_MODES, g as getApprovalController } from "./approval-CcnXye95.js";
|
|
2
|
+
import { c, a, r, s } from "./approval-CcnXye95.js";
|
|
3
|
+
import { deferHydrationOf, resolveConfig, subscribeConfigChange, escapeAttr, escapeHtml } from "@aparte/core";
|
|
4
4
|
const DEFAULT_LABELS = {
|
|
5
5
|
plan: "Plan",
|
|
6
6
|
ask: "Ask",
|
|
@@ -88,6 +88,7 @@ class AparteApprovalMode extends HTMLElement {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
if (typeof customElements !== "undefined" && !customElements.get("aparte-approval-mode")) {
|
|
91
|
+
deferHydrationOf(AparteApprovalMode);
|
|
91
92
|
customElements.define("aparte-approval-mode", AparteApprovalMode);
|
|
92
93
|
}
|
|
93
94
|
export {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/aparte-approval-mode.ts"],"sourcesContent":["/**\n * `<aparte-approval-mode>` — the switch between the four modes, for the composer's toolbar.\n *\n * Mounted where the host wants it, like `<aparte-model-selector>`: the composer is light\n * DOM with no registry, so a control is placed by writing its tag inside\n * `<aparte-composer-toolbar>`. It resolves the config it sits in (`resolveConfig`) and the\n * controller `setupApproval` installed there — with none, it renders disabled and says\n * so once in the console, the way core does for a missing presenter: an affordance that\n * cannot act is not offered.\n */\nimport {\n resolveConfig, subscribeConfigChange, escapeHtml, escapeAttr,\n type AparteConfig, type AparteConfigAware, type AparteSelectChangeDetail,\n type AparteApprovalModeChangeEventDetail,\n} from '@aparte/core';\nimport { getApprovalController, type ApprovalController } from './approval.js';\nimport { APPROVAL_MODES, type ApprovalMode } from './policy.js';\n\nconst DEFAULT_LABELS: Record<ApprovalMode, string> = {\n plan: 'Plan',\n ask: 'Ask',\n 'auto-edit': 'Auto-edit',\n auto: 'Auto',\n};\n\n/**\n * A select over the four approval modes — plan, ask, auto-edit, auto — bound to the\n * `setupApproval()` of the config this element resolves.\n *\n * @element aparte-approval-mode\n *\n * @example Beside the model selector, in the composer's toolbar\n * ```html\n * <aparte-composer>\n * <aparte-composer-input></aparte-composer-input>\n * <aparte-composer-toolbar>\n * <aparte-approval-mode></aparte-approval-mode>\n * </aparte-composer-toolbar>\n * </aparte-composer>\n * ```\n *\n * @fires {CustomEvent<AparteApprovalModeChangeEventDetail>} aparte-approval-mode-change - After a switch: `{ mode, previousMode }`. Bubbles and crosses shadow roots.\n */\nexport class AparteApprovalMode extends HTMLElement implements AparteConfigAware {\n private _cfg: AparteConfig | null = null;\n private _controller: ApprovalController | undefined;\n private _unsubscribe: (() => void) | null = null;\n private _configUnsubscribe: (() => void) | null = null;\n private _bound = false;\n private _labels: Partial<Record<ApprovalMode, string>> = {};\n private readonly _onChange = (e: Event): void => {\n const detail = (e as CustomEvent<AparteSelectChangeDetail>).detail;\n const next = detail?.value as ApprovalMode;\n if (!this._controller || !APPROVAL_MODES.includes(next)) return;\n const previous = this._controller.getMode();\n this._controller.setMode(next);\n if (this._controller.getMode() !== previous) {\n this.dispatchEvent(new CustomEvent<AparteApprovalModeChangeEventDetail>('aparte-approval-mode-change', {\n bubbles: true, composed: true, detail: { mode: next, previousMode: previous },\n }));\n }\n };\n\n /** The label of each mode, for a localised host. Missing entries keep the English default. */\n get labels(): Partial<Record<ApprovalMode, string>> { return this._labels; }\n set labels(next: Partial<Record<ApprovalMode, string>>) {\n this._labels = next ?? {};\n if (this.isConnected) this._render();\n }\n\n /** The current mode, or `null` with no setup. */\n get mode(): ApprovalMode | null { return this._controller?.getMode() ?? null; }\n\n connectedCallback(): void {\n this._bind(resolveConfig(this));\n // A setup that arrives AFTER this element mounted (a later script, a dynamic\n // import), or one that goes away (`dispose()`, `config.reset()`): the config\n // notifies on `setApprovalPolicy`, and the switch re-resolves its controller\n // rather than staying disabled — or wired to nothing — for the life of the page.\n this._configUnsubscribe = subscribeConfigChange(this, () => this._bind(resolveConfig(this)));\n }\n\n disconnectedCallback(): void {\n this._unsubscribe?.();\n this._unsubscribe = null;\n this._configUnsubscribe?.();\n this._configUnsubscribe = null;\n this._bound = false;\n this.querySelector('aparte-select')?.removeEventListener('aparte-select-change', this._onChange);\n }\n\n /** See `AparteConfigAware`: a boundary moved, so the controller may be another one. */\n aparteConfigChanged(next: AparteConfig): void {\n this._bind(next);\n }\n\n private _bind(cfg: AparteConfig): void {\n const next = getApprovalController(cfg);\n // An unrelated notify (a locale, a provider) must not rebuild the select under an\n // open dropdown: same config, same controller, nothing to rebind.\n if (this._bound && cfg === this._cfg && next === this._controller) return;\n this._bound = true;\n this._cfg = cfg;\n this._unsubscribe?.();\n this._controller = next;\n if (!this._controller) {\n // Asked once the module that imported the plugin has run its body. Importing the\n // plugin defines this element, so a tag already in the page binds BEFORE the\n // `setupApproval()` that comes next in the documented order — and the warning\n // fired for a setup that was a line away.\n queueMicrotask(() => {\n if (this._controller || !this.isConnected) return;\n console.warn('[aparte] <aparte-approval-mode> found no approval setup on the config it resolves — call setupApproval() from @aparte/plugin-approval on that config (the scoped one if you passed a `config`, aparteGlobalConfig otherwise).');\n });\n }\n this._unsubscribe = this._controller?.subscribe(() => this._syncValue()) ?? null;\n this._render();\n }\n\n private _render(): void {\n const controller = this._controller;\n const current = controller?.getMode();\n const options = APPROVAL_MODES.map((m) =>\n `<aparte-option value=\"${escapeAttr(m)}\">${escapeHtml(this._labels[m] ?? DEFAULT_LABELS[m])}</aparte-option>`).join('');\n this.querySelector('aparte-select')?.removeEventListener('aparte-select-change', this._onChange);\n // The select carries no class of ours: `aparte-approval-mode aparte-select` is\n // already the address a consumer restyling it writes.\n // The accessible name follows the locale like the option labels do — a\n // literal here was the one string a localised host could not translate.\n const aria = String(this._cfg?.getLocale()['approvalModeLabel'] || 'Approval mode');\n this.innerHTML = `<aparte-select${current ? ` value=\"${escapeAttr(current)}\"` : ''}${controller ? '' : ' disabled'} aria-label=\"${escapeAttr(aria)}\">${options}</aparte-select>`;\n this.querySelector('aparte-select')?.addEventListener('aparte-select-change', this._onChange);\n }\n\n private _syncValue(): void {\n const select = this.querySelector('aparte-select') as (HTMLElement & { value: string }) | null;\n const mode = this._controller?.getMode();\n if (select && mode && select.value !== mode) select.value = mode;\n }\n}\n\nif (typeof customElements !== 'undefined' && !customElements.get('aparte-approval-mode')) {\n customElements.define('aparte-approval-mode', AparteApprovalMode);\n}\n"],"names":[],"mappings":";;;AAkBA,MAAM,iBAA+C;AAAA,EACjD,MAAM;AAAA,EACN,KAAK;AAAA,EACL,aAAa;AAAA,EACb,MAAM;AACV;AAoBO,MAAM,2BAA2B,YAAyC;AAAA,EACrE,OAA4B;AAAA,EAC5B;AAAA,EACA,eAAoC;AAAA,EACpC,qBAA0C;AAAA,EAC1C,SAAS;AAAA,EACT,UAAiD,CAAA;AAAA,EACxC,YAAY,CAAC,MAAmB;AAC7C,UAAM,SAAU,EAA4C;AAC5D,UAAM,OAAO,QAAQ;AACrB,QAAI,CAAC,KAAK,eAAe,CAAC,eAAe,SAAS,IAAI,EAAG;AACzD,UAAM,WAAW,KAAK,YAAY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,MAChP,CAAC;AAAA,IACL;AACA,SAAK,eAAe,KAAK,aAAa,UAAU,MAAM,KAAK,WAAA,CAAY,KAAK;AAC5E,SAAK,QAAA;AAAA,EACT;AAAA,EAEQ,UAAgB;AACpB,UAAM,aAAa,KAAK;AACxB,UAAM,UAAU,YAAY,QAAA;AAC5B,UAAM,UAAU,eAAe,IAAI,CAAC,MAChC,yBAAyB,WAAW,CAAC,CAAC,KAAK,WAAW,KAAK,QAAQ,CAAC,KAAK,eAAe,CAAC,CAAC,CAAC,kBAAkB,EAAE,KAAK,EAAE;AAC1H,SAAK,cAAc,eAAe,GAAG,oBAAoB,wBAAwB,KAAK,SAAS;AAK/F,UAAM,OAAO,OAAO,KAAK,MAAM,YAAY,mBAAmB,KAAK,eAAe;AAClF,SAAK,YAAY,iBAAiB,UAAU,WAAW,WAAW,OAAO,CAAC,MAAM,EAAE,GAAG,aAAa,KAAK,WAAW,gBAAgB,WAAW,IAAI,CAAC,KAAK,OAAO;AAC9J,SAAK,cAAc,eAAe,GAAG,iBAAiB,wBAAwB,KAAK,SAAS;AAAA,EAChG;AAAA,EAEQ,aAAmB;AACvB,UAAM,SAAS,KAAK,cAAc,eAAe;AACjD,UAAM,OAAO,KAAK,aAAa,QAAA;AAC/B,QAAI,UAAU,QAAQ,OAAO,UAAU,aAAa,QAAQ;AAAA,EAChE;AACJ;AAEA,IAAI,OAAO,mBAAmB,eAAe,CAAC,eAAe,IAAI,sBAAsB,GAAG;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/aparte-approval-mode.ts"],"sourcesContent":["/**\n * `<aparte-approval-mode>` — the switch between the four modes, for the composer's toolbar.\n *\n * Mounted where the host wants it, like `<aparte-model-selector>`: the composer is light\n * DOM with no registry, so a control is placed by writing its tag inside\n * `<aparte-composer-toolbar>`. It resolves the config it sits in (`resolveConfig`) and the\n * controller `setupApproval` installed there — with none, it renders disabled and says\n * so once in the console, the way core does for a missing presenter: an affordance that\n * cannot act is not offered.\n */\nimport {\n resolveConfig, subscribeConfigChange, escapeHtml, escapeAttr, deferHydrationOf,\n type AparteConfig, type AparteConfigAware, type AparteSelectChangeDetail,\n type AparteApprovalModeChangeEventDetail,\n} from '@aparte/core';\nimport { getApprovalController, type ApprovalController } from './approval.js';\nimport { APPROVAL_MODES, type ApprovalMode } from './policy.js';\n\nconst DEFAULT_LABELS: Record<ApprovalMode, string> = {\n plan: 'Plan',\n ask: 'Ask',\n 'auto-edit': 'Auto-edit',\n auto: 'Auto',\n};\n\n/**\n * A select over the four approval modes — plan, ask, auto-edit, auto — bound to the\n * `setupApproval()` of the config this element resolves.\n *\n * @element aparte-approval-mode\n *\n * @example Beside the model selector, in the composer's toolbar\n * ```html\n * <aparte-composer>\n * <aparte-composer-input></aparte-composer-input>\n * <aparte-composer-toolbar>\n * <aparte-approval-mode></aparte-approval-mode>\n * </aparte-composer-toolbar>\n * </aparte-composer>\n * ```\n *\n * @fires {CustomEvent<AparteApprovalModeChangeEventDetail>} aparte-approval-mode-change - After a switch: `{ mode, previousMode }`. Bubbles and crosses shadow roots.\n */\nexport class AparteApprovalMode extends HTMLElement implements AparteConfigAware {\n private _cfg: AparteConfig | null = null;\n private _controller: ApprovalController | undefined;\n private _unsubscribe: (() => void) | null = null;\n private _configUnsubscribe: (() => void) | null = null;\n private _bound = false;\n private _labels: Partial<Record<ApprovalMode, string>> = {};\n private readonly _onChange = (e: Event): void => {\n const detail = (e as CustomEvent<AparteSelectChangeDetail>).detail;\n const next = detail?.value as ApprovalMode;\n if (!this._controller || !APPROVAL_MODES.includes(next)) return;\n const previous = this._controller.getMode();\n this._controller.setMode(next);\n if (this._controller.getMode() !== previous) {\n this.dispatchEvent(new CustomEvent<AparteApprovalModeChangeEventDetail>('aparte-approval-mode-change', {\n bubbles: true, composed: true, detail: { mode: next, previousMode: previous },\n }));\n }\n };\n\n /** The label of each mode, for a localised host. Missing entries keep the English default. */\n get labels(): Partial<Record<ApprovalMode, string>> { return this._labels; }\n set labels(next: Partial<Record<ApprovalMode, string>>) {\n this._labels = next ?? {};\n if (this.isConnected) this._render();\n }\n\n /** The current mode, or `null` with no setup. */\n get mode(): ApprovalMode | null { return this._controller?.getMode() ?? null; }\n\n connectedCallback(): void {\n this._bind(resolveConfig(this));\n // A setup that arrives AFTER this element mounted (a later script, a dynamic\n // import), or one that goes away (`dispose()`, `config.reset()`): the config\n // notifies on `setApprovalPolicy`, and the switch re-resolves its controller\n // rather than staying disabled — or wired to nothing — for the life of the page.\n this._configUnsubscribe = subscribeConfigChange(this, () => this._bind(resolveConfig(this)));\n }\n\n disconnectedCallback(): void {\n this._unsubscribe?.();\n this._unsubscribe = null;\n this._configUnsubscribe?.();\n this._configUnsubscribe = null;\n this._bound = false;\n this.querySelector('aparte-select')?.removeEventListener('aparte-select-change', this._onChange);\n }\n\n /** See `AparteConfigAware`: a boundary moved, so the controller may be another one. */\n aparteConfigChanged(next: AparteConfig): void {\n this._bind(next);\n }\n\n private _bind(cfg: AparteConfig): void {\n const next = getApprovalController(cfg);\n // An unrelated notify (a locale, a provider) must not rebuild the select under an\n // open dropdown: same config, same controller, nothing to rebind.\n if (this._bound && cfg === this._cfg && next === this._controller) return;\n this._bound = true;\n this._cfg = cfg;\n this._unsubscribe?.();\n this._controller = next;\n if (!this._controller) {\n // Asked once the module that imported the plugin has run its body. Importing the\n // plugin defines this element, so a tag already in the page binds BEFORE the\n // `setupApproval()` that comes next in the documented order — and the warning\n // fired for a setup that was a line away.\n queueMicrotask(() => {\n if (this._controller || !this.isConnected) return;\n console.warn('[aparte] <aparte-approval-mode> found no approval setup on the config it resolves — call setupApproval() from @aparte/plugin-approval on that config (the scoped one if you passed a `config`, aparteGlobalConfig otherwise).');\n });\n }\n this._unsubscribe = this._controller?.subscribe(() => this._syncValue()) ?? null;\n this._render();\n }\n\n private _render(): void {\n const controller = this._controller;\n const current = controller?.getMode();\n const options = APPROVAL_MODES.map((m) =>\n `<aparte-option value=\"${escapeAttr(m)}\">${escapeHtml(this._labels[m] ?? DEFAULT_LABELS[m])}</aparte-option>`).join('');\n this.querySelector('aparte-select')?.removeEventListener('aparte-select-change', this._onChange);\n // The select carries no class of ours: `aparte-approval-mode aparte-select` is\n // already the address a consumer restyling it writes.\n // The accessible name follows the locale like the option labels do — a\n // literal here was the one string a localised host could not translate.\n const aria = String(this._cfg?.getLocale()['approvalModeLabel'] || 'Approval mode');\n this.innerHTML = `<aparte-select${current ? ` value=\"${escapeAttr(current)}\"` : ''}${controller ? '' : ' disabled'} aria-label=\"${escapeAttr(aria)}\">${options}</aparte-select>`;\n this.querySelector('aparte-select')?.addEventListener('aparte-select-change', this._onChange);\n }\n\n private _syncValue(): void {\n const select = this.querySelector('aparte-select') as (HTMLElement & { value: string }) | null;\n const mode = this._controller?.getMode();\n if (select && mode && select.value !== mode) select.value = mode;\n }\n}\n\nif (typeof customElements !== 'undefined' && !customElements.get('aparte-approval-mode')) {\n // Before defining, like core's own elements: in a server-rendered chat the tag waits\n // for the wrapper's release instead of drawing into the DOM the framework hydrates.\n deferHydrationOf(AparteApprovalMode);\n customElements.define('aparte-approval-mode', AparteApprovalMode);\n}\n"],"names":[],"mappings":";;;AAkBA,MAAM,iBAA+C;AAAA,EACjD,MAAM;AAAA,EACN,KAAK;AAAA,EACL,aAAa;AAAA,EACb,MAAM;AACV;AAoBO,MAAM,2BAA2B,YAAyC;AAAA,EACrE,OAA4B;AAAA,EAC5B;AAAA,EACA,eAAoC;AAAA,EACpC,qBAA0C;AAAA,EAC1C,SAAS;AAAA,EACT,UAAiD,CAAA;AAAA,EACxC,YAAY,CAAC,MAAmB;AAC7C,UAAM,SAAU,EAA4C;AAC5D,UAAM,OAAO,QAAQ;AACrB,QAAI,CAAC,KAAK,eAAe,CAAC,eAAe,SAAS,IAAI,EAAG;AACzD,UAAM,WAAW,KAAK,YAAY,QAAA;AAClC,SAAK,YAAY,QAAQ,IAAI;AAC7B,QAAI,KAAK,YAAY,QAAA,MAAc,UAAU;AACzC,WAAK,cAAc,IAAI,YAAiD,+BAA+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AAAA,EAEQ,UAAgB;AACpB,UAAM,aAAa,KAAK;AACxB,UAAM,UAAU,YAAY,QAAA;AAC5B,UAAM,UAAU,eAAe,IAAI,CAAC,MAChC,yBAAyB,WAAW,CAAC,CAAC,KAAK,WAAW,KAAK,QAAQ,CAAC,KAAK,eAAe,CAAC,CAAC,CAAC,kBAAkB,EAAE,KAAK,EAAE;AAC1H,SAAK,cAAc,eAAe,GAAG,oBAAoB,wBAAwB,KAAK,SAAS;AAK/F,UAAM,OAAO,OAAO,KAAK,MAAM,YAAY,mBAAmB,KAAK,eAAe;AAClF,SAAK,YAAY,iBAAiB,UAAU,WAAW,WAAW,OAAO,CAAC,MAAM,EAAE,GAAG,aAAa,KAAK,WAAW,gBAAgB,WAAW,IAAI,CAAC,KAAK,OAAO;AAC9J,SAAK,cAAc,eAAe,GAAG,iBAAiB,wBAAwB,KAAK,SAAS;AAAA,EAChG;AAAA,EAEQ,aAAmB;AACvB,UAAM,SAAS,KAAK,cAAc,eAAe;AACjD,UAAM,OAAO,KAAK,aAAa,QAAA;AAC/B,QAAI,UAAU,QAAQ,OAAO,UAAU,aAAa,QAAQ;AAAA,EAChE;AACJ;AAEA,IAAI,OAAO,mBAAmB,eAAe,CAAC,eAAe,IAAI,sBAAsB,GAAG;AAGtF,mBAAiB,kBAAkB;AACnC,iBAAe,OAAO,wBAAwB,kBAAkB;AACpE;"}
|
package/dist/index.node.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aparte/plugin-approval",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"homepage": "https://apartejs.dev/plugins/approval/",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"node": ">=18"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@aparte/core": ">=0.
|
|
56
|
+
"@aparte/core": ">=0.25.0 <1.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
60
60
|
"typescript": "^5.4.0",
|
|
61
61
|
"vite": "^6.0.0",
|
|
62
|
-
"@aparte/core": "0.
|
|
62
|
+
"@aparte/core": "0.25.0"
|
|
63
63
|
},
|
|
64
64
|
"keywords": [
|
|
65
65
|
"aparte",
|