@aibyzero/byz 0.1.3 → 0.1.4
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/CHANGELOG.md +6 -0
- package/README.md +9 -3
- package/dist/cli.js +27 -20
- package/dist/fast.js +5 -2
- package/dist/runtime/bundle/chunks/{chunk-QY7DJQRI.js → chunk-QLXFMGH6.js} +7 -7
- package/dist/runtime/bundle/cli.js +1 -1
- package/dist/runtime/bundle/index.js +1 -1
- package/dist/runtime/bundle/rpc-entry.js +1 -1
- package/dist/runtime/core/agent-session.d.ts +4 -1
- package/dist/runtime/core/agent-session.d.ts.map +1 -1
- package/dist/runtime/core/agent-session.js +38 -11
- package/dist/runtime/core/agent-session.js.map +1 -1
- package/dist/runtime/core/extensions/runner.d.ts +11 -1
- package/dist/runtime/core/extensions/runner.d.ts.map +1 -1
- package/dist/runtime/core/extensions/runner.js +40 -9
- package/dist/runtime/core/extensions/runner.js.map +1 -1
- package/dist/runtime/core/extensions/types.d.ts +7 -0
- package/dist/runtime/core/extensions/types.d.ts.map +1 -1
- package/dist/runtime/core/extensions/types.js.map +1 -1
- package/dist/runtime/core/resource-loader.d.ts +16 -1
- package/dist/runtime/core/resource-loader.d.ts.map +1 -1
- package/dist/runtime/core/resource-loader.js +216 -2
- package/dist/runtime/core/resource-loader.js.map +1 -1
- package/dist/runtime/main.d.ts +2 -1
- package/dist/runtime/main.d.ts.map +1 -1
- package/dist/runtime/main.js +1 -0
- package/dist/runtime/main.js.map +1 -1
- package/dist/runtime/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/runtime/modes/interactive/interactive-mode.js +5 -0
- package/dist/runtime/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/workflow-switch.js +95 -0
- package/dist/workflows.js +23 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.1.4 - 2026-08-27
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added same-session `/workflow` hot switching between the bundled CM Workflow, CM Plugin Workflow, and no managed workflow while preserving conversation, model, thinking, Fast Mode, and unrelated host resources ([#18](https://github.com/kingxiaozhe/byz/pull/18)).
|
|
10
|
+
|
|
5
11
|
## 0.1.3 - 2026-08-27
|
|
6
12
|
|
|
7
13
|
### Added
|
package/README.md
CHANGED
|
@@ -67,9 +67,15 @@ byz --workflow cm-plugin
|
|
|
67
67
|
byz --workflow none
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
Inside an interactive session, `/workflow` shows the active workflow.
|
|
71
|
+
`/workflow cm`, `/workflow cm-plugin`, and `/workflow none` switch it in place
|
|
72
|
+
without starting a new conversation or calling the model. BYZ validates the
|
|
73
|
+
target before replacing its managed skills and prompts, does not reload
|
|
74
|
+
unrelated extensions, and rejects switching while the agent is running.
|
|
75
|
+
|
|
76
|
+
BYZ loads at most one workflow at a time. Users do not install, update, or roll
|
|
77
|
+
back either workflow separately. Local development can override package roots
|
|
78
|
+
with `BYZ_CM_WORKFLOW_ROOT` or
|
|
73
79
|
`BYZ_CM_PLUGIN_WORKFLOW_ROOT`; the two roots must remain distinct.
|
|
74
80
|
|
|
75
81
|
## Development
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
import { prepareFastRuntimeArgs } from "./fast.js";
|
|
4
4
|
import { main } from "./runtime/bundle/index.js";
|
|
5
5
|
import { handleByzUpdate } from "./update.js";
|
|
6
|
-
import {
|
|
6
|
+
import { createWorkflowSwitchExtension, shouldEnableWorkflowSwitch, shouldLoadWorkflow } from "./workflow-switch.js";
|
|
7
|
+
import {
|
|
8
|
+
handleWorkflowCommand,
|
|
9
|
+
parseWorkflowOption,
|
|
10
|
+
prepareWorkflowRuntimeArgs,
|
|
11
|
+
resolveWorkflowRuntimeResources,
|
|
12
|
+
} from "./workflows.js";
|
|
7
13
|
|
|
8
14
|
process.title = "byz";
|
|
9
15
|
process.env.BYZ_CODING_AGENT = "true";
|
|
@@ -14,15 +20,6 @@ process.env.PI_TELEMETRY = "0";
|
|
|
14
20
|
|
|
15
21
|
const args = process.argv.slice(2);
|
|
16
22
|
|
|
17
|
-
function shouldLoadWorkflow(runtimeArgs) {
|
|
18
|
-
const terminatorIndex = runtimeArgs.indexOf("--");
|
|
19
|
-
const optionArgs = runtimeArgs.slice(0, terminatorIndex === -1 ? runtimeArgs.length : terminatorIndex);
|
|
20
|
-
if (optionArgs.some((arg) => ["--help", "-h", "--version", "-v", "--export", "--list-models"].includes(arg))) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
return !["auth", "config", "install", "list", "remove", "uninstall", "update"].includes(optionArgs[0]);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
23
|
try {
|
|
27
24
|
const fastRuntime = prepareFastRuntimeArgs(args);
|
|
28
25
|
const parsedWorkflow = parseWorkflowOption(fastRuntime.commandArgs);
|
|
@@ -42,20 +39,30 @@ try {
|
|
|
42
39
|
} else {
|
|
43
40
|
const loadWorkflow = shouldLoadWorkflow(commandArgs);
|
|
44
41
|
const runtimeArgs = loadWorkflow ? fastRuntime.args : fastRuntime.commandArgs;
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
);
|
|
50
|
-
const isInteractive = !optionArgs.some((arg) =>
|
|
51
|
-
["--help", "-h", "--version", "-v", "--export", "--list-models", "--print", "-p", "--mode"].includes(arg),
|
|
52
|
-
);
|
|
42
|
+
const isInteractive = shouldEnableWorkflowSwitch(commandArgs, {
|
|
43
|
+
stdinIsTTY: process.stdin.isTTY,
|
|
44
|
+
stdoutIsTTY: process.stdout.isTTY,
|
|
45
|
+
});
|
|
53
46
|
if (fastRuntime.enabled && loadWorkflow && isInteractive) {
|
|
54
47
|
console.error(
|
|
55
|
-
`BYZ Fast: model=${fastRuntime.model}, thinking=${fastRuntime.thinking}, workflow=${
|
|
48
|
+
`BYZ Fast: model=${fastRuntime.model}, thinking=${fastRuntime.thinking}, workflow=${parsedWorkflow.workflowId}`,
|
|
56
49
|
);
|
|
57
50
|
}
|
|
58
|
-
|
|
51
|
+
|
|
52
|
+
if (loadWorkflow && isInteractive) {
|
|
53
|
+
const parsedRuntimeWorkflow = parseWorkflowOption(runtimeArgs);
|
|
54
|
+
const resolveResources = (workflowId) =>
|
|
55
|
+
resolveWorkflowRuntimeResources(workflowId, parsedRuntimeWorkflow.forwardedArgs);
|
|
56
|
+
const workflowExtension = createWorkflowSwitchExtension({
|
|
57
|
+
initialResources: await resolveResources(parsedRuntimeWorkflow.workflowId),
|
|
58
|
+
initialWorkflowId: parsedRuntimeWorkflow.workflowId,
|
|
59
|
+
resolveResources,
|
|
60
|
+
});
|
|
61
|
+
await main(parsedRuntimeWorkflow.forwardedArgs, { byzWorkflowExtensionFactory: workflowExtension });
|
|
62
|
+
} else {
|
|
63
|
+
const prepared = await prepareWorkflowRuntimeArgs(runtimeArgs, { load: loadWorkflow });
|
|
64
|
+
await main(prepared.args);
|
|
65
|
+
}
|
|
59
66
|
}
|
|
60
67
|
} catch (error) {
|
|
61
68
|
console.error(error instanceof Error ? error.message : String(error));
|
package/dist/fast.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { getActiveByzOptionIndexes } from "./workflow-switch.js";
|
|
2
|
+
|
|
1
3
|
const SESSION_OPTIONS = new Set(["--continue", "-c", "--resume", "-r", "--session", "--session-id", "--fork"]);
|
|
2
4
|
const THINKING_SUFFIX_PATTERN = /:(off|minimal|low|medium|high|xhigh|max)$/;
|
|
3
5
|
|
|
@@ -16,6 +18,7 @@ function findOptionValue(args, option) {
|
|
|
16
18
|
|
|
17
19
|
export function prepareFastRuntimeArgs(args, env = process.env) {
|
|
18
20
|
const forwardedArgs = [];
|
|
21
|
+
const activeFastOptions = getActiveByzOptionIndexes(args, "fast");
|
|
19
22
|
let enabled = false;
|
|
20
23
|
for (let index = 0; index < args.length; index++) {
|
|
21
24
|
const arg = args[index];
|
|
@@ -23,12 +26,12 @@ export function prepareFastRuntimeArgs(args, env = process.env) {
|
|
|
23
26
|
forwardedArgs.push(...args.slice(index));
|
|
24
27
|
break;
|
|
25
28
|
}
|
|
26
|
-
if (arg === "--fast") {
|
|
29
|
+
if (arg === "--fast" && activeFastOptions.has(index)) {
|
|
27
30
|
if (enabled) throw new Error("--fast may only be specified once.");
|
|
28
31
|
enabled = true;
|
|
29
32
|
continue;
|
|
30
33
|
}
|
|
31
|
-
if (arg.startsWith("--fast=")) {
|
|
34
|
+
if (arg.startsWith("--fast=") && activeFastOptions.has(index)) {
|
|
32
35
|
throw new Error("--fast does not accept a value.");
|
|
33
36
|
}
|
|
34
37
|
forwardedArgs.push(arg);
|