@aibyzero/byz 0.1.3 → 0.1.5
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 +12 -0
- package/README.md +9 -3
- package/dist/cli.js +31 -22
- package/dist/fast.js +5 -2
- package/dist/runtime/bundle/chunks/{chunk-QY7DJQRI.js → chunk-WMLOZBQV.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 +31 -16
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.1.5 - 2026-08-28
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Made `byz workflow status` report the effective workflow when no target is given, distinguish active and available `none` states, and avoid unrelated workflow-root checks for `none` ([#20](https://github.com/kingxiaozhe/byz/pull/20)).
|
|
10
|
+
|
|
11
|
+
## 0.1.4 - 2026-08-27
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- 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)).
|
|
16
|
+
|
|
5
17
|
## 0.1.3 - 2026-08-27
|
|
6
18
|
|
|
7
19
|
### 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);
|
|
@@ -32,30 +29,42 @@ try {
|
|
|
32
29
|
console.error("BYZ updates: byz update (npm-managed global installations only)");
|
|
33
30
|
console.error("BYZ Fast: --fast (thinking=low; optional model: BYZ_FAST_MODEL)");
|
|
34
31
|
console.error("BYZ workflows: --workflow <cm|cm-plugin|none> (default: BYZ_WORKFLOW or cm)");
|
|
35
|
-
console.error(
|
|
32
|
+
console.error(
|
|
33
|
+
"Commands: byz workflow list | byz workflow status [cm|cm-plugin|none] | byz workflow check <cm|cm-plugin>",
|
|
34
|
+
);
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
if (await handleWorkflowCommand(commandArgs)) {
|
|
37
|
+
if (await handleWorkflowCommand(commandArgs, { workflowId: parsedWorkflow.workflowId })) {
|
|
39
38
|
// BYZ-owned command handled without starting the Pi runtime.
|
|
40
39
|
} else if (await handleByzUpdate(commandArgs)) {
|
|
41
40
|
// BYZ release metadata and package target stay independent from Pi.
|
|
42
41
|
} else {
|
|
43
42
|
const loadWorkflow = shouldLoadWorkflow(commandArgs);
|
|
44
43
|
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
|
-
);
|
|
44
|
+
const isInteractive = shouldEnableWorkflowSwitch(commandArgs, {
|
|
45
|
+
stdinIsTTY: process.stdin.isTTY,
|
|
46
|
+
stdoutIsTTY: process.stdout.isTTY,
|
|
47
|
+
});
|
|
53
48
|
if (fastRuntime.enabled && loadWorkflow && isInteractive) {
|
|
54
49
|
console.error(
|
|
55
|
-
`BYZ Fast: model=${fastRuntime.model}, thinking=${fastRuntime.thinking}, workflow=${
|
|
50
|
+
`BYZ Fast: model=${fastRuntime.model}, thinking=${fastRuntime.thinking}, workflow=${parsedWorkflow.workflowId}`,
|
|
56
51
|
);
|
|
57
52
|
}
|
|
58
|
-
|
|
53
|
+
|
|
54
|
+
if (loadWorkflow && isInteractive) {
|
|
55
|
+
const parsedRuntimeWorkflow = parseWorkflowOption(runtimeArgs);
|
|
56
|
+
const resolveResources = (workflowId) =>
|
|
57
|
+
resolveWorkflowRuntimeResources(workflowId, parsedRuntimeWorkflow.forwardedArgs);
|
|
58
|
+
const workflowExtension = createWorkflowSwitchExtension({
|
|
59
|
+
initialResources: await resolveResources(parsedRuntimeWorkflow.workflowId),
|
|
60
|
+
initialWorkflowId: parsedRuntimeWorkflow.workflowId,
|
|
61
|
+
resolveResources,
|
|
62
|
+
});
|
|
63
|
+
await main(parsedRuntimeWorkflow.forwardedArgs, { byzWorkflowExtensionFactory: workflowExtension });
|
|
64
|
+
} else {
|
|
65
|
+
const prepared = await prepareWorkflowRuntimeArgs(runtimeArgs, { load: loadWorkflow });
|
|
66
|
+
await main(prepared.args);
|
|
67
|
+
}
|
|
59
68
|
}
|
|
60
69
|
} catch (error) {
|
|
61
70
|
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);
|