@dsh-stack/tweak-plan-toggle 0.0.0-stage → 0.1.1

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/README.md CHANGED
@@ -1,3 +1,5 @@
1
- # Temporary Holding Version
1
+ # tweak-plan-toggle
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Plan/Build toggle: registers the /build command leaving plan mode through the harness plan-mode controller.
4
+
5
+ An extension of the `tweaks` settings surface, split out of the bundled `tweaks` package.
package/lib/index.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ /**
2
+ * `tweak-plan-toggle`: the Plan/Build toggle command plus the settings form
3
+ * projected from its own `tweak-plan-toggle` entry. Split out of the bundled
4
+ * `tweaks` package.
5
+ * @module tweak-plan-toggle
6
+ */
7
+ import type { Context } from "@deepseek-ai/cordis";
8
+ import type z from "@deepseek-ai/schemastery";
9
+ import { type PlanToggleConfig as PlanToggleConfigType } from "./settings.js";
10
+ export { NS_PLAN_TOGGLE, PlanToggleConfig } from "./settings.js";
11
+ export type { PlanToggleConfig as PlanToggleConfigType } from "./settings.js";
12
+ export { installPlanToggle } from "./plan-toggle.js";
13
+ export declare const name = "tweak-plan-toggle";
14
+ export declare const inject: string[];
15
+ /** The plan-toggle extension config: the plan-toggle section itself. */
16
+ export type Config = PlanToggleConfigType;
17
+ export declare const Config: z<Config>;
18
+ /**
19
+ * apply implementation.
20
+ *
21
+ * The plan-toggle form is the `PlanToggleConfig` this plugin already declares,
22
+ * and its namespace is this plugin's entry id, so there is nothing to install.
23
+ * What remains is to declare that this plugin ships its own page for that form
24
+ * and, when enabled, to register the `/build` command that leaves plan mode.
25
+ *
26
+ * @param ctx - the plugin's context.
27
+ * @param config - the plan-toggle configuration; `enabled` defaults to true.
28
+ */
29
+ export declare function apply(ctx: Context, config: Config): void;
package/lib/index.js ADDED
@@ -0,0 +1,31 @@
1
+ /**
2
+ * `tweak-plan-toggle`: the Plan/Build toggle command plus the settings form
3
+ * projected from its own `tweak-plan-toggle` entry. Split out of the bundled
4
+ * `tweaks` package.
5
+ * @module tweak-plan-toggle
6
+ */
7
+ import { declareCustomSettingsPage } from "@dsh-stack/plugin-kit";
8
+ import { installPlanToggle } from "./plan-toggle.js";
9
+ import { PlanToggleConfig, } from "./settings.js";
10
+ export { NS_PLAN_TOGGLE, PlanToggleConfig } from "./settings.js";
11
+ export { installPlanToggle } from "./plan-toggle.js";
12
+ export const name = "tweak-plan-toggle";
13
+ export const inject = [];
14
+ export const Config = PlanToggleConfig;
15
+ /**
16
+ * apply implementation.
17
+ *
18
+ * The plan-toggle form is the `PlanToggleConfig` this plugin already declares,
19
+ * and its namespace is this plugin's entry id, so there is nothing to install.
20
+ * What remains is to declare that this plugin ships its own page for that form
21
+ * and, when enabled, to register the `/build` command that leaves plan mode.
22
+ *
23
+ * @param ctx - the plugin's context.
24
+ * @param config - the plan-toggle configuration; `enabled` defaults to true.
25
+ */
26
+ export function apply(ctx, config) {
27
+ const session = { enabled: config?.enabled ?? true };
28
+ declareCustomSettingsPage(ctx);
29
+ if (session.enabled)
30
+ void installPlanToggle(ctx);
31
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * tweak-plan-toggle: registers `/build`, delegating to the harness plan-mode
3
+ * controller (`ctx.planMode.set(agent, false)`), so it complements the
4
+ * existing `/plan` command instead of colliding with it.
5
+ * @module tweak-plan-toggle/plan-toggle
6
+ */
7
+ import type { Context } from "@deepseek-ai/cordis";
8
+ /** Register the Build (leave-plan-mode) toggle command. Returns the inject fiber. */
9
+ export declare function installPlanToggle(ctx: Context): unknown;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * tweak-plan-toggle: registers `/build`, delegating to the harness plan-mode
3
+ * controller (`ctx.planMode.set(agent, false)`), so it complements the
4
+ * existing `/plan` command instead of colliding with it.
5
+ * @module tweak-plan-toggle/plan-toggle
6
+ */
7
+ /** Register the Build (leave-plan-mode) toggle command. Returns the inject fiber. */
8
+ export function installPlanToggle(ctx) {
9
+ return ctx.inject(["commands", "planMode"], (commandCtx) => {
10
+ return commandCtx.commands.register({
11
+ name: "build",
12
+ description: "Leave plan mode and continue in the default mode",
13
+ handler: ({ agent }) => {
14
+ switch (commandCtx.planMode.set(agent, false)) {
15
+ case "committed":
16
+ return { kind: "success", text: "Plan mode off. Continue building." };
17
+ case "queued":
18
+ return { kind: "success", text: "Leaving plan mode (applies from the next step)." };
19
+ case "cancelled":
20
+ return { kind: "success", text: "Plan mode is already inactive." };
21
+ case "noop":
22
+ return { kind: "success", text: "Plan mode is already inactive." };
23
+ }
24
+ },
25
+ });
26
+ });
27
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * tweak-plan-toggle settings: the Plan/Build toggle section schema.
3
+ * @module tweak-plan-toggle/settings
4
+ */
5
+ import z from "@deepseek-ai/schemastery";
6
+ /** Namespace of the plan-toggle section — this plugin's own Loader entry id. */
7
+ export declare const NS_PLAN_TOGGLE: import("@dsh-stack/plugin-kit").SettingsNamespace;
8
+ /** Plan-toggle knobs. */
9
+ export interface PlanToggleConfig {
10
+ /** Whether the Plan/Build toggle command is registered. */
11
+ enabled: boolean;
12
+ }
13
+ export declare const PlanToggleConfig: z<PlanToggleConfig>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * tweak-plan-toggle settings: the Plan/Build toggle section schema.
3
+ * @module tweak-plan-toggle/settings
4
+ */
5
+ import z from "@deepseek-ai/schemastery";
6
+ import { settingsNamespace } from "@dsh-stack/plugin-kit";
7
+ /** Namespace of the plan-toggle section — this plugin's own Loader entry id. */
8
+ export const NS_PLAN_TOGGLE = settingsNamespace("tweak-plan-toggle");
9
+ export const PlanToggleConfig = z.object({
10
+ enabled: z.boolean().default(true),
11
+ });
package/package.json CHANGED
@@ -1,6 +1,56 @@
1
1
  {
2
2
  "name": "@dsh-stack/tweak-plan-toggle",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Plan/Build toggle: registers the /build command leaving plan mode through the harness plan-mode controller.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "lib/index.js",
8
+ "types": "lib/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./lib/index.d.ts",
12
+ "default": "./lib/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "lib",
17
+ "README.md",
18
+ "package.json",
19
+ "stack.json"
20
+ ],
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "stack": {
25
+ "kind": "plugin",
26
+ "id": "stack.tweaks.plan-toggle"
27
+ },
28
+ "scripts": {
29
+ "build": "tsc -p tsconfig.json",
30
+ "typecheck": "tsc -p tsconfig.json --noEmit",
31
+ "test": "node check-plugin.mjs"
32
+ },
33
+ "peerDependencies": {
34
+ "@deepseek-ai/cordis": "^4.0.1",
35
+ "@deepseek-ai/schemastery": "*",
36
+ "@deepseek-ai/dsh-settings": "0.2.0-rc.2",
37
+ "@deepseek-ai/dsh-commands": "0.2.0-rc.2",
38
+ "@deepseek-ai/dsh-plan-mode": "0.2.0-rc.2"
39
+ },
40
+ "dependencies": {
41
+ "@dsh-stack/plugin-kit": "0.1.1"
42
+ },
43
+ "devDependencies": {
44
+ "typescript": "^6.0.3",
45
+ "@deepseek-ai/cordis": "^4.0.1",
46
+ "@deepseek-ai/schemastery": "*",
47
+ "@deepseek-ai/dsh-settings": "0.2.0-rc.2",
48
+ "@deepseek-ai/dsh-commands": "0.2.0-rc.2",
49
+ "@deepseek-ai/dsh-plan-mode": "0.2.0-rc.2"
50
+ },
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "https://github.com/marius-patrik/dsh-stack.git",
54
+ "directory": "plugins/tweak-plan-toggle"
55
+ }
56
+ }
package/stack.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "stack.tweaks.plan-toggle",
3
+ "name": "@dsh-stack/tweak-plan-toggle",
4
+ "version": "0.1.1",
5
+ "kind": "plugin",
6
+ "description": "Plan/Build toggle: registers the /build command leaving plan mode through the harness plan-mode controller.",
7
+ "files": ["lib", "README.md", "package.json", "stack.json"],
8
+ "dependencies": ["stack.library.plugin-kit"],
9
+ "optionalDependencies": []
10
+ }