@dsh-cc/command-permissions 0.5.0 → 0.6.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/lib/client/index.d.ts +1 -1
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/index.js.map +1 -1
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -4
- package/lib/index.js.map +1 -1
- package/lib/plan-phase.js +1 -1
- package/lib/plan-phase.js.map +1 -1
- package/package.json +15 -10
package/lib/client/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @module @dsh-cc/command-permissions/client
|
|
14
14
|
*/
|
|
15
|
-
import type { ClientContext } from '@deepseek-ai/
|
|
15
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
16
16
|
export declare const inject: string[];
|
|
17
17
|
/**
|
|
18
18
|
* Register the `/permissions` bare-invocation popup over the host command.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAMnE,eAAO,MAAM,MAAM,UAA4B,CAAA;AAuB/C;;;GAGG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAoB9C"}
|
package/lib/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.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EAAE,EAAE;gBAClC,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;gBACrC,IAAI,IAAI,KAAK,SAAS;oBAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;gBAC/E,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,gBAAgB,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;gBAC9D,IAAI,CAAC,MAAM,CAAC,EAAE;oBAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;gBAC/G,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO;oBAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;YACvF,CAAC;SACF;KACF,CAAC,EAAE,8CAA8C,CAAC,CAAA;AACrD,CAAC"}
|
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":[],"sources":["../src/modes.ts","../src/client/index.ts"],"sourcesContent":["/**\n * The single source of truth for the `/permissions` rule-engine modes. Pure\n * and browser-safe (no cordis/session imports) so the host command (the write\n * path), the client popupSelect decoration (a pick submits `/permissions\n * <id>`), and the TUI picker overlay all render from the same lists and\n * cannot drift.\n */\n\n/** The available CC rule-engine modes, shared by the switch list and the popup. */\nexport const PERMISSION_COMMAND_MODES = [\n 'default', 'acceptEdits', 'plan', 'auto', 'bypassPermissions',\n] as const\n/** A union of the rule-engine mode ids. */\nexport type PermissionCommandMode = (typeof PERMISSION_COMMAND_MODES)[number]\n\n/** One popup row: its switch id plus human-facing label and detail. */\nexport interface PermissionModeOption {\n readonly id: PermissionCommandMode\n readonly label: string\n readonly detail: string\n}\n\n/** The popup rows, in display order. */\nexport const PERMISSION_MODE_OPTIONS: readonly PermissionModeOption[] = [\n { id: 'default', label: 'Default', detail: 'Follow allow/deny/ask rules; unmatched calls pass through.' },\n { id: 'acceptEdits', label: 'Accept edits', detail: 'File edits are auto-allowed; other calls follow the rules.' },\n { id: 'plan', label: 'Plan', detail: 'Read-only until the plan is submitted via exit_plan_mode.' },\n { id: 'auto', label: 'Auto', detail: 'Low-risk approval prompts are auto-allowed; medium-risk prompts still ask.' },\n { id: 'bypassPermissions', label: 'Bypass permissions', detail: 'Skip permission prompts and pin the sandbox to full access. Bypass-immune and catastrophic commands stay denied.' },\n]\n\n/** The mode that carries the explicit risk gate (mirrors `/permission` Full access). */\nexport const BYPASS_MODE = 'bypassPermissions' as const\n\n/**\n * Explicit risk gate on the bypassPermissions row, shared by the browser\n * popupSelect confirmation and the TUI picker overlay.\n */\nexport const BYPASS_CONFIRMATION = {\n title: 'Enable Bypass permissions?',\n description: 'Bypass permissions skips approval prompts and pins this session\\'s sandbox to full access. Bypass-immune paths and catastrophic commands stay denied. Only use it when you trust the current task.',\n acknowledgeLabel: 'I understand the risks and want to continue',\n cancelLabel: 'Cancel',\n confirmLabel: 'Enable Bypass permissions',\n} as const\n","/**\n * Browser half of `@dsh-cc/command-permissions`. Hangs a popupSelect\n * DECORATION on the host `/permissions` command. The decoration owns only the\n * bare invocation; the host command keeps its catalog row, the argued path\n * (`/permissions <mode>` still switches directly), and the lifecycle logging.\n * A pick submits `/permissions ${id}` so both surfaces write through one path.\n *\n * `/permission` (host, sandbox+approval presets) is hidden from the CC\n * slash catalog by the host half wrapping `commands.list`; this decoration\n * only covers `/permissions`. The composer chip still executes\n * `/permission <preset>` against the global handler.\n *\n * @module @dsh-cc/command-permissions/client\n */\nimport type { ClientContext
|
|
1
|
+
{"version":3,"file":"client.js","names":[],"sources":["../src/modes.ts","../src/client/index.ts"],"sourcesContent":["/**\n * The single source of truth for the `/permissions` rule-engine modes. Pure\n * and browser-safe (no cordis/session imports) so the host command (the write\n * path), the client popupSelect decoration (a pick submits `/permissions\n * <id>`), and the TUI picker overlay all render from the same lists and\n * cannot drift.\n */\n\n/** The available CC rule-engine modes, shared by the switch list and the popup. */\nexport const PERMISSION_COMMAND_MODES = [\n 'default', 'acceptEdits', 'plan', 'auto', 'bypassPermissions',\n] as const\n/** A union of the rule-engine mode ids. */\nexport type PermissionCommandMode = (typeof PERMISSION_COMMAND_MODES)[number]\n\n/** One popup row: its switch id plus human-facing label and detail. */\nexport interface PermissionModeOption {\n readonly id: PermissionCommandMode\n readonly label: string\n readonly detail: string\n}\n\n/** The popup rows, in display order. */\nexport const PERMISSION_MODE_OPTIONS: readonly PermissionModeOption[] = [\n { id: 'default', label: 'Default', detail: 'Follow allow/deny/ask rules; unmatched calls pass through.' },\n { id: 'acceptEdits', label: 'Accept edits', detail: 'File edits are auto-allowed; other calls follow the rules.' },\n { id: 'plan', label: 'Plan', detail: 'Read-only until the plan is submitted via exit_plan_mode.' },\n { id: 'auto', label: 'Auto', detail: 'Low-risk approval prompts are auto-allowed; medium-risk prompts still ask.' },\n { id: 'bypassPermissions', label: 'Bypass permissions', detail: 'Skip permission prompts and pin the sandbox to full access. Bypass-immune and catastrophic commands stay denied.' },\n]\n\n/** The mode that carries the explicit risk gate (mirrors `/permission` Full access). */\nexport const BYPASS_MODE = 'bypassPermissions' as const\n\n/**\n * Explicit risk gate on the bypassPermissions row, shared by the browser\n * popupSelect confirmation and the TUI picker overlay.\n */\nexport const BYPASS_CONFIRMATION = {\n title: 'Enable Bypass permissions?',\n description: 'Bypass permissions skips approval prompts and pins this session\\'s sandbox to full access. Bypass-immune paths and catastrophic commands stay denied. Only use it when you trust the current task.',\n acknowledgeLabel: 'I understand the risks and want to continue',\n cancelLabel: 'Cancel',\n confirmLabel: 'Enable Bypass permissions',\n} as const\n","/**\n * Browser half of `@dsh-cc/command-permissions`. Hangs a popupSelect\n * DECORATION on the host `/permissions` command. The decoration owns only the\n * bare invocation; the host command keeps its catalog row, the argued path\n * (`/permissions <mode>` still switches directly), and the lifecycle logging.\n * A pick submits `/permissions ${id}` so both surfaces write through one path.\n *\n * `/permission` (host, sandbox+approval presets) is hidden from the CC\n * slash catalog by the host half wrapping `commands.list`; this decoration\n * only covers `/permissions`. The composer chip still executes\n * `/permission <preset>` against the global handler.\n *\n * @module @dsh-cc/command-permissions/client\n */\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type { ISessions, SessionFace } from '@deepseek-ai/dsh-api-session-controller/client'\nimport type { CommandUiContract, SelectOption } from '@deepseek-ai/dsh-client-ui-commands/client'\nimport type { ClientSessionContext } from '@deepseek-ai/dsh-client-ui-input-trigger/client'\nimport { BYPASS_CONFIRMATION, BYPASS_MODE, PERMISSION_MODE_OPTIONS } from '../modes.ts'\n\nexport const inject = ['commandUi', 'sessions']\n\n/**\n * Resolve the live session face for a popup session scope (undefined = not\n * materialized). `ctx.sessions` reads the client sessions face; some shared\n * node packages over-declare the same key as their own store, so narrow it to\n * the client contract here.\n */\nfunction sessionFor(ctx: ClientContext, session: ClientSessionContext): SessionFace | undefined {\n const sessions = ctx.sessions as unknown as ISessions\n return sessions.binding(session.sessionId)?.session\n}\n\n/** Flatten the shareable mode rows into popup options; bypassPermissions carries the risk gate. */\nfunction optionsOf(): SelectOption[] {\n return PERMISSION_MODE_OPTIONS.map(option => ({\n id: option.id,\n label: option.label,\n detail: option.detail,\n ...(option.id === BYPASS_MODE ? { confirmation: { ...BYPASS_CONFIRMATION } } : {}),\n }))\n}\n\n/**\n * Register the `/permissions` bare-invocation popup over the host command.\n * @param ctx - client root context.\n */\nexport function apply(ctx: ClientContext): void {\n const command = ctx.get('commandUi') as CommandUiContract\n ctx.effect(() => command.decorate({\n name: 'permissions',\n // The host catalog already hides `/permissions` from non-CC sessions\n // (`commands.list` wrap). A missing host row means this decoration is a\n // no-op — it never manufactures a command.\n available: () => true,\n ui: {\n kind: 'popupSelect',\n options: () => Promise.resolve(optionsOf()),\n onSelect: async (option, session) => {\n const live = sessionFor(ctx, session)\n if (live === undefined) throw new Error('this session is not materialized yet')\n const result = await live.command(`/permissions ${option.id}`)\n if (!result.ok) throw new Error(`permission mode switch failed: ${result.error.code}: ${result.error.message}`)\n if (!result.value.matched) throw new Error('the host offers no /permissions command')\n },\n },\n }), 'command-permissions: /permissions decoration')\n}\n"],"mappings":";;;;;;;;EAuBA,MAAa,0BAA2D;GACtE;IAAE,IAAI;IAAW,OAAO;IAAW,QAAQ;GAA6D;GACxG;IAAE,IAAI;IAAe,OAAO;IAAgB,QAAQ;GAA6D;GACjH;IAAE,IAAI;IAAQ,OAAO;IAAQ,QAAQ;GAA4D;GACjG;IAAE,IAAI;IAAQ,OAAO;IAAQ,QAAQ;GAA6E;GAClH;IAAE,IAAI;IAAqB,OAAO;IAAsB,QAAQ;GAAmH;EACrL;;;;;EASA,MAAa,sBAAsB;GACjC,OAAO;GACP,aAAa;GACb,kBAAkB;GAClB,aAAa;GACb,cAAc;EAChB;;;ECxBA,MAAa,SAAS,CAAC,aAAa,UAAU;;;;;;;EAQ9C,SAAS,WAAW,KAAoB,SAAwD;GAE9F,OADiB,IAAI,SACL,QAAQ,QAAQ,SAAS,CAAC,EAAE;EAC9C;;EAGA,SAAS,YAA4B;GACnC,OAAO,wBAAwB,KAAI,YAAW;IAC5C,IAAI,OAAO;IACX,OAAO,OAAO;IACd,QAAQ,OAAO;IACf,GAAI,OAAO,OAAA,sBAAqB,EAAE,cAAc,EAAE,GAAG,oBAAoB,EAAE,IAAI,CAAC;GAClF,EAAE;EACJ;;;;;EAMA,SAAgB,MAAM,KAA0B;GAC9C,MAAM,UAAU,IAAI,IAAI,WAAW;GACnC,IAAI,aAAa,QAAQ,SAAS;IAChC,MAAM;IAIN,iBAAiB;IACjB,IAAI;KACF,MAAM;KACN,eAAe,QAAQ,QAAQ,UAAU,CAAC;KAC1C,UAAU,OAAO,QAAQ,YAAY;MACnC,MAAM,OAAO,WAAW,KAAK,OAAO;MACpC,IAAI,SAAS,KAAA,GAAW,MAAM,IAAI,MAAM,sCAAsC;MAC9E,MAAM,SAAS,MAAM,KAAK,QAAQ,gBAAgB,OAAO,IAAI;MAC7D,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,MAAM,kCAAkC,OAAO,MAAM,KAAK,IAAI,OAAO,MAAM,SAAS;MAC9G,IAAI,CAAC,OAAO,MAAM,SAAS,MAAM,IAAI,MAAM,yCAAyC;KACtF;IACF;GACF,CAAC,GAAG,8CAA8C;EACpD"}
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAUlD,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,wBAAwB,EACxB,uBAAuB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAErF,eAAO,MAAM,IAAI,wBAAwB,CAAA;AACzC;;;;;GAKG;AACH,eAAO,MAAM,MAAM,UAAe,CAAA;AAqHlC;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAUxC"}
|
package/lib/index.js
CHANGED
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
import { PERMISSION_COMMAND_MODES } from "./modes.js";
|
|
31
31
|
import { planPhaseOf } from "./plan-phase.js";
|
|
32
32
|
import { renderPermissions } from "./permissions.js";
|
|
33
|
+
import { helpable } from '@dsh-cc/command-usage';
|
|
34
|
+
import { PERMISSION_MODE_OPTIONS } from "./modes.js";
|
|
33
35
|
export { BYPASS_CONFIRMATION, BYPASS_MODE, PERMISSION_COMMAND_MODES, PERMISSION_MODE_OPTIONS, } from "./modes.js";
|
|
34
36
|
export { planPhaseOf } from "./plan-phase.js";
|
|
35
37
|
export const name = 'command-permissions';
|
|
@@ -57,7 +59,7 @@ function renderState(service) {
|
|
|
57
59
|
function planPhaseFor(ctx, agent) {
|
|
58
60
|
const projections = ctx.get('sessionProjections');
|
|
59
61
|
const planState = projections?.stateOf(agent.session, 'plan');
|
|
60
|
-
return planPhaseOf(agent.session.
|
|
62
|
+
return planPhaseOf(agent.session.snapshotEvents(), planState);
|
|
61
63
|
}
|
|
62
64
|
/** Execute `/permissions` against the mounted permission-rules engine. */
|
|
63
65
|
async function executePermissions(ctx, invocation) {
|
|
@@ -112,7 +114,7 @@ async function executePermissions(ctx, invocation) {
|
|
|
112
114
|
}
|
|
113
115
|
/** Whether this session selected the CC agent preset (last `agent-preset/selected` wins, else the creation header). */
|
|
114
116
|
function isCcSession(agent) {
|
|
115
|
-
const events = agent.session.
|
|
117
|
+
const events = agent.session.snapshotEvents();
|
|
116
118
|
for (let index = events.length - 1; index >= 0; index -= 1) {
|
|
117
119
|
const event = events[index];
|
|
118
120
|
if (event.type === 'agent-preset/selected') {
|
|
@@ -153,12 +155,14 @@ function installCatalogWrap(ctx) {
|
|
|
153
155
|
* @param ctx - context carrying the command registry and permission engine.
|
|
154
156
|
*/
|
|
155
157
|
export function apply(ctx) {
|
|
156
|
-
ctx.commands.register({
|
|
158
|
+
ctx.commands.register(helpable({
|
|
157
159
|
name: 'permissions',
|
|
158
160
|
description: 'show or switch the permission mode (default|acceptEdits|plan|auto|bypassPermissions)',
|
|
159
161
|
input: { hint: '[mode]' },
|
|
160
162
|
handler: (invocation) => executePermissions(ctx, invocation),
|
|
161
|
-
}
|
|
163
|
+
}, {
|
|
164
|
+
subcommands: PERMISSION_MODE_OPTIONS.map(option => ({ word: option.id, summary: option.detail })),
|
|
165
|
+
}));
|
|
162
166
|
if (ctx.agent === undefined)
|
|
163
167
|
installCatalogWrap(ctx);
|
|
164
168
|
}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAMH,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,EAAE,WAAW,EAA0C,MAAM,iBAAiB,CAAA;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,wBAAwB,EACxB,uBAAuB,GAGxB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,WAAW,EAA0C,MAAM,iBAAiB,CAAA;AAErF,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAA;AACzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAAU,CAAC,CAAA;AAQlC,iFAAiF;AACjF,MAAM,KAAK,GAAG,wBAAwB,CAAA;AAEtC,2DAA2D;AAC3D,SAAS,WAAW,CAAC,OAA4B;IAC/C,OAAO;QACL,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC,OAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC;KACvF,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,YAAY,CAAC,GAAY,EAAE,KAAY;IAC9C,MAAM,WAAW,GAAG,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAEnC,CAAA;IACb,MAAM,SAAS,GAAG,WAAW,EAAE,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAkC,CAAA;IAC9F,OAAO,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sour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,CAAA;AACjE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAC7B,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,sFAAsF;QACnG,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,OAAO,EAAE,CAAC,UAA6B,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAG,EAAE,UAAU,CAAC;KAChF,EAAE;QACD,WAAW,EAAE,uBAAuB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;KAClG,CAAC,CAAC,CAAA;IACH,IAAI,GAAG,CAAC,KAAK,KAAK,SAAS;QAAE,kBAAkB,CAAC,GAAG,CAAC,CAAA;AACtD,CAAC"}
|
package/lib/plan-phase.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* the projection registry. Pure and browser-safe.
|
|
9
9
|
* @module @dsh-cc/command-permissions/plan-phase
|
|
10
10
|
*/
|
|
11
|
-
import { foldPlanMode } from '@
|
|
11
|
+
import { foldPlanMode } from '@dsh-cc/permission-rules';
|
|
12
12
|
/**
|
|
13
13
|
* Resolve the plan phase from the projection state, falling back to the
|
|
14
14
|
* session-log fold when the projection registry is not composed (custom
|
package/lib/plan-phase.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-phase.js","sourceRoot":"","sources":["../src/plan-phase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"plan-phase.js","sourceRoot":"","sources":["../src/plan-phase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAqBvD;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CACzB,MAA+B,EAC/B,SAAwC;IAExC,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAA;IACvE,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,EAAE,MAAM,IAAI,SAAS,CAAC,MAAM,CAAA;IACzD,MAAM,OAAO,GAAG,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;IAC1F,IAAI,CAAC,SAAS,CAAC,MAAM;QAAE,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAA;IACnE,OAAO,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;AAC7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-cc/command-permissions",
|
|
3
3
|
"description": "Human-facing /permissions command (CC rule-engine modes) plus a popupSelect decoration (and TUI overlay) for the bare invocation",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/dsh-cc/dsh-cc.git",
|
|
@@ -31,32 +31,37 @@
|
|
|
31
31
|
"dsh": {
|
|
32
32
|
"client": {
|
|
33
33
|
"inject": [
|
|
34
|
-
"@deepseek-ai/dsh-
|
|
34
|
+
"@deepseek-ai/dsh-api-session-controller",
|
|
35
35
|
"@deepseek-ai/dsh-client-ui-commands"
|
|
36
36
|
],
|
|
37
37
|
"platform": "web"
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@dsh-cc/command-usage": "^0.6.0"
|
|
42
|
+
},
|
|
40
43
|
"peerDependencies": {
|
|
41
|
-
"@deepseek-ai/cordis": ">=0.1.
|
|
42
|
-
"@deepseek-ai/dsh-
|
|
43
|
-
"@deepseek-ai/dsh-client-ui-commands": ">=0.1.
|
|
44
|
-
"@deepseek-ai/dsh-client-ui-input-trigger": ">=0.1.
|
|
45
|
-
"@deepseek-ai/dsh-commands": ">=0.1.
|
|
46
|
-
"@deepseek-ai/dsh-invariants": ">=0.1.
|
|
47
|
-
"@deepseek-ai/dsh-plan-mode": ">=0.1.
|
|
44
|
+
"@deepseek-ai/cordis": ">=0.1.2-rc.1",
|
|
45
|
+
"@deepseek-ai/dsh-api-session-controller": ">=0.1.2-rc.1",
|
|
46
|
+
"@deepseek-ai/dsh-client-ui-commands": ">=0.1.2-rc.1",
|
|
47
|
+
"@deepseek-ai/dsh-client-ui-input-trigger": ">=0.1.2-rc.1",
|
|
48
|
+
"@deepseek-ai/dsh-commands": ">=0.1.2-rc.1",
|
|
49
|
+
"@deepseek-ai/dsh-invariants": ">=0.1.2-rc.1",
|
|
50
|
+
"@deepseek-ai/dsh-plan-mode": ">=0.1.2-rc.1"
|
|
48
51
|
},
|
|
49
52
|
"devDependencies": {
|
|
50
53
|
"@deepseek-ai/cordis": "link:../../../../deepseek-harness/vendor/cordis",
|
|
51
54
|
"@deepseek-ai/cordis-plugin-loader": "link:../../../../deepseek-harness/vendor/loader",
|
|
52
55
|
"@deepseek-ai/dsh-agent": "link:../../../../deepseek-harness/packages/core/agent",
|
|
53
|
-
"@deepseek-ai/dsh-
|
|
56
|
+
"@deepseek-ai/dsh-api-session-controller": "link:../../../../deepseek-harness/packages/api/session-controller",
|
|
57
|
+
"@deepseek-ai/dsh-agent-loop": "link:../../../../deepseek-harness/packages/core/agent-loop",
|
|
54
58
|
"@deepseek-ai/dsh-client-ui-commands": "link:../../../../deepseek-harness/packages/client/ui-commands",
|
|
55
59
|
"@deepseek-ai/dsh-client-ui-input-trigger": "link:../../../../deepseek-harness/packages/client/ui-input-trigger",
|
|
56
60
|
"@deepseek-ai/dsh-commands": "link:../../../../deepseek-harness/packages/interaction/commands",
|
|
57
61
|
"@deepseek-ai/dsh-invariants": "link:../../../../deepseek-harness/packages/runtime-diagnostics/invariants",
|
|
58
62
|
"@deepseek-ai/dsh-plan-mode": "link:../../../../deepseek-harness/packages/plan/plan-mode",
|
|
59
63
|
"@deepseek-ai/dsh-session": "link:../../../../deepseek-harness/packages/core/session",
|
|
64
|
+
"@deepseek-ai/dsh-session-projection": "link:../../../../deepseek-harness/packages/session/session-projection",
|
|
60
65
|
"@deepseek-ai/dsh-system-prompt": "link:../../../../deepseek-harness/packages/core/system-prompt",
|
|
61
66
|
"@deepseek-ai/dsh-tools": "link:../../../../deepseek-harness/packages/core/tools",
|
|
62
67
|
"tsdown": "0.22.2"
|