@qingflow-tech/qingflow-cli 1.0.2 → 1.0.3
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 +2 -2
- package/docs/local-agent-install.md +9 -3
- package/npm/bin/qingflow.mjs +1 -1
- package/npm/lib/runtime.mjs +10 -3
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/src/qingflow_mcp/__init__.py +33 -1
- package/src/qingflow_mcp/builder_facade/models.py +14 -4
- package/src/qingflow_mcp/builder_facade/service.py +1582 -124
- package/src/qingflow_mcp/cli/commands/auth.py +63 -0
- package/src/qingflow_mcp/cli/commands/builder.py +4 -3
- package/src/qingflow_mcp/cli/commands/record.py +5 -5
- package/src/qingflow_mcp/cli/commands/task.py +74 -22
- package/src/qingflow_mcp/cli/commands/workspace.py +22 -0
- package/src/qingflow_mcp/cli/formatters.py +287 -48
- package/src/qingflow_mcp/cli/main.py +6 -1
- package/src/qingflow_mcp/cli/qingflow_login.py +116 -0
- package/src/qingflow_mcp/config.py +1 -1
- package/src/qingflow_mcp/errors.py +2 -2
- package/src/qingflow_mcp/id_utils.py +49 -0
- package/src/qingflow_mcp/public_surface.py +11 -1
- package/src/qingflow_mcp/response_trim.py +380 -9
- package/src/qingflow_mcp/server.py +4 -0
- package/src/qingflow_mcp/server_app_builder.py +11 -1
- package/src/qingflow_mcp/server_app_user.py +24 -0
- package/src/qingflow_mcp/session_store.py +69 -15
- package/src/qingflow_mcp/solution/compiler/form_compiler.py +2 -2
- package/src/qingflow_mcp/solution/executor.py +2 -2
- package/src/qingflow_mcp/tools/ai_builder_tools.py +48 -18
- package/src/qingflow_mcp/tools/app_tools.py +1 -0
- package/src/qingflow_mcp/tools/auth_tools.py +217 -9
- package/src/qingflow_mcp/tools/base.py +6 -2
- package/src/qingflow_mcp/tools/code_block_tools.py +2 -2
- package/src/qingflow_mcp/tools/import_tools.py +36 -2
- package/src/qingflow_mcp/tools/record_tools.py +410 -156
- package/src/qingflow_mcp/tools/resource_read_tools.py +114 -32
- package/src/qingflow_mcp/tools/task_context_tools.py +899 -141
- package/src/qingflow_mcp/tools/workspace_tools.py +141 -0
package/README.md
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Install:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npm install @qingflow-tech/qingflow-cli@1.0.
|
|
6
|
+
npm install @qingflow-tech/qingflow-cli@1.0.3
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
Run:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npx -y -p @qingflow-tech/qingflow-cli@1.0.
|
|
12
|
+
npx -y -p @qingflow-tech/qingflow-cli@1.0.3 qingflow
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Environment:
|
|
@@ -20,6 +20,12 @@
|
|
|
20
20
|
|
|
21
21
|
`auth_use_credential` 是本地唯一鉴权主路径。
|
|
22
22
|
|
|
23
|
+
补充说明:
|
|
24
|
+
|
|
25
|
+
- 对 stdio MCP 来说,主路径仍然只有 `auth_use_credential`。
|
|
26
|
+
- 如果你是在终端里直接使用 `qingflow` CLI,可以额外使用 `qingflow auth login` 作为“人类登录”入口;默认会提示轻流邮箱和隐藏密码,拿到 `token` 后建立本地 CLI 会话。
|
|
27
|
+
- 也就是说,这次新增的是 CLI 的登录入口,不是给 MCP 增加第二套会话模型。
|
|
28
|
+
|
|
23
29
|
## npm 安装器适用场景
|
|
24
30
|
|
|
25
31
|
适合这类本地 agent / gateway:
|
|
@@ -211,7 +217,7 @@ qingflow-app-builder-mcp
|
|
|
211
217
|
"command": "npx",
|
|
212
218
|
"args": [
|
|
213
219
|
"-y",
|
|
214
|
-
"@
|
|
220
|
+
"@josephyan/qingflow-app-user-mcp"
|
|
215
221
|
],
|
|
216
222
|
"env": {
|
|
217
223
|
"QINGFLOW_MCP_DEFAULT_BASE_URL": "https://qingflow.com/api",
|
|
@@ -224,7 +230,7 @@ qingflow-app-builder-mcp
|
|
|
224
230
|
"command": "npx",
|
|
225
231
|
"args": [
|
|
226
232
|
"-y",
|
|
227
|
-
"@
|
|
233
|
+
"@josephyan/qingflow-app-builder-mcp"
|
|
228
234
|
],
|
|
229
235
|
"env": {
|
|
230
236
|
"QINGFLOW_MCP_DEFAULT_BASE_URL": "https://qingflow.com/api",
|
|
@@ -266,7 +272,7 @@ npm install
|
|
|
266
272
|
|
|
267
273
|
如果 MCP 客户端一调用工具就报 `Transport closed`,优先检查这几件事:
|
|
268
274
|
|
|
269
|
-
1. 不要混用不同版本的 `@
|
|
275
|
+
1. 不要混用不同版本的 `@josephyan/qingflow-cli`、`@josephyan/qingflow-app-user-mcp`、`@josephyan/qingflow-app-builder-mcp`
|
|
270
276
|
2. 删除安装目录下的 `.npm-python`
|
|
271
277
|
3. 重新执行 `npm install` 或重新安装对应 tgz/npm 包
|
|
272
278
|
4. 再启动 MCP 客户端
|
package/npm/bin/qingflow.mjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
import { spawnServer, getPackageRoot } from "../lib/runtime.mjs";
|
|
3
3
|
|
|
4
4
|
const packageRoot = getPackageRoot(import.meta.url);
|
|
5
|
-
spawnServer(packageRoot, process.argv.slice(2), "qingflow", { allowRuntimeBootstrap: true });
|
|
5
|
+
spawnServer(packageRoot, process.argv.slice(2), "qingflow", { allowRuntimeBootstrap: true, stdio: "inherit" });
|
package/npm/lib/runtime.mjs
CHANGED
|
@@ -287,7 +287,12 @@ function forwardSignal(child, signal) {
|
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
export function spawnServer(
|
|
290
|
+
export function spawnServer(
|
|
291
|
+
packageRoot,
|
|
292
|
+
args,
|
|
293
|
+
commandName = "qingflow-mcp",
|
|
294
|
+
{ allowRuntimeBootstrap = false, stdio = "proxy" } = {},
|
|
295
|
+
) {
|
|
291
296
|
let runtime = inspectPythonEnv(packageRoot, commandName);
|
|
292
297
|
let serverCommand = runtime.serverCommand;
|
|
293
298
|
|
|
@@ -315,12 +320,14 @@ export function spawnServer(packageRoot, args, commandName = "qingflow-mcp", { a
|
|
|
315
320
|
}
|
|
316
321
|
|
|
317
322
|
const child = spawn(serverCommand, args, {
|
|
318
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
323
|
+
stdio: stdio === "inherit" ? "inherit" : ["pipe", "pipe", "pipe"],
|
|
319
324
|
env: process.env,
|
|
320
325
|
windowsHide: true,
|
|
321
326
|
});
|
|
322
327
|
|
|
323
|
-
|
|
328
|
+
if (stdio !== "inherit") {
|
|
329
|
+
proxyStreams(child);
|
|
330
|
+
}
|
|
324
331
|
forwardSignal(child, "SIGINT");
|
|
325
332
|
forwardSignal(child, "SIGTERM");
|
|
326
333
|
|
package/package.json
CHANGED
package/pyproject.toml
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, packages_distributions, version as _dist_version
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
3
6
|
__all__ = ["__version__"]
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
_FALLBACK_VERSION = "0.2.0b998"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _resolve_local_pyproject_version() -> str | None:
|
|
12
|
+
module_path = Path(__file__).resolve()
|
|
13
|
+
for parent in module_path.parents:
|
|
14
|
+
candidate = parent / "pyproject.toml"
|
|
15
|
+
if not candidate.is_file():
|
|
16
|
+
continue
|
|
17
|
+
for line in candidate.read_text(encoding="utf-8").splitlines():
|
|
18
|
+
stripped = line.strip()
|
|
19
|
+
if stripped.startswith("version = "):
|
|
20
|
+
return stripped.split("=", 1)[1].strip().strip('"')
|
|
21
|
+
break
|
|
22
|
+
return None
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _resolve_runtime_version() -> str:
|
|
26
|
+
local_version = _resolve_local_pyproject_version()
|
|
27
|
+
if local_version:
|
|
28
|
+
return local_version
|
|
29
|
+
for dist_name in packages_distributions().get("qingflow_mcp", []):
|
|
30
|
+
try:
|
|
31
|
+
return _dist_version(dist_name)
|
|
32
|
+
except PackageNotFoundError:
|
|
33
|
+
continue
|
|
34
|
+
return _FALLBACK_VERSION
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
__version__ = _resolve_runtime_version()
|
|
@@ -819,6 +819,10 @@ class FieldMutation(StrictModel):
|
|
|
819
819
|
validation_alias=AliasChoices("custom_button_text", "customButtonText", "custom_btn_text", "customBtnText"),
|
|
820
820
|
)
|
|
821
821
|
subfields: list[FieldPatch] | None = None
|
|
822
|
+
subfield_updates: list["FieldUpdatePatch"] | None = Field(
|
|
823
|
+
default=None,
|
|
824
|
+
validation_alias=AliasChoices("subfield_updates", "subfieldUpdates"),
|
|
825
|
+
)
|
|
822
826
|
|
|
823
827
|
@model_validator(mode="after")
|
|
824
828
|
def validate_shape(self) -> "FieldMutation":
|
|
@@ -848,8 +852,12 @@ class FieldMutation(StrictModel):
|
|
|
848
852
|
or self.custom_button_text is not None
|
|
849
853
|
):
|
|
850
854
|
raise ValueError("code_block_config, code_block_binding, auto_trigger, custom_button_text_enabled, and custom_button_text are only allowed for code_block fields")
|
|
851
|
-
if self.type == PublicFieldType.subtable and not self.subfields:
|
|
852
|
-
raise ValueError("subtable field requires subfields")
|
|
855
|
+
if self.type == PublicFieldType.subtable and not self.subfields and not self.subfield_updates:
|
|
856
|
+
raise ValueError("subtable field requires subfields or subfield_updates")
|
|
857
|
+
if self.type is not None and self.type != PublicFieldType.subtable and self.subfield_updates:
|
|
858
|
+
raise ValueError("subfield_updates are only allowed for subtable fields")
|
|
859
|
+
if self.subfields and self.subfield_updates:
|
|
860
|
+
raise ValueError("subfields and subfield_updates cannot be used together")
|
|
853
861
|
return self
|
|
854
862
|
|
|
855
863
|
@model_validator(mode="before")
|
|
@@ -1528,14 +1536,16 @@ class PortalApplyRequest(StrictModel):
|
|
|
1528
1536
|
raise ValueError("package_tag_id is required when dash_key is empty")
|
|
1529
1537
|
if not self.dash_key and not self.dash_name:
|
|
1530
1538
|
raise ValueError("dash_name is required when creating a portal")
|
|
1531
|
-
if not self.sections:
|
|
1532
|
-
raise ValueError("portal apply requires a non-empty sections list")
|
|
1539
|
+
if not self.dash_key and not self.sections:
|
|
1540
|
+
raise ValueError("portal apply requires a non-empty sections list when creating a portal")
|
|
1533
1541
|
if self.visibility is not None and self.auth is not None:
|
|
1534
1542
|
raise ValueError("visibility and auth cannot be provided together")
|
|
1535
1543
|
return self
|
|
1536
1544
|
|
|
1537
1545
|
|
|
1538
1546
|
FieldPatch.model_rebuild()
|
|
1547
|
+
FieldMutation.model_rebuild()
|
|
1548
|
+
FieldUpdatePatch.model_rebuild()
|
|
1539
1549
|
|
|
1540
1550
|
|
|
1541
1551
|
class AppGetResponse(StrictModel):
|