@dazitech/cli 3.0.5 → 3.0.6
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 +1 -1
- package/dist/clis/dazi-app.js +16 -13
- package/dist/clis/dazi-flow.js +6 -5
- package/dist/clis/dazi-onto.js +7 -6
- package/dist/clis/dazi.js +9 -8
- package/dist/docs/flow/flow-project-guide.md +1 -1
- package/dist/docs/guides/troubleshooting.md +1 -1
- package/dist/docs/index.json +1 -1
- package/dist/examples/index.json +1 -1
- package/dist/prompts/index.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/clis/dazi-app.js
CHANGED
|
@@ -3057,7 +3057,7 @@ function fromLegacyAuthFile() {
|
|
|
3057
3057
|
}
|
|
3058
3058
|
return null;
|
|
3059
3059
|
}
|
|
3060
|
-
function
|
|
3060
|
+
function loadAuth2() {
|
|
3061
3061
|
return fromV3AuthFile() ?? fromLegacyAuthFile();
|
|
3062
3062
|
}
|
|
3063
3063
|
function saveAuth(cfg) {
|
|
@@ -12827,7 +12827,7 @@ __export(templateRemote_exports, {
|
|
|
12827
12827
|
fetchRemoteTemplateToDir: () => fetchRemoteTemplateToDir
|
|
12828
12828
|
});
|
|
12829
12829
|
async function fetchTemplateBodyZip(templateId, version) {
|
|
12830
|
-
const auth =
|
|
12830
|
+
const auth = loadAuth2();
|
|
12831
12831
|
if (!auth?.accessToken) {
|
|
12832
12832
|
throw new Error("\u8BF7\u5148 dazi-app auth login\uFF08\u62C9\u53D6\u670D\u52A1\u7AEF\u6B63\u6587\u9700\u8981\u767B\u5F55\uFF09");
|
|
12833
12833
|
}
|
|
@@ -13076,10 +13076,13 @@ var {
|
|
|
13076
13076
|
Help
|
|
13077
13077
|
} = import_index.default;
|
|
13078
13078
|
|
|
13079
|
+
// cli/shared/src/version.ts
|
|
13080
|
+
var DAZI_VERSION = true ? "3.0.6" : readDevVersion();
|
|
13081
|
+
|
|
13079
13082
|
// cli/dazi-app/src/lib/httpClient.ts
|
|
13080
13083
|
init_config();
|
|
13081
13084
|
async function apiRequest(method, path31, opts) {
|
|
13082
|
-
const auth =
|
|
13085
|
+
const auth = loadAuth2();
|
|
13083
13086
|
const base = (opts?.baseUrl || auth?.baseUrl || "http://localhost:8001/api").replace(
|
|
13084
13087
|
/\/$/,
|
|
13085
13088
|
""
|
|
@@ -14622,7 +14625,7 @@ function collectSourceSnapshot(cwd) {
|
|
|
14622
14625
|
// cli/dazi-app/src/commands/upload.ts
|
|
14623
14626
|
function registerUpload(program3) {
|
|
14624
14627
|
program3.command("upload").description("\u6253\u5305\u5E76\u4E0A\u4F20\u5230 Registry\uFF08\u65E0 app \u5219\u5148 create\uFF09").option("--cwd <dir>", "DRAP \u9879\u76EE\u76EE\u5F55\uFF08\u9ED8\u8BA4\u81EA\u52A8\u8BC6\u522B\uFF1Ashell \u76EE\u5F55\u6216\u542B manifest.json \u7684\u7956\u5148\uFF09").option("--space <id>", "\u6570\u636E\u7A7A\u95F4 id\uFF08\u5FC5\u586B\uFF0C\u9996\u6B21 create\uFF09").option("--activate", "\u4E0A\u4F20\u540E\u6FC0\u6D3B", false).option("--changelog <text>", "\u53D8\u66F4\u8BF4\u660E").option("--file <path>", "\u5DF2\u6709 .dazi-app\uFF0C\u8DF3\u8FC7 package").option("--skip-validate", "\u8DF3\u8FC7 manifest \u6821\u9A8C\uFF08\u4E0D\u63A8\u8350\uFF09").option("--no-source", "\u4E0D\u4E0A\u4F20\u6E90\u7801\u5FEB\u7167\uFF08\u9ED8\u8BA4\u4E0A\u4F20\uFF0C\u4F9B release \u8F6C\u6A21\u677F\uFF09").option("--json").action(async (opts) => {
|
|
14625
|
-
if (!
|
|
14628
|
+
if (!loadAuth2()) throw new Error("\u8BF7\u5148 dazi-app auth login");
|
|
14626
14629
|
const cwd = requireProjectCwd(opts.cwd);
|
|
14627
14630
|
const manifestEarly = JSON.parse(
|
|
14628
14631
|
import_node_fs13.default.readFileSync(import_node_path12.default.join(cwd, "manifest.json"), "utf8")
|
|
@@ -14740,7 +14743,7 @@ function readAppId(explicitCwd) {
|
|
|
14740
14743
|
}
|
|
14741
14744
|
function attachReleaseCommands(rel) {
|
|
14742
14745
|
rel.command("list").option("--cwd <dir>", "DRAP \u9879\u76EE\u76EE\u5F55\uFF08\u9ED8\u8BA4\u8BC6\u522B shell \u76EE\u5F55\uFF09").option("--json").action(async (opts) => {
|
|
14743
|
-
if (!
|
|
14746
|
+
if (!loadAuth2()) throw new Error("\u8BF7\u5148\u767B\u5F55");
|
|
14744
14747
|
const appId = readAppId(opts.cwd);
|
|
14745
14748
|
const out = await apiRequest(
|
|
14746
14749
|
"GET",
|
|
@@ -14749,7 +14752,7 @@ function attachReleaseCommands(rel) {
|
|
|
14749
14752
|
printJsonSummary({ ok: true, app_id: appId, ...out }, !!opts.json);
|
|
14750
14753
|
});
|
|
14751
14754
|
rel.command("activate").argument("<semver>", "\u7248\u672C\u53F7").option("--cwd <dir>", "DRAP \u9879\u76EE\u76EE\u5F55\uFF08\u9ED8\u8BA4\u8BC6\u522B shell \u76EE\u5F55\uFF09").option("--json").action(async (semver, opts) => {
|
|
14752
|
-
if (!
|
|
14755
|
+
if (!loadAuth2()) throw new Error("\u8BF7\u5148\u767B\u5F55");
|
|
14753
14756
|
const appId = readAppId(opts.cwd);
|
|
14754
14757
|
const listed = await apiRequest(
|
|
14755
14758
|
"GET",
|
|
@@ -14764,7 +14767,7 @@ function attachReleaseCommands(rel) {
|
|
|
14764
14767
|
printJsonSummary({ ok: true, activated }, !!opts.json);
|
|
14765
14768
|
});
|
|
14766
14769
|
rel.command("revoke").argument("<semver>", "\u7248\u672C\u53F7").option("--cwd <dir>", "DRAP \u9879\u76EE\u76EE\u5F55\uFF08\u9ED8\u8BA4\u8BC6\u522B shell \u76EE\u5F55\uFF09").option("--json").action(async (semver, opts) => {
|
|
14767
|
-
if (!
|
|
14770
|
+
if (!loadAuth2()) throw new Error("\u8BF7\u5148\u767B\u5F55");
|
|
14768
14771
|
const appId = readAppId(opts.cwd);
|
|
14769
14772
|
const listed = await apiRequest(
|
|
14770
14773
|
"GET",
|
|
@@ -14857,7 +14860,7 @@ function registerTemplates(program3) {
|
|
|
14857
14860
|
source_ref: t.dirName
|
|
14858
14861
|
}));
|
|
14859
14862
|
let remote = [];
|
|
14860
|
-
if (opts.remote &&
|
|
14863
|
+
if (opts.remote && loadAuth2()) {
|
|
14861
14864
|
try {
|
|
14862
14865
|
const out = await apiRequest("GET", "/runtime-apps/templates");
|
|
14863
14866
|
remote = (out.items || []).map((r) => ({
|
|
@@ -14887,7 +14890,7 @@ function registerTemplates(program3) {
|
|
|
14887
14890
|
printJsonSummary({ ok: true, items: merged, total: merged.length }, !!opts.json);
|
|
14888
14891
|
});
|
|
14889
14892
|
tpl.command("from-release").description("\u4ECE Registry release \u6E90\u7801\u5FEB\u7167\u521B\u5EFA\u52A8\u6001\u5E94\u7528\u6A21\u677F\uFF08\u670D\u52A1\u7AEF\u5B58\u50A8\uFF09").requiredOption("--id <template_id>", "\u65B0\u6A21\u677F id\uFF08\u5C0F\u5199\u8FDE\u5B57\u7B26\uFF09").requiredOption("--name <n>", "\u6A21\u677F\u663E\u793A\u540D\u79F0").option("--release-id <id>", "\u6307\u5B9A release id\uFF08\u9ED8\u8BA4\u7528 app \u6FC0\u6D3B\u7248\u672C\uFF09").option("--app-id <id>", "\u5E94\u7528 id\uFF08\u4E0E --release-id \u4E8C\u9009\u4E00\uFF09").option("--category <c>", "\u5206\u7C7B\uFF1A\u5206\u6790 / \u7BA1\u7406 / \u76D1\u63A7 / \u804A\u5929").option("--scene-tag <t>", "\u573A\u666F tag").option("--description <d>", "\u7B80\u4ECB").option("--version <v>", "\u6A21\u677F\u7248\u672C", "0.1.0").option("--json").action(async (opts) => {
|
|
14890
|
-
if (!
|
|
14893
|
+
if (!loadAuth2()) throw new Error("\u8BF7\u5148 dazi-app auth login");
|
|
14891
14894
|
if (!opts.releaseId && !opts.appId) {
|
|
14892
14895
|
throw new Error("\u8BF7\u63D0\u4F9B --release-id \u6216 --app-id");
|
|
14893
14896
|
}
|
|
@@ -15546,7 +15549,7 @@ function registerInit(program3) {
|
|
|
15546
15549
|
init_config();
|
|
15547
15550
|
function registerWhoami(program3) {
|
|
15548
15551
|
program3.command("whoami").description("\u5F53\u524D\u767B\u5F55\u7528\u6237\u4E0E API \u57FA\u5740").option("--json").action(async (opts) => {
|
|
15549
|
-
const auth =
|
|
15552
|
+
const auth = loadAuth2();
|
|
15550
15553
|
if (!auth?.accessToken) {
|
|
15551
15554
|
throw new Error("\u672A\u767B\u5F55\uFF0C\u8BF7\u5148 dazi-app auth login");
|
|
15552
15555
|
}
|
|
@@ -15933,7 +15936,7 @@ var import_node_path27 = __toESM(require("node:path"), 1);
|
|
|
15933
15936
|
init_config();
|
|
15934
15937
|
function runDoctor(cwd) {
|
|
15935
15938
|
const checks = [];
|
|
15936
|
-
const auth =
|
|
15939
|
+
const auth = loadAuth2();
|
|
15937
15940
|
if (auth) {
|
|
15938
15941
|
checks.push({
|
|
15939
15942
|
id: "auth",
|
|
@@ -16222,7 +16225,7 @@ async function postPreview(kind, body) {
|
|
|
16222
16225
|
return res.dataset;
|
|
16223
16226
|
}
|
|
16224
16227
|
async function runInlinePreview(opts) {
|
|
16225
|
-
if (!
|
|
16228
|
+
if (!loadAuth2()) {
|
|
16226
16229
|
throw new Error("\u8BF7\u5148 dazi-app auth login");
|
|
16227
16230
|
}
|
|
16228
16231
|
const { text, sizeBytes } = readInlineAssetFile(opts.appDir, opts.decl.source);
|
|
@@ -16753,7 +16756,7 @@ function registerLegacyCompatCommands(program3) {
|
|
|
16753
16756
|
var program2 = new Command();
|
|
16754
16757
|
program2.name("dazi-app").description(
|
|
16755
16758
|
"\u642D\u5B50 App CLI \u2014 DRAP \u524D\u7AEF\u5E94\u7528\uFF08manifest / build / upload / preview\uFF09"
|
|
16756
|
-
).version(
|
|
16759
|
+
).version(DAZI_VERSION, "-v, --version");
|
|
16757
16760
|
registerAuth(program2);
|
|
16758
16761
|
registerBuild(program2);
|
|
16759
16762
|
registerDev(program2);
|
package/dist/clis/dazi-flow.js
CHANGED
|
@@ -4783,10 +4783,6 @@ var {
|
|
|
4783
4783
|
Help
|
|
4784
4784
|
} = import_index.default;
|
|
4785
4785
|
|
|
4786
|
-
// cli/dazi-flow/src/commands/flows.ts
|
|
4787
|
-
var import_path3 = __toESM(require("path"), 1);
|
|
4788
|
-
var import_fs2 = __toESM(require("fs"), 1);
|
|
4789
|
-
|
|
4790
4786
|
// cli/shared/src/auth.js
|
|
4791
4787
|
var import_os = __toESM(require("os"), 1);
|
|
4792
4788
|
var import_path = __toESM(require("path"), 1);
|
|
@@ -4966,7 +4962,12 @@ function resolveWorkspace(cwd = process.cwd()) {
|
|
|
4966
4962
|
};
|
|
4967
4963
|
}
|
|
4968
4964
|
|
|
4965
|
+
// cli/shared/src/version.ts
|
|
4966
|
+
var DAZI_VERSION = true ? "3.0.6" : readDevVersion();
|
|
4967
|
+
|
|
4969
4968
|
// cli/dazi-flow/src/commands/flows.ts
|
|
4969
|
+
var import_path3 = __toESM(require("path"), 1);
|
|
4970
|
+
var import_fs2 = __toESM(require("fs"), 1);
|
|
4970
4971
|
function makeFlowsCommand() {
|
|
4971
4972
|
const cmd = new Command("flows").description("Flow \u7BA1\u7406");
|
|
4972
4973
|
cmd.command("list").description("\u5217\u51FA\u6240\u6709 Flow").option("--space <spaceId>", "\u8FC7\u6EE4\u7A7A\u95F4").option("--status <status>", "\u8FC7\u6EE4\u72B6\u6001\uFF08active/draft/archived\uFF09").option("--json", "\u8F93\u51FA JSON").action(async (opts) => {
|
|
@@ -7237,7 +7238,7 @@ function makeManagedFilesCommand() {
|
|
|
7237
7238
|
|
|
7238
7239
|
// cli/dazi-flow/src/index.ts
|
|
7239
7240
|
var program2 = new Command();
|
|
7240
|
-
program2.name("dazi-flow").description("\u642D\u5B50 Flow CLI \u2014 \u5DE5\u4F5C\u6D41\u7BA1\u7406").version(
|
|
7241
|
+
program2.name("dazi-flow").description("\u642D\u5B50 Flow CLI \u2014 \u5DE5\u4F5C\u6D41\u7BA1\u7406").version(DAZI_VERSION, "-v, --version");
|
|
7241
7242
|
program2.addCommand(makeFlowsCommand());
|
|
7242
7243
|
program2.addCommand(makeSnapshotCommand());
|
|
7243
7244
|
program2.addCommand(makeProjectCommand());
|
package/dist/clis/dazi-onto.js
CHANGED
|
@@ -3036,10 +3036,6 @@ var {
|
|
|
3036
3036
|
Help
|
|
3037
3037
|
} = import_index.default;
|
|
3038
3038
|
|
|
3039
|
-
// cli/dazi-onto/src/commands/space.ts
|
|
3040
|
-
var import_path3 = __toESM(require("path"), 1);
|
|
3041
|
-
var import_fs2 = __toESM(require("fs"), 1);
|
|
3042
|
-
|
|
3043
3039
|
// cli/shared/src/auth.js
|
|
3044
3040
|
var import_os = __toESM(require("os"), 1);
|
|
3045
3041
|
var import_path = __toESM(require("path"), 1);
|
|
@@ -3219,7 +3215,12 @@ function resolveWorkspace(cwd = process.cwd()) {
|
|
|
3219
3215
|
};
|
|
3220
3216
|
}
|
|
3221
3217
|
|
|
3218
|
+
// cli/shared/src/version.ts
|
|
3219
|
+
var DAZI_VERSION = true ? "3.0.6" : readDevVersion();
|
|
3220
|
+
|
|
3222
3221
|
// cli/dazi-onto/src/commands/space.ts
|
|
3222
|
+
var import_path3 = __toESM(require("path"), 1);
|
|
3223
|
+
var import_fs2 = __toESM(require("fs"), 1);
|
|
3223
3224
|
function makeSpaceCommand() {
|
|
3224
3225
|
const cmd = new Command("space").description("\u5DE5\u4F5C\u7A7A\u95F4\u7BA1\u7406");
|
|
3225
3226
|
cmd.command("list").description("\u5217\u51FA\u6240\u6709\u7A7A\u95F4").option("--json", "\u8F93\u51FA JSON").action(async (opts) => {
|
|
@@ -3978,7 +3979,7 @@ function makeMcpCommand() {
|
|
|
3978
3979
|
result: {
|
|
3979
3980
|
protocolVersion: "2024-11-05",
|
|
3980
3981
|
capabilities: { tools: {} },
|
|
3981
|
-
serverInfo: { name: "dazi-onto", version:
|
|
3982
|
+
serverInfo: { name: "dazi-onto", version: DAZI_VERSION }
|
|
3982
3983
|
}
|
|
3983
3984
|
};
|
|
3984
3985
|
process.stdout.write(JSON.stringify(response) + "\n");
|
|
@@ -4001,7 +4002,7 @@ function makeMcpCommand() {
|
|
|
4001
4002
|
|
|
4002
4003
|
// cli/dazi-onto/src/index.ts
|
|
4003
4004
|
var program2 = new Command();
|
|
4004
|
-
program2.name("dazi-onto").description("\u642D\u5B50 Onto CLI \u2014 \u672C\u4F53\uFF08Ontology\uFF09\u7BA1\u7406").version(
|
|
4005
|
+
program2.name("dazi-onto").description("\u642D\u5B50 Onto CLI \u2014 \u672C\u4F53\uFF08Ontology\uFF09\u7BA1\u7406").version(DAZI_VERSION, "-v, --version");
|
|
4005
4006
|
program2.addCommand(makeSpaceCommand());
|
|
4006
4007
|
program2.addCommand(makeFunctionCommand());
|
|
4007
4008
|
program2.addCommand(makeActionCommand());
|
package/dist/clis/dazi.js
CHANGED
|
@@ -3633,11 +3633,6 @@ var {
|
|
|
3633
3633
|
Help
|
|
3634
3634
|
} = import_index.default;
|
|
3635
3635
|
|
|
3636
|
-
// cli/dazi/src/commands/auth.ts
|
|
3637
|
-
var import_os3 = __toESM(require("os"), 1);
|
|
3638
|
-
var import_path4 = __toESM(require("path"), 1);
|
|
3639
|
-
var import_fs3 = __toESM(require("fs"), 1);
|
|
3640
|
-
|
|
3641
3636
|
// cli/shared/src/auth.js
|
|
3642
3637
|
var import_os = __toESM(require("os"), 1);
|
|
3643
3638
|
var import_path = __toESM(require("path"), 1);
|
|
@@ -3856,7 +3851,13 @@ function resolveWorkspace(cwd = process.cwd()) {
|
|
|
3856
3851
|
};
|
|
3857
3852
|
}
|
|
3858
3853
|
|
|
3854
|
+
// cli/shared/src/version.ts
|
|
3855
|
+
var DAZI_VERSION = true ? "3.0.6" : readDevVersion();
|
|
3856
|
+
|
|
3859
3857
|
// cli/dazi/src/commands/auth.ts
|
|
3858
|
+
var import_os3 = __toESM(require("os"), 1);
|
|
3859
|
+
var import_path4 = __toESM(require("path"), 1);
|
|
3860
|
+
var import_fs3 = __toESM(require("fs"), 1);
|
|
3860
3861
|
function makeAuthCommand() {
|
|
3861
3862
|
const cmd = new Command("auth").description("\u8D26\u53F7\u8BA4\u8BC1");
|
|
3862
3863
|
cmd.command("login").description("\u767B\u5F55\u642D\u5B50\u5E73\u53F0").option("-s, --server <url>", "\u5E73\u53F0\u5730\u5740", getServerUrl()).option("--token <token>", "\u76F4\u63A5\u4F7F\u7528 token \u767B\u5F55\uFF08CI / Token \u6A21\u5F0F\uFF09").option("-u, --username <username>", "\u7528\u6237\u540D\u6216\u90AE\u7BB1\uFF08\u8D26\u53F7\u5BC6\u7801\u6A21\u5F0F\uFF09").option("-p, --password <password>", "\u5BC6\u7801\uFF08\u8D26\u53F7\u5BC6\u7801\u6A21\u5F0F\uFF09").action(async (opts) => {
|
|
@@ -4024,7 +4025,7 @@ function makeEnvCommand() {
|
|
|
4024
4025
|
return new Command("env").description("\u663E\u793A\u73AF\u5883\u4FE1\u606F").action(() => {
|
|
4025
4026
|
const auth = tryLoadAuth();
|
|
4026
4027
|
const env = {
|
|
4027
|
-
version:
|
|
4028
|
+
version: DAZI_VERSION,
|
|
4028
4029
|
node: process.version,
|
|
4029
4030
|
platform: `${import_os5.default.type()} ${import_os5.default.arch()}`,
|
|
4030
4031
|
serverUrl: getServerUrl(),
|
|
@@ -5694,7 +5695,7 @@ function dispatch(msg) {
|
|
|
5694
5695
|
result: {
|
|
5695
5696
|
protocolVersion: "2024-11-05",
|
|
5696
5697
|
capabilities: { tools: {} },
|
|
5697
|
-
serverInfo: { name: "dazi", version:
|
|
5698
|
+
serverInfo: { name: "dazi", version: DAZI_VERSION }
|
|
5698
5699
|
}
|
|
5699
5700
|
};
|
|
5700
5701
|
case "initialized":
|
|
@@ -5817,7 +5818,7 @@ function forwardToCli(cliName, extraArgs) {
|
|
|
5817
5818
|
process.exit(result.status ?? 1);
|
|
5818
5819
|
}
|
|
5819
5820
|
var program2 = new Command();
|
|
5820
|
-
program2.name("dazi").description("\u642D\u5B50 v3 \u2014 Onto / Flow / App \u7EDF\u4E00 CLI").version(
|
|
5821
|
+
program2.name("dazi").description("\u642D\u5B50 v3 \u2014 Onto / Flow / App \u7EDF\u4E00 CLI").version(DAZI_VERSION, "-v, --version");
|
|
5821
5822
|
program2.addCommand(makeAuthCommand());
|
|
5822
5823
|
program2.addCommand(makeDoctorCommand());
|
|
5823
5824
|
program2.addCommand(makeEnvCommand());
|
|
@@ -84,7 +84,7 @@ dazi doctor --workspace-root D:\path\to\dazi-work
|
|
|
84
84
|
检查 `.cursor/mcp.json` 配置。MCP 需能调用 bundled CLI,示例:
|
|
85
85
|
|
|
86
86
|
```powershell
|
|
87
|
-
$env:DAZI_BUNDLED_DIR = "$env:USERPROFILE\.cursor\extensions\dazitech.dazi-vscode-3.0.
|
|
87
|
+
$env:DAZI_BUNDLED_DIR = "$env:USERPROFILE\.cursor\extensions\dazitech.dazi-vscode-3.0.6\bundled\clis"
|
|
88
88
|
node "$env:DAZI_BUNDLED_DIR\dazi.js" mcp stdio
|
|
89
89
|
```
|
|
90
90
|
|
package/dist/docs/index.json
CHANGED
package/dist/examples/index.json
CHANGED
package/dist/prompts/index.json
CHANGED