@kanyun-ai-infra/band-cli 0.1.1 → 0.2.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/bundled/examples/aitutor-tool/band/views/release/package.json +1 -1
- package/bundled/examples/aitutor-tool/band/views/tool-preview/package.json +1 -1
- package/bundled/examples/analysis/band/views/intake/package.json +1 -1
- package/bundled/examples/compliance/band/views/compliance/package.json +1 -1
- package/bundled/examples/content-review/band/views/checklist/package.json +1 -1
- package/bundled/examples/rush-site/band/views/rush-db/package.json +1 -1
- package/bundled/examples/rush-site/band/views/rush-deploy/package.json +1 -1
- package/bundled/examples/video/band/views/timeline/package.json +1 -1
- package/bundled/kernel/fixture.js +1 -1
- package/bundled/kernel/index.js +1 -1
- package/bundled/official/activity/package.json +4 -4
- package/bundled/official/approval/package.json +4 -4
- package/bundled/official/artifacts/package.json +4 -4
- package/bundled/official/chat/dist/index.js +1 -1
- package/bundled/official/chat/package.json +4 -4
- package/bundled/official/chunks/chunk-7XYETT7C.js +1 -0
- package/bundled/official/comment/dist/index.js +1 -1
- package/bundled/official/comment/package.json +4 -4
- package/bundled/official/header/package.json +4 -4
- package/bundled/official/home/dist/index.js +1 -1
- package/bundled/official/home/package.json +4 -4
- package/bundled/official/layouts/package.json +4 -4
- package/bundled/official/library/dist/index.js +1 -1
- package/bundled/official/library/package.json +4 -4
- package/bundled/official/members/dist/index.js +1 -1
- package/bundled/official/members/package.json +4 -4
- package/bundled/official/memory/package.json +4 -4
- package/bundled/official/native/package.json +2 -2
- package/bundled/official/params-form/package.json +4 -4
- package/bundled/official/plugins/package.json +4 -4
- package/bundled/official/project/dist/index.js +1 -1
- package/bundled/official/project/package.json +4 -4
- package/bundled/official/queue/package.json +4 -4
- package/bundled/official/settings/dist/index.js +1 -1
- package/bundled/official/settings/package.json +4 -4
- package/bundled/official/shell/dist/index.js +1 -1
- package/bundled/official/shell/package.json +4 -4
- package/bundled/official/stages/package.json +4 -4
- package/bundled/official/threads/dist/index.js +1 -1
- package/bundled/official/threads/package.json +4 -4
- package/bundled/official/turn-bar/package.json +4 -4
- package/bundled/official/turn-trace/package.json +4 -4
- package/bundled/official/version-switch/dist/index.js +1 -1
- package/bundled/official/version-switch/package.json +4 -4
- package/bundled/official/viewer-entity/package.json +2 -2
- package/bundled/official/viewer-external/package.json +2 -2
- package/bundled/official/viewer-image/package.json +2 -2
- package/bundled/official/viewer-media/package.json +2 -2
- package/bundled/official/viewer-storyboard/package.json +2 -2
- package/bundled/official/viewer-text/package.json +4 -4
- package/bundled/official/viewer-tool/package.json +2 -2
- package/bundled/official/viewer-web/package.json +2 -2
- package/bundled/official/viewer-web-app/package.json +2 -2
- package/bundled/official/workshops/dist/index.js +2 -2
- package/bundled/official/workshops/package.json +4 -4
- package/bundled/official/workshops/plugin.yaml +2 -2
- package/bundled/skills/band-plugin/references/code.md +2 -2
- package/bundled/skills/band-plugin/references/manifest.md +2 -2
- package/bundled/skills/band-plugin/references/rules.md +1 -0
- package/bundled/skills/band-plugin/references/testing-publish.md +1 -1
- package/bundled/skills/band-plugin/templates/panel/package.json +1 -1
- package/bundled/tokens/components.css +1 -1
- package/dev-host/app.tsx +32 -12
- package/dev-host/host.css +7 -0
- package/dist/bin.js +3 -3
- package/dist/build-plugin.d.ts +1 -1
- package/dist/build-plugin.js +1 -1
- package/dist/{chunk-VTAJX7NN.js → chunk-FGPWXAOA.js} +165 -26
- package/dist/{chunk-TQHHHXXU.js → chunk-LGYGWMSY.js} +18 -16
- package/dist/{chunk-JWZU3NOD.js → chunk-XPLYTHNX.js} +1 -1
- package/dist/{dev-server-SB5FMSVP.js → dev-server-IBR3PKDE.js} +33 -5
- package/dist/fixture.d.ts +11 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -3
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +2 -2
- package/dist/{workshop-repo-Uq6blxyt.d.ts → workshop-repo-DqoVdcGu.d.ts} +9 -9
- package/package.json +10 -7
- package/src/dev-managers.ts +16 -0
- package/src/inspector-default.ts +9 -0
- package/bundled/official/chunks/chunk-SB74RUTN.js +0 -1
|
@@ -442,7 +442,7 @@ var ROLE_PERMISSIONS = [
|
|
|
442
442
|
"confirm",
|
|
443
443
|
"approve",
|
|
444
444
|
"publish",
|
|
445
|
-
/** @deprecated 管理权限由服务端的工坊与项目成员管理角色决定(`workshop_members`、`members.role`),这里照常校验但不起作用,`band check`
|
|
445
|
+
/** @deprecated 管理权限由服务端的工坊与项目成员管理角色决定(`workshop_members`、`members.role`),这里照常校验但不起作用,`band check` 告警;以后的协议大版本会改成拒绝。 */
|
|
446
446
|
"admin"
|
|
447
447
|
];
|
|
448
448
|
var RolePermissions = z2.array(z2.enum(ROLE_PERMISSIONS));
|
|
@@ -539,7 +539,7 @@ var WorkshopSchema = z2.object({
|
|
|
539
539
|
* 工坊的缺省 agent(1.11.0),缺省 `rondo`;agent 阶段写了 `agent` 就用阶段的(owner 11-02 启用阶段级 agent,
|
|
540
540
|
* [note](../../../.agents/notes/proposed/architecture/2026-10-27-single-agent-per-flow.md) 的部分取代头)。
|
|
541
541
|
* 写工坊项目里的 agent slug;阶段级 `agent` 覆盖它。`{ hubProject, slug }`(1.18.0)已弃用:1.x 照收并给告警,
|
|
542
|
-
* 解析出同一个 agent
|
|
542
|
+
* 解析出同一个 agent,以后的协议大版本会改成报错。
|
|
543
543
|
*/
|
|
544
544
|
agent: z2.union([Name, AgentRefSchema]).optional(),
|
|
545
545
|
/**
|
|
@@ -555,9 +555,9 @@ var WorkshopSchema = z2.object({
|
|
|
555
555
|
* 决定 3)。这里只认字段;发布检查与派发在服务端读它。
|
|
556
556
|
*/
|
|
557
557
|
userModelKey: z2.enum(["off", "allow", "require"]).optional(),
|
|
558
|
-
/** 已弃用:工坊只复制、不继承。1.x
|
|
558
|
+
/** 已弃用:工坊只复制、不继承。1.x 照旧合并并给警告,以后的协议大版本会改成报错;`overrides` 同。 */
|
|
559
559
|
extends: z2.string().min(1).optional(),
|
|
560
|
-
/** 已弃用:迭代方式写在 `repos.<名>.iteration` 上。1.x 只在没写 `repos`
|
|
560
|
+
/** 已弃用:迭代方式写在 `repos.<名>.iteration` 上。1.x 只在没写 `repos` 时接受并给警告(不再起作用),以后的协议大版本会改成报错。 */
|
|
561
561
|
iteration: IterationSchema.optional(),
|
|
562
562
|
repos: recordSchema2(Name, RepoSchema).optional(),
|
|
563
563
|
connectors: recordSchema2(Name, WorkshopConnectorSchema).optional(),
|
|
@@ -847,17 +847,17 @@ function inferConcept(s, kind, at, warnings) {
|
|
|
847
847
|
case "human":
|
|
848
848
|
if (s.gate !== void 0) return "check";
|
|
849
849
|
warnings.push(
|
|
850
|
-
`${at}: human \u9636\u6BB5\u65E2\u6CA1\u5199 produces \u4E5F\u6CA1\u5199\u95E8\u7981\uFF0C\u65E0\u4E8B\u53EF\u505A\uFF1B\u8981\u4EBA\u4EA4\u4E1C\u897F\u5199 produces\uFF08type: collect\uFF09\uFF0C\u8981\u4EBA\u9A8C\u5199\u95E8\u7981\uFF08type: review\uFF09\
|
|
850
|
+
`${at}: human \u9636\u6BB5\u65E2\u6CA1\u5199 produces \u4E5F\u6CA1\u5199\u95E8\u7981\uFF0C\u65E0\u4E8B\u53EF\u505A\uFF1B\u8981\u4EBA\u4EA4\u4E1C\u897F\u5199 produces\uFF08type: collect\uFF09\uFF0C\u8981\u4EBA\u9A8C\u5199\u95E8\u7981\uFF08type: review\uFF09\u3002\u4EE5\u540E\u7684\u534F\u8BAE\u5927\u7248\u672C\u4F1A\u6539\u6210\u62A5\u9519`
|
|
851
851
|
);
|
|
852
852
|
return "produce";
|
|
853
853
|
case "agent":
|
|
854
854
|
warnings.push(
|
|
855
|
-
`${at}: agent \u9636\u6BB5\u6CA1\u5199 produces\
|
|
855
|
+
`${at}: agent \u9636\u6BB5\u6CA1\u5199 produces\uFF0C\u5F53\u524D\u5F53\u4EA7\u51FA\u9636\u6BB5\u5904\u7406\uFF0C\u4EA7\u7269\u7C7B\u578B\u7B49\u4EA4\u4ED8\u65F6\u5B9A\uFF1B\u8865\u4E0A produces\uFF0C\u6216\u5199 type\uFF08\u4EA7\u51FA\u5199 generate\uFF09\u3002\u4EE5\u540E\u7684\u534F\u8BAE\u5927\u7248\u672C\u4F1A\u6539\u6210\u62A5\u9519`
|
|
856
856
|
);
|
|
857
857
|
return "produce";
|
|
858
858
|
case "external":
|
|
859
859
|
warnings.push(
|
|
860
|
-
`${at}: external \u9636\u6BB5\u6CA1\u5199 produces\
|
|
860
|
+
`${at}: external \u9636\u6BB5\u6CA1\u5199 produces\uFF0C\u5F53\u524D\u5F53\u4EA7\u51FA\u9636\u6BB5\u5904\u7406\uFF0C\u4EA7\u7269\u7C7B\u578B\u7B49\u5916\u90E8\u56DE\u8C03\u65F6\u5B9A\uFF1B\u8865\u4E0A produces\uFF0C\u6216\u5199 type\uFF08\u4EA7\u51FA\u5199 generate\uFF0C\u53D1\u5E03\u5199 publish\uFF0C\u68C0\u6D4B\u5199 check\uFF09\u3002\u4EE5\u540E\u7684\u534F\u8BAE\u5927\u7248\u672C\u4F1A\u6539\u6210\u62A5\u9519`
|
|
861
861
|
);
|
|
862
862
|
return "produce";
|
|
863
863
|
}
|
|
@@ -1388,12 +1388,12 @@ function compileWorkshop(input, options = {}) {
|
|
|
1388
1388
|
checkConnectors(def, options.connectors, issues, warnings);
|
|
1389
1389
|
if (isPlainObject(input) && (input.extends !== void 0 || input.overrides !== void 0))
|
|
1390
1390
|
warnings.push(
|
|
1391
|
-
"extends / overrides: \u5DF2\u5F03\u7528\uFF0C\u5DE5\u574A\u53EA\u590D\u5236\u3001\u4E0D\u7EE7\u627F\uFF1B\u8981\u5728\u522B\u7684\u5DE5\u574A\u4E0A\u6539\uFF0C\u5230\u5B83\u7684\u8BE6\u60C5\u9875\u70B9\u300C\u590D\u5236\u4E00\u4EFD\u300D\uFF0C\u4E4B\u540E\u4E24\u8FB9\u5404\u6539\u5404\u7684\
|
|
1391
|
+
"extends / overrides: \u5DF2\u5F03\u7528\uFF0C\u5DE5\u574A\u53EA\u590D\u5236\u3001\u4E0D\u7EE7\u627F\uFF1B\u8981\u5728\u522B\u7684\u5DE5\u574A\u4E0A\u6539\uFF0C\u5230\u5B83\u7684\u8BE6\u60C5\u9875\u70B9\u300C\u590D\u5236\u4E00\u4EFD\u300D\uFF0C\u4E4B\u540E\u4E24\u8FB9\u5404\u6539\u5404\u7684\u3002\u4EE5\u540E\u7684\u534F\u8BAE\u5927\u7248\u672C\u4F1A\u6539\u6210\u62A5\u9519"
|
|
1392
1392
|
);
|
|
1393
1393
|
for (const [name, role] of Object.entries(def.roles ?? {}))
|
|
1394
1394
|
if (permissionsOf(role).includes("admin"))
|
|
1395
1395
|
warnings.push(
|
|
1396
|
-
`roles.${name}: admin \u6743\u9650\u5DF2\u5F03\u7528\uFF0C\u5199\u4E86\u4E0D\u8D77\u4F5C\u7528\uFF1B\u7BA1\u7406\u6743\u9650\u6539\u7531\u5DE5\u574A\u4E0E\u9879\u76EE\u7684\u7BA1\u7406\u89D2\u8272\u7ED9\uFF08\u5DE5\u574A\u6210\u5458 workshop_members\u3001\u9879\u76EE\u6210\u5458 members.role\uFF09\
|
|
1396
|
+
`roles.${name}: admin \u6743\u9650\u5DF2\u5F03\u7528\uFF0C\u5199\u4E86\u4E0D\u8D77\u4F5C\u7528\uFF1B\u7BA1\u7406\u6743\u9650\u6539\u7531\u5DE5\u574A\u4E0E\u9879\u76EE\u7684\u7BA1\u7406\u89D2\u8272\u7ED9\uFF08\u5DE5\u574A\u6210\u5458 workshop_members\u3001\u9879\u76EE\u6210\u5458 members.role\uFF09\u3002\u4EE5\u540E\u7684\u534F\u8BAE\u5927\u7248\u672C\u4F1A\u6539\u6210\u62A5\u9519`
|
|
1397
1397
|
);
|
|
1398
1398
|
const types = def.artifactTypes ?? {};
|
|
1399
1399
|
const repos = compileRepos(def, options, issues, warnings);
|
|
@@ -1492,14 +1492,14 @@ function compileWorkshop(input, options = {}) {
|
|
|
1492
1492
|
const reservedFor = d.artifactType ? reservedTypeUse(d.artifactType) : void 0;
|
|
1493
1493
|
if (d.artifactType && d.artifactType !== PASS_ARTIFACT_TYPE && reservedFor !== void 0) {
|
|
1494
1494
|
warnings.push(
|
|
1495
|
-
`${at}.needs: ${d.stage}:${d.artifactType} \u6307\u5411\u5E73\u53F0\u4FDD\u7559\u540D\uFF08${reservedFor}\uFF09\uFF1B\u7ED9\u5DE5\u574A\u7684\u4EA7\u7269\u7C7B\u578B\u6362\u4E2A\u540D\u5B57\
|
|
1495
|
+
`${at}.needs: ${d.stage}:${d.artifactType} \u6307\u5411\u5E73\u53F0\u4FDD\u7559\u540D\uFF08${reservedFor}\uFF09\uFF1B\u7ED9\u5DE5\u574A\u7684\u4EA7\u7269\u7C7B\u578B\u6362\u4E2A\u540D\u5B57\u3002\u4EE5\u540E\u7684\u534F\u8BAE\u5927\u7248\u672C\u4F1A\u6539\u6210\u62A5\u9519`
|
|
1496
1496
|
);
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
1499
|
for (const w of bypasses(stages, st)) warnings.push(`${at}.needs: ${w}`);
|
|
1500
1500
|
if (st.concept === "check" && st.deps.length === 0) {
|
|
1501
1501
|
warnings.push(
|
|
1502
|
-
`${at}: \u68C0\u67E5\u9636\u6BB5\u6CA1\u5199 needs\uFF0C\u6CA1\u6709\u4E1C\u897F\u53EF\u9A8C\uFF0C\u4E0D\u51FA\u5019\u9009\u4E5F\u4E0D\u53D1\u4EFB\u52A1\uFF1B\u5199\u4E0A\u8981\u9A8C\u7684\u4E0A\u6E38\u9636\u6BB5\
|
|
1502
|
+
`${at}: \u68C0\u67E5\u9636\u6BB5\u6CA1\u5199 needs\uFF0C\u6CA1\u6709\u4E1C\u897F\u53EF\u9A8C\uFF0C\u4E0D\u51FA\u5019\u9009\u4E5F\u4E0D\u53D1\u4EFB\u52A1\uFF1B\u5199\u4E0A\u8981\u9A8C\u7684\u4E0A\u6E38\u9636\u6BB5\u3002\u4EE5\u540E\u7684\u534F\u8BAE\u5927\u7248\u672C\u4F1A\u6539\u6210\u62A5\u9519`
|
|
1503
1503
|
);
|
|
1504
1504
|
}
|
|
1505
1505
|
if (st.concept === "check" && st.fanOut !== void 0) {
|
|
@@ -1639,7 +1639,7 @@ function compileWorkshop(input, options = {}) {
|
|
|
1639
1639
|
warnNonAgentStageAgent(workflows, warnings);
|
|
1640
1640
|
if (typeof def.agent === "object")
|
|
1641
1641
|
warnings.push(
|
|
1642
|
-
`agent: { hubProject, slug } \u5199\u6CD5\u5DF2\u5F03\u7528\uFF1B\u5DE5\u574A\u7EA7 agent \u76F4\u63A5\u5199\u5DE5\u574A\u9879\u76EE\u91CC\u7684 agent slug\uFF08agent: ${def.agent.slug}\uFF09\uFF0C\u9636\u6BB5\u7EA7 agent \u8986\u76D6\u5B83\u3002\u6539\u5199\u540E\u8FD9\u4E2A agent \u8981\u5728 agents \u91CC\u58F0\u660E\uFF0C\u4E14\u4E0D\u518D\u6309\u539F hubProject \u6D3E\u53D1\
|
|
1642
|
+
`agent: { hubProject, slug } \u5199\u6CD5\u5DF2\u5F03\u7528\uFF1B\u5DE5\u574A\u7EA7 agent \u76F4\u63A5\u5199\u5DE5\u574A\u9879\u76EE\u91CC\u7684 agent slug\uFF08agent: ${def.agent.slug}\uFF09\uFF0C\u9636\u6BB5\u7EA7 agent \u8986\u76D6\u5B83\u3002\u6539\u5199\u540E\u8FD9\u4E2A agent \u8981\u5728 agents \u91CC\u58F0\u660E\uFF0C\u4E14\u4E0D\u518D\u6309\u539F hubProject \u6D3E\u53D1\u3002\u4EE5\u540E\u7684\u534F\u8BAE\u5927\u7248\u672C\u4F1A\u6539\u6210\u62A5\u9519`
|
|
1643
1643
|
);
|
|
1644
1644
|
const agents = compileAgents(
|
|
1645
1645
|
def,
|
|
@@ -1777,7 +1777,7 @@ function compileRepos(def, options, issues, warnings) {
|
|
|
1777
1777
|
issues.push("iteration: \u8FED\u4EE3\u65B9\u5F0F\u5199\u5728 repos.<\u540D>.iteration \u4E0A\uFF0C\u5DE5\u574A\u7EA7\u7684 iteration \u5220\u6389");
|
|
1778
1778
|
} else {
|
|
1779
1779
|
warnings.push(
|
|
1780
|
-
"iteration: \u5DF2\u5F03\u7528\uFF0C\u4E0D\u518D\u8D77\u4F5C\u7528\uFF08\u5DE5\u574A\u4ED3\u5E93\u4E0D\u653E\u4EA7\u7269\uFF0C\u4E5F\u6CA1\u6709\u9879\u76EE\u5206\u652F\uFF09\uFF1B\u8981\u63D0\u4EA4\u4EE3\u7801\u7684\u4EA7\u7269\u5199\u5230 repos \u58F0\u660E\u7684\u76EE\u6807\u4ED3\u5E93\uFF0Citeration \u5199\u5728 repos.<\u540D> \u4E0A\
|
|
1780
|
+
"iteration: \u5DF2\u5F03\u7528\uFF0C\u4E0D\u518D\u8D77\u4F5C\u7528\uFF08\u5DE5\u574A\u4ED3\u5E93\u4E0D\u653E\u4EA7\u7269\uFF0C\u4E5F\u6CA1\u6709\u9879\u76EE\u5206\u652F\uFF09\uFF1B\u8981\u63D0\u4EA4\u4EE3\u7801\u7684\u4EA7\u7269\u5199\u5230 repos \u58F0\u660E\u7684\u76EE\u6807\u4ED3\u5E93\uFF0Citeration \u5199\u5728 repos.<\u540D> \u4E0A\u3002\u4EE5\u540E\u7684\u534F\u8BAE\u5927\u7248\u672C\u4F1A\u6539\u6210\u62A5\u9519"
|
|
1781
1781
|
);
|
|
1782
1782
|
}
|
|
1783
1783
|
}
|
|
@@ -1819,7 +1819,9 @@ function compileRepos(def, options, issues, warnings) {
|
|
|
1819
1819
|
function checkSurfaces(def, warnings) {
|
|
1820
1820
|
const surfaces = def.views?.surfaces;
|
|
1821
1821
|
if (surfaces === void 0) return;
|
|
1822
|
-
warnings.push(
|
|
1822
|
+
warnings.push(
|
|
1823
|
+
"views.surfaces: \u5F53\u524D\u8FD8\u6CA1\u6709\u6E32\u67D3\uFF0C\u5199\u4E86\u4E0D\u8D77\u4F5C\u7528\uFF1B\u5F62\u72B6\u5F85\u5B9A\uFF0C\u4EE5\u540E\u7684\u534F\u8BAE\u5927\u7248\u672C\u4F1A\u6309 schema \u6821\u9A8C"
|
|
1824
|
+
);
|
|
1823
1825
|
for (const [name, fields] of Object.entries(surfaces)) {
|
|
1824
1826
|
const at = `views.surfaces.${name}`;
|
|
1825
1827
|
if (!/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/.test(name))
|
|
@@ -1877,7 +1879,7 @@ function checkArtifactTypes(def, repos, issues, warnings) {
|
|
|
1877
1879
|
const reservedFor = reservedTypeUse(name);
|
|
1878
1880
|
if (reservedFor !== void 0) {
|
|
1879
1881
|
warnings.push(
|
|
1880
|
-
`${at}: ${name} \u662F\u5E73\u53F0\u4FDD\u7559\u7684\u4EA7\u7269\u7C7B\u578B\u540D\uFF08${reservedFor}\uFF09\uFF0C\u6362\u4E2A\u540D\u5B57\
|
|
1882
|
+
`${at}: ${name} \u662F\u5E73\u53F0\u4FDD\u7559\u7684\u4EA7\u7269\u7C7B\u578B\u540D\uFF08${reservedFor}\uFF09\uFF0C\u6362\u4E2A\u540D\u5B57\u3002\u4EE5\u540E\u7684\u534F\u8BAE\u5927\u7248\u672C\u4F1A\u6539\u6210\u62A5\u9519`
|
|
1881
1883
|
);
|
|
1882
1884
|
}
|
|
1883
1885
|
if (t.role === "process" && t.storage !== void 0 && t.storage !== "store") {
|
|
@@ -1901,7 +1903,7 @@ function checkArtifactTypes(def, repos, issues, warnings) {
|
|
|
1901
1903
|
}
|
|
1902
1904
|
if (t.repo === void 0 && t.paths === void 0) {
|
|
1903
1905
|
warnings.push(
|
|
1904
|
-
`${at}: storage: git \u8981\u5199 repo\uFF08repos \u91CC\u7684\u540D\u5B57\uFF09\u4E0E paths\uFF1B\u6CA1\u5199\u7684\u4EA7\u7269\u6CA1\u6709\u76EE\u6807\u4ED3\u5E93\
|
|
1906
|
+
`${at}: storage: git \u8981\u5199 repo\uFF08repos \u91CC\u7684\u540D\u5B57\uFF09\u4E0E paths\uFF1B\u6CA1\u5199\u7684\u4EA7\u7269\u6CA1\u6709\u76EE\u6807\u4ED3\u5E93\uFF0C\u4EE5\u540E\u7684\u534F\u8BAE\u5927\u7248\u672C\u4F1A\u6539\u6210\u62A5\u9519`
|
|
1905
1907
|
);
|
|
1906
1908
|
continue;
|
|
1907
1909
|
}
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
bundledDir,
|
|
6
6
|
renderDevModule,
|
|
7
7
|
resolveDevWorkshop
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-XPLYTHNX.js";
|
|
9
|
+
import "./chunk-LGYGWMSY.js";
|
|
10
10
|
|
|
11
11
|
// src/dev-server.ts
|
|
12
12
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -140,15 +140,30 @@ function upstreamKeyGuard(key) {
|
|
|
140
140
|
return {
|
|
141
141
|
name: "band-upstream-key",
|
|
142
142
|
configureServer(server) {
|
|
143
|
-
|
|
144
|
-
if (
|
|
143
|
+
const deny = (req, res) => {
|
|
144
|
+
if (req.method === "GET" && req.url === "/") {
|
|
145
|
+
res.statusCode = 204;
|
|
146
|
+
res.setHeader("Cache-Control", "no-store");
|
|
147
|
+
res.end();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
145
150
|
res.statusCode = 403;
|
|
146
151
|
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
147
152
|
res.end("Forbidden");
|
|
153
|
+
};
|
|
154
|
+
server.middlewares.use((req, res, next) => {
|
|
155
|
+
if (upstreamKeyMatches(req.headers[UPSTREAM_KEY_HEADER], key)) return next();
|
|
156
|
+
deny(req, res);
|
|
148
157
|
});
|
|
149
158
|
const http = server.httpServer;
|
|
150
159
|
if (!http) return;
|
|
151
160
|
const original = http.listeners("upgrade");
|
|
161
|
+
const originalRequest = http.listeners("request");
|
|
162
|
+
http.removeAllListeners("request");
|
|
163
|
+
http.on("request", (req, res) => {
|
|
164
|
+
if (!upstreamKeyMatches(req.headers[UPSTREAM_KEY_HEADER], key)) return deny(req, res);
|
|
165
|
+
for (const listener of originalRequest) listener.call(http, req, res);
|
|
166
|
+
});
|
|
152
167
|
http.removeAllListeners("upgrade");
|
|
153
168
|
http.on("upgrade", (req, socket, head) => {
|
|
154
169
|
if (!upstreamKeyMatches(req.headers[UPSTREAM_KEY_HEADER], key)) return reject(socket);
|
|
@@ -179,9 +194,21 @@ function heartbeatPlugin(ms) {
|
|
|
179
194
|
function bandDevPlugin(root, initial) {
|
|
180
195
|
let ws = initial;
|
|
181
196
|
let server;
|
|
197
|
+
const seenPackageJsons = /* @__PURE__ */ new Set();
|
|
198
|
+
const pluginPackageJsons = () => {
|
|
199
|
+
for (const p of ws.plugins) seenPackageJsons.add(join(dirname(p.manifestPath), "package.json"));
|
|
200
|
+
for (const path of seenPackageJsons)
|
|
201
|
+
if (!existsSync(path)) {
|
|
202
|
+
seenPackageJsons.delete(path);
|
|
203
|
+
server?.watcher.unwatch(path);
|
|
204
|
+
}
|
|
205
|
+
return [...seenPackageJsons];
|
|
206
|
+
};
|
|
207
|
+
const isViewPackageJson = (file) => /[\\/]band[\\/]views[\\/][^\\/]+[\\/]package\.json$/.test(file);
|
|
182
208
|
const yamls = () => [
|
|
183
209
|
ws.workshopPath,
|
|
184
210
|
...ws.plugins.map((p) => p.manifestPath),
|
|
211
|
+
...pluginPackageJsons(),
|
|
185
212
|
...ws.paramsPaths
|
|
186
213
|
];
|
|
187
214
|
return {
|
|
@@ -200,7 +227,8 @@ function bandDevPlugin(root, initial) {
|
|
|
200
227
|
s.watcher.add(yamls());
|
|
201
228
|
s.watcher.on("all", (_event, file) => {
|
|
202
229
|
if (!file.startsWith(root)) return;
|
|
203
|
-
if (!file.endsWith(".yaml") && !ws.paramsPaths.includes(file))
|
|
230
|
+
if (!file.endsWith(".yaml") && !ws.paramsPaths.includes(file) && !pluginPackageJsons().includes(file) && !isViewPackageJson(file))
|
|
231
|
+
return;
|
|
204
232
|
const mod = s.moduleGraph.getModuleById(RESOLVED);
|
|
205
233
|
if (mod) s.moduleGraph.invalidateModule(mod);
|
|
206
234
|
s.ws.send({ type: "full-reload" });
|
package/dist/fixture.d.ts
CHANGED
|
@@ -43,6 +43,17 @@ interface FixtureData {
|
|
|
43
43
|
stages?: StageRunSummary[];
|
|
44
44
|
gates?: GateState[];
|
|
45
45
|
members?: MemberView[];
|
|
46
|
+
/**
|
|
47
|
+
* 项目创建人的用户 id(服务端里创建人就是 owner 角色,天然是管理员)。缺省没有创建人:不从起始身份推,
|
|
48
|
+
* 否则 `band dev` 这类固定身份的宿主里任何角色都会被当成管理员。`apps/web` 的 `kernelData()` 传
|
|
49
|
+
* `project.createdBy`,`band dev` 的 dev-host 按 `?role=` 传 `managers`,各自传。
|
|
50
|
+
*/
|
|
51
|
+
createdBy?: string;
|
|
52
|
+
/**
|
|
53
|
+
* 创建人之外的项目管理员(服务端 `members.role` 是 maintainer 的人;dev-host 里按角色参数决定)。
|
|
54
|
+
* `MemberView.roles` 是业务标签,不是管理角色,不参与。缺省没有管理员。
|
|
55
|
+
*/
|
|
56
|
+
managers?: string[];
|
|
46
57
|
/** 初始回合状态;缺省没有回合、队列为空。 */
|
|
47
58
|
turn?: TurnState;
|
|
48
59
|
/** 产物列表;缺省按版本里出现过的 artifactId 生成(名字即 id)。 */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as WorkshopRepo, R as ResolvedPlugin, S as SkippedPlugin } from './workshop-repo-
|
|
2
|
-
export { W as WORKSHOP_FORBIDDEN_IMPORTS, d as WorkshopRepoError, c as checkPlugin, a as checkPluginSources, p as pluginName, r as readPlugin, e as readProfileLocked, f as resolveOfficialPlugins, g as resolveWorkshopRepo } from './workshop-repo-
|
|
1
|
+
import { b as WorkshopRepo, R as ResolvedPlugin, S as SkippedPlugin } from './workshop-repo-DqoVdcGu.js';
|
|
2
|
+
export { W as WORKSHOP_FORBIDDEN_IMPORTS, d as WorkshopRepoError, c as checkPlugin, a as checkPluginSources, p as pluginName, r as readPlugin, e as readProfileLocked, f as resolveOfficialPlugins, g as resolveWorkshopRepo } from './workshop-repo-DqoVdcGu.js';
|
|
3
3
|
import { LockedRole, StageRunSummary, GateState } from '@kanyun-ai-infra/band-plugin-sdk';
|
|
4
4
|
import { PluginEntry } from './plugin-entry.js';
|
|
5
5
|
import '@kanyun-ai-infra/band-contracts';
|
|
@@ -33,6 +33,8 @@ interface NewPluginRepoOptions {
|
|
|
33
33
|
stage?: string;
|
|
34
34
|
/** 界面上的标题,缺省用插件名。 */
|
|
35
35
|
title?: string;
|
|
36
|
+
/** 用 React 写:入口是 `src/index.tsx`,package.json 带 React 与 `band-plugin-react` 的开发依赖,tsconfig 开 JSX。 */
|
|
37
|
+
react?: boolean;
|
|
36
38
|
}
|
|
37
39
|
interface NewPluginRepoResult {
|
|
38
40
|
/** 仓库目录(`<父目录>/<名>`)。 */
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
officialPluginCatalog,
|
|
11
11
|
renderOfficialCatalog,
|
|
12
12
|
writeOfficialCatalog
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-FGPWXAOA.js";
|
|
14
14
|
import "./chunk-CL3FV65M.js";
|
|
15
15
|
import {
|
|
16
16
|
DevSetupError,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
renderDevModule,
|
|
19
19
|
resolveDevWorkshop,
|
|
20
20
|
resolvePluginRepo
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-XPLYTHNX.js";
|
|
22
22
|
import {
|
|
23
23
|
WORKSHOP_FORBIDDEN_IMPORTS,
|
|
24
24
|
WorkshopRepoError,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
readProfileLocked,
|
|
30
30
|
resolveOfficialPlugins,
|
|
31
31
|
resolveWorkshopRepo
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-LGYGWMSY.js";
|
|
33
33
|
export {
|
|
34
34
|
DevSetupError,
|
|
35
35
|
NewPluginError,
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LockedRole } from '@kanyun-ai-infra/band-plugin-sdk';
|
|
2
2
|
import { Plugin } from 'vite';
|
|
3
|
-
import { b as WorkshopRepo, R as ResolvedPlugin, S as SkippedPlugin } from './workshop-repo-
|
|
3
|
+
import { b as WorkshopRepo, R as ResolvedPlugin, S as SkippedPlugin } from './workshop-repo-DqoVdcGu.js';
|
|
4
4
|
import '@kanyun-ai-infra/band-contracts';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
package/dist/vite.js
CHANGED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
officialPluginsDir,
|
|
6
6
|
officialProfilePath
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XPLYTHNX.js";
|
|
8
8
|
import {
|
|
9
9
|
readProfileLocked,
|
|
10
10
|
resolveOfficialPlugins,
|
|
11
11
|
resolveWorkshopRepo
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LGYGWMSY.js";
|
|
13
13
|
|
|
14
14
|
// src/vite.ts
|
|
15
15
|
import { existsSync } from "fs";
|
|
@@ -37,9 +37,9 @@ interface PayloadSchema {
|
|
|
37
37
|
}
|
|
38
38
|
declare const StageSchema: z.ZodObject<{
|
|
39
39
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
40
|
-
human: "human";
|
|
41
40
|
external: "external";
|
|
42
41
|
agent: "agent";
|
|
42
|
+
human: "human";
|
|
43
43
|
job: "job";
|
|
44
44
|
workflow: "workflow";
|
|
45
45
|
}>>;
|
|
@@ -194,13 +194,13 @@ declare const WorkshopSchema: z.ZodObject<{
|
|
|
194
194
|
}>>>;
|
|
195
195
|
connectors: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
196
196
|
scope: z.ZodEnum<{
|
|
197
|
-
workshop: "workshop";
|
|
198
197
|
personal: "personal";
|
|
198
|
+
workshop: "workshop";
|
|
199
199
|
deployment: "deployment";
|
|
200
200
|
}>;
|
|
201
201
|
inTurn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
202
202
|
}, z.core.$strict>>, Record<string, {
|
|
203
|
-
scope: "
|
|
203
|
+
scope: "personal" | "workshop" | "deployment";
|
|
204
204
|
inTurn?: string[] | undefined;
|
|
205
205
|
}>>>;
|
|
206
206
|
overrides: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>>>;
|
|
@@ -264,9 +264,9 @@ declare const WorkshopSchema: z.ZodObject<{
|
|
|
264
264
|
workflows: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
265
265
|
stages: z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
266
266
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
267
|
-
human: "human";
|
|
268
267
|
external: "external";
|
|
269
268
|
agent: "agent";
|
|
269
|
+
human: "human";
|
|
270
270
|
job: "job";
|
|
271
271
|
workflow: "workflow";
|
|
272
272
|
}>>;
|
|
@@ -517,13 +517,13 @@ declare const WorkshopSchema: z.ZodObject<{
|
|
|
517
517
|
surfaces: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>, Record<string, string[]>>>;
|
|
518
518
|
statusLabels: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodEnum<{
|
|
519
519
|
failed: "failed";
|
|
520
|
-
ready: "ready";
|
|
521
|
-
approved: "approved";
|
|
522
|
-
stale: "stale";
|
|
523
520
|
blocked: "blocked";
|
|
521
|
+
ready: "ready";
|
|
524
522
|
in_progress: "in_progress";
|
|
525
523
|
in_review: "in_review";
|
|
526
|
-
|
|
524
|
+
approved: "approved";
|
|
525
|
+
stale: "stale";
|
|
526
|
+
}> & z.core.$partial, z.ZodString>, Partial<Record<"failed" | "blocked" | "ready" | "in_progress" | "in_review" | "approved" | "stale", string>>>>;
|
|
527
527
|
}, z.core.$strict>>;
|
|
528
528
|
}, z.core.$strict>;
|
|
529
529
|
type WorkshopDef = z.infer<typeof WorkshopSchema>;
|
|
@@ -600,7 +600,7 @@ interface CompiledWorkshop {
|
|
|
600
600
|
agents: Record<string, CompiledAgent>;
|
|
601
601
|
/** 进行中的流程实例钉住这个哈希;新版工坊只影响新项目。 */
|
|
602
602
|
workshopHash: string;
|
|
603
|
-
/**
|
|
603
|
+
/** 当前仍接受、以后的协议大版本会改成报错的写法;`band check` 原样打印,不算失败。 */
|
|
604
604
|
warnings: string[];
|
|
605
605
|
}
|
|
606
606
|
interface CompileOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanyun-ai-infra/band-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "band 命令行:新建、本地调试、校验与发布 Band 工坊和插件",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"./build": {
|
|
17
17
|
"types": "./dist/build-plugin.d.ts",
|
|
18
|
-
"import": "./dist/build-plugin.js"
|
|
18
|
+
"import": "./dist/build-plugin.js",
|
|
19
|
+
"default": "./dist/build-plugin.js"
|
|
19
20
|
},
|
|
20
21
|
"./catalog": {
|
|
21
22
|
"types": "./dist/plugin-entry.d.ts",
|
|
@@ -33,6 +34,8 @@
|
|
|
33
34
|
"files": [
|
|
34
35
|
"dist",
|
|
35
36
|
"dev-host",
|
|
37
|
+
"src/dev-managers.ts",
|
|
38
|
+
"src/inspector-default.ts",
|
|
36
39
|
"src/inspector-plugins.ts",
|
|
37
40
|
"src/load-plugins.ts",
|
|
38
41
|
"bundled"
|
|
@@ -41,12 +44,12 @@
|
|
|
41
44
|
"node": ">=22.19"
|
|
42
45
|
},
|
|
43
46
|
"dependencies": {
|
|
44
|
-
"@kanyun-ai-infra/band-contracts": "^0.1.
|
|
45
|
-
"@kanyun-ai-infra/band-plugin-react": "^0.1
|
|
46
|
-
"@kanyun-ai-infra/band-plugin-sdk": "^1.
|
|
47
|
+
"@kanyun-ai-infra/band-contracts": "^0.1.4",
|
|
48
|
+
"@kanyun-ai-infra/band-plugin-react": "^0.2.1",
|
|
49
|
+
"@kanyun-ai-infra/band-plugin-sdk": "^2.1.0",
|
|
47
50
|
"es-module-lexer": "^2.3.2",
|
|
48
|
-
"react": "^
|
|
49
|
-
"react-dom": "^
|
|
51
|
+
"react": "^19.3.1",
|
|
52
|
+
"react-dom": "^19.3.1",
|
|
50
53
|
"semver": "^7.8.5",
|
|
51
54
|
"vite": "^6.0.7",
|
|
52
55
|
"yaml": "^2.6.1",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* band dev 的 dev-host 里谁算项目管理员(夹具 `FixtureData.managers`)。
|
|
3
|
+
*
|
|
4
|
+
* 与线上同构:只有 owner / maintainer 管项目。不带 `?role=`(或角色不在工坊里)是默认开发身份,按管理员看;
|
|
5
|
+
* 选了工坊里的业务角色(`?role=teacher` 这类)就是非管理员,预览得到非管理员视图。业务角色不是管理角色。
|
|
6
|
+
* 不从起始身份推创建人:dev-host 的身份恒为 `dev`,推出来会让任何角色都变成管理员。
|
|
7
|
+
*/
|
|
8
|
+
export function devManagers(
|
|
9
|
+
roleParam: string | null,
|
|
10
|
+
workshopRoles: readonly string[],
|
|
11
|
+
memberId: string,
|
|
12
|
+
): string[] {
|
|
13
|
+
const picked = roleParam !== null && workshopRoles.includes(roleParam);
|
|
14
|
+
const manages = !picked || roleParam === "owner" || roleParam === "maintainer";
|
|
15
|
+
return manages ? [memberId] : [];
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `band dev` 右边「夹具」栏默认展开的最小视口宽度(像素):不到这个宽度项目页的右栏会被夹具栏挤得显示不全,
|
|
3
|
+
* 默认收起,作者点「夹具」按钮展开。quickstart 写的「不到 1600 像素右栏显示不全」是同一个数。
|
|
4
|
+
*/
|
|
5
|
+
export const INSPECTOR_OPEN_MIN_WIDTH = 1600;
|
|
6
|
+
|
|
7
|
+
export function inspectorOpenByDefault(viewportWidth: number): boolean {
|
|
8
|
+
return viewportWidth >= INSPECTOR_OPEN_MIN_WIDTH;
|
|
9
|
+
}
|