@margay/ccl-core 1.5.1-alpha.5 → 1.5.1-alpha.7
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/QUICKSTART.md +29 -27
- package/README.md +28 -26
- package/dist/cli.js +126951 -134039
- package/dist/sdk/background.d.ts +14 -0
- package/dist/sdk/background.js +2 -1
- package/dist/sdk/index.d.ts +1 -1
- package/docs/background-runs.md +28 -0
- package/docs/cli-installation.md +23 -22
- package/docs/context-checkpoints-and-daemon.md +4 -0
- package/docs/gateway-vision-capabilities.md +38 -0
- package/docs/multi-gateway-auth-entry-usage.md +20 -0
- package/docs/releases/1.5.1-alpha.6.md +24 -0
- package/docs/releases/1.5.1-alpha.7.md +16 -0
- package/package.json +7 -4
- package/sdk/API.md +4 -0
package/dist/sdk/background.d.ts
CHANGED
|
@@ -13,6 +13,19 @@ export type BackgroundClientOptions = {
|
|
|
13
13
|
env?: NodeJS.ProcessEnv;
|
|
14
14
|
timeoutMs?: number;
|
|
15
15
|
};
|
|
16
|
+
export type DaemonEnsureResult = {
|
|
17
|
+
action: 'reused' | 'started';
|
|
18
|
+
project: string;
|
|
19
|
+
owner: {
|
|
20
|
+
ready: true;
|
|
21
|
+
pid: number;
|
|
22
|
+
configId: string;
|
|
23
|
+
};
|
|
24
|
+
recovery: {
|
|
25
|
+
status: 'available' | 'unavailable';
|
|
26
|
+
reason?: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
16
29
|
export declare class BackgroundClientError extends Error {
|
|
17
30
|
readonly code: string;
|
|
18
31
|
constructor(code: string, message: string);
|
|
@@ -20,6 +33,7 @@ export declare class BackgroundClientError extends Error {
|
|
|
20
33
|
/** Durable runs do not retain JS callbacks or in-process SDK MCP servers. Use
|
|
21
34
|
* persistent stdio/HTTP tools configured through launch instead. */
|
|
22
35
|
export declare function createBackgroundClient(options: BackgroundClientOptions): {
|
|
36
|
+
ensureDaemon: () => Promise<DaemonEnsureResult>;
|
|
23
37
|
getScheduledNotificationBinding: (selector: ScheduledNotificationSelector) => Promise<ScheduledNotificationBindingLookup>;
|
|
24
38
|
rebindScheduledNotifications: (request: ScheduledNotificationRebind) => Promise<{
|
|
25
39
|
selector: {
|
package/dist/sdk/background.js
CHANGED
|
@@ -18,7 +18,7 @@ export function createBackgroundClient(options) {
|
|
|
18
18
|
// Serialization can throw (for example for a cyclic input); do it before
|
|
19
19
|
// allocating a subprocess that would otherwise wait forever for stdin.
|
|
20
20
|
const input = JSON.stringify(request);
|
|
21
|
-
const retryAdvice = command.includes('notification') ? 'Read the original notification binding. Retry a binding mutation only with the same actionId and payload.' : command.includes('occurrence') ? 'Read the original occurrence and approvalDecisions. Retry approval only with the same actionId and payload.' : 'Query the original requestKey; do not submit a new key.';
|
|
21
|
+
const retryAdvice = command === 'ensure' ? 'Inspect daemon status before retrying; startup may already have completed.' : command.includes('notification') ? 'Read the original notification binding. Retry a binding mutation only with the same actionId and payload.' : command.includes('occurrence') ? 'Read the original occurrence and approvalDecisions. Retry approval only with the same actionId and payload.' : 'Query the original requestKey; do not submit a new key.';
|
|
22
22
|
return new Promise((resolve, reject) => {
|
|
23
23
|
const child = spawn(options.execPath ?? process.execPath, [options.cliPath, 'daemon', command, '--cwd', options.cwd, '--request-stdin'], {
|
|
24
24
|
cwd: options.cwd, env: options.env ?? process.env, stdio: ['pipe', 'pipe', 'pipe'],
|
|
@@ -73,6 +73,7 @@ export function createBackgroundClient(options) {
|
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
return {
|
|
76
|
+
ensureDaemon: () => invoke('ensure', {}),
|
|
76
77
|
getScheduledNotificationBinding: (selector) => invoke('get-scheduled-notification-binding', { selector }),
|
|
77
78
|
rebindScheduledNotifications: (request) => invoke('rebind-scheduled-notifications', request),
|
|
78
79
|
getOccurrence: (request) => invoke('get-occurrence', request),
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type { RecoveryDiagnostic } from './errorDiagnostics.js';
|
|
|
20
20
|
export type { GatewayRequestPhase, GatewayRequestProgress } from './requestProgress.js';
|
|
21
21
|
export type { AccumulatedUsage, CanUseToolContext, CanUseToolFn, CanUseToolResult, InitializationResult, LifecycleHooks, PendingApproval, PendingDecision, ProviderConfig, Query, QueryOptions, SDKEvent, SDKUserMessage, SessionStore, SessionLifecycleEvent, Transport, Usage, WireMessage, } from './types.js';
|
|
22
22
|
export { getExecutionGuidance } from './executionGuidance.js';
|
|
23
|
-
export { createBackgroundClient, BackgroundClientError, type BackgroundClientOptions } from './background.js';
|
|
23
|
+
export { createBackgroundClient, BackgroundClientError, type BackgroundClientOptions, type DaemonEnsureResult } from './background.js';
|
|
24
24
|
export type { ScheduledNotificationSelector, ScheduledNotificationRebind, ScheduledNotificationBinding, ScheduledNotificationBindingLookup, EffectiveScheduledNotificationRoute } from './scheduledNotificationTypes.js';
|
|
25
25
|
export type { BackgroundRun, BackgroundRunSpec, BackgroundRunLookup, BackgroundRunSelector, BackgroundRunEvent, BackgroundRunEvents, BackgroundRunAction, BackgroundRunApproval, BackgroundPermission, BackgroundRunSource } from './backgroundRunTypes.js';
|
|
26
26
|
export { runCommandProcess, type CommandProcessInput, type CommandProcessResult } from './commandProcess.js';
|
package/docs/background-runs.md
CHANGED
|
@@ -93,6 +93,34 @@ await background.cancelRun({ runId, expectedRevision, actionId: 'cancel-1' })
|
|
|
93
93
|
|
|
94
94
|
`ccl daemon submit|get|events|cancel-run|approve-run --request-stdin --cwd PROJECT` 从 stdin 接收 JSON。submit 可启动缺失的兼容 daemon;读取不会启动进程。旧活 owner 配置不匹配时明确拒绝,不暗中替换。daemon stop 停调度;取消某一 run 使用 cancel-run。
|
|
95
95
|
|
|
96
|
+
### 按原配置恢复 owner
|
|
97
|
+
|
|
98
|
+
成功启动并就绪的 owner 会记录可复用的启动配置。退出前台不会停止它;owner 自己停止后,宿主或用户可以调用:
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
ccl daemon status --cwd PROJECT
|
|
102
|
+
ccl daemon ensure --cwd PROJECT
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`ensure` 复用就绪且 CLI 兼容的 owner;缺少活 owner 时,从本产品 `.ccl/daemon/recovery.json` 恢复原配置。它不使用默认模型猜测启动,也不停止已有的不同配置/版本进程。返回 `{ok:true,result:{action,project,owner:{ready,pid,configId},recovery}}`;`action=reused` 表示直接复用,`started` 表示进入启动路径,并发时返回实际获锁者身份,不代表本调用独占创建。失败返回 `{ok:false,code,error}` 并退出非零。
|
|
106
|
+
|
|
107
|
+
SDK 使用同包的 `createBackgroundClient({cwd,cliPath,env}).ensureDaemon()`,返回上述 result,失败抛 `BackgroundClientError`。`options.launch` 仍用于提交任务,不覆盖 ensure 的原配方。恢复 owner 不创建新的 task/run/occurrence,也不批准等待中的权限。
|
|
108
|
+
|
|
109
|
+
status 的 `recovery` 表示磁盘记录的状态,不是当前凭据可用或任务执行成功的保证;真实启动前还会核对配置。CronCreate 的 `owner.recovery` 表示该 owner 是否成功记录配方。`background_ready` 可以同时伴随 `recovery.status=unavailable`:当前任务已交接,但退出后尚不能自动恢复;不要为此另建重复任务。旧 owner 没有这个字段时可恢复性未知。
|
|
110
|
+
|
|
111
|
+
| 原因 | 处理 |
|
|
112
|
+
| --- | --- |
|
|
113
|
+
| recovery_missing / unconfirmed | 从原宿主按原 taskId 重新 handoff,确认就绪;不手工拼造配方 |
|
|
114
|
+
| inline_configuration / unsupported_configuration | 将内联 settings/MCP 或复杂权限命令模式改用持久配置文件,再重新交接;明确空 MCP 配置可保存 |
|
|
115
|
+
| credentials_unavailable | 提供原来源的有效凭据后重试;不把 token 写进配方 |
|
|
116
|
+
| configuration_changed / owner_incompatible | 核对 CLI/配置变化,明确选择切换时机后重新交接,不自动停止活进程 |
|
|
117
|
+
| recovery_invalid / recovery_changed | 检查记录或并发启动状态,不删除重建任务库掩盖错误 |
|
|
118
|
+
| storage_error / recovery_storage_error | 修复项目后台目录的写入权限;未确认配方不能用于恢复 |
|
|
119
|
+
|
|
120
|
+
记录保留配置来源、受支持非凭据环境键及其缺失状态;凭据只记录来源键名,恢复时重新获取当前值。任意内联 JSON 不会被“脱敏后执行”。新启动无法保存可恢复参数时,旧配方失效。首次升级到支持此功能的版本仍需一次正常交接生成记录;更换 CLI 路径/字节或配置后也需要重新确认,不能强用旧 configId。
|
|
121
|
+
|
|
122
|
+
此命令本身不安装系统自启,也不会定时主动运行;宿主可以显式调用 ensure。停机漏跑原因与自启服务属于后续交付,当前保持既有 missed/coalesce 语义。CCL 与 Margay 的目录、记录、凭据和 owner 独立,不互相接管。
|
|
123
|
+
|
|
96
124
|
### 安装升级与已有定时任务
|
|
97
125
|
|
|
98
126
|
安装新包不会重启正在运行的 daemon。`ccl daemon status --cwd PROJECT`、`scheduledStatus` 和 `CronList` 的 background 结果包含:
|
package/docs/cli-installation.md
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
# CLI installation and upgrades
|
|
2
2
|
|
|
3
|
-
For
|
|
3
|
+
For CCL 1.5.1, use Node.js `>=22.19.0`. This matches the declared minimum of
|
|
4
4
|
the pinned `undici 8.0.2` runtime dependency; the earlier Node 20 declaration no
|
|
5
5
|
longer applies. macOS Node/Bun verification does not imply Windows verification.
|
|
6
6
|
|
|
7
|
-
Starting with `1.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
Starting with `1.5.1-alpha.6`, `@margay/ccl-core` provides only `ccl`.
|
|
8
|
+
Earlier releases from `1.4.5-rc.10` through `1.5.1-alpha.5` also provided a
|
|
9
|
+
`margay` alias. The independent `@margay/cli` package will own `margay` on the
|
|
10
|
+
1.8 cleanhouse line. Upgrade an old dual-entry CCL installation first, before
|
|
11
|
+
installing that independent package. Scripts intended to run CCL should use `ccl`.
|
|
11
12
|
|
|
12
13
|
## Global and project installs
|
|
13
14
|
|
|
14
|
-
For a terminal command available outside a project, install the
|
|
15
|
-
|
|
15
|
+
For a terminal command available outside a project, install the released version
|
|
16
|
+
explicitly (the `latest` tag is not advanced by alpha releases):
|
|
16
17
|
|
|
17
18
|
```sh
|
|
18
|
-
npm install --global @margay/ccl-core@
|
|
19
|
-
|
|
19
|
+
npm install --global @margay/ccl-core@1.5.1-alpha.6
|
|
20
|
+
ccl --version
|
|
20
21
|
```
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
replace a CLI embedded in Margay Desktop or already loaded by a running process.
|
|
23
|
+
The expected output is `1.5.1-alpha.6 (CCL)`. Global installation does not replace
|
|
24
|
+
a CLI embedded in Margay Desktop or already loaded by a running process.
|
|
25
25
|
|
|
26
26
|
Without `--global`, npm installs a project dependency. Run that copy explicitly:
|
|
27
27
|
|
|
28
28
|
```sh
|
|
29
|
-
npm install @margay/ccl-core@
|
|
30
|
-
./node_modules/.bin/
|
|
29
|
+
npm install @margay/ccl-core@1.5.1-alpha.6
|
|
30
|
+
./node_modules/.bin/ccl --version
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
project install does not upgrade commands elsewhere on the shell's PATH.
|
|
33
|
+
A successful project install does not upgrade commands elsewhere on the shell's PATH.
|
|
35
34
|
|
|
36
35
|
## Migrating old custom launchers (macOS/Linux)
|
|
37
36
|
|
|
@@ -56,13 +55,14 @@ There are two distinct cases:
|
|
|
56
55
|
resolved entry. Back up the specific obsolete CCL wrapper, or update an explicit
|
|
57
56
|
alias/function to use the npm entry. Ensure the npm prefix's `bin` directory is
|
|
58
57
|
on PATH. Refresh the shell command cache (`rehash` in zsh, `hash -r` in bash),
|
|
59
|
-
then verify
|
|
58
|
+
then verify the intended command again from outside the source checkout.
|
|
60
59
|
|
|
61
60
|
Keep each backup until the new commands work. To roll back a custom wrapper,
|
|
62
61
|
restore its saved bytes at the original path after inspecting what currently
|
|
63
62
|
occupies that path. For an npm-managed installation, install the previous exact
|
|
64
|
-
version. Future npm upgrades manage
|
|
65
|
-
|
|
63
|
+
version. Future npm upgrades manage the CCL link once its custom wrapper has been
|
|
64
|
+
migrated. Do not reinstall a dual-entry CCL version over an independent Margay
|
|
65
|
+
installation; its old alias would conflict with the other product.
|
|
66
66
|
|
|
67
67
|
## Checking a release tarball
|
|
68
68
|
|
|
@@ -75,7 +75,8 @@ node tests/package-cli-install.mjs /path/to/artifacts/candidate.tgz /path/to/pre
|
|
|
75
75
|
|
|
76
76
|
The smoke test uses isolated install prefixes, HOME/configuration and cache. It
|
|
77
77
|
checks fresh global and project installs, upgrade from the previous tarball,
|
|
78
|
-
|
|
78
|
+
the `ccl` command through PATH, matching executable/version/help, removal of the
|
|
79
|
+
old `margay` alias during upgrade, an unmanaged-file
|
|
79
80
|
collision, backup migration and PATH shadowing. Dependency lifecycle scripts are
|
|
80
81
|
disabled; this verifies CLI installation and startup, not native dependency or
|
|
81
82
|
model behavior. It currently runs on POSIX; Windows `.cmd`/PowerShell launchers
|
|
@@ -86,7 +87,7 @@ require a Windows run. It cleans its temporary installations even on failure.
|
|
|
86
87
|
Set an absolute, private configuration directory **before starting** each process:
|
|
87
88
|
|
|
88
89
|
```sh
|
|
89
|
-
CCL_CONFIG_DIR=/absolute/path/to/isolated-config
|
|
90
|
+
CCL_CONFIG_DIR=/absolute/path/to/isolated-config ccl
|
|
90
91
|
```
|
|
91
92
|
|
|
92
93
|
`CCL_CONFIG_DIR` takes precedence over the compatible `CLAUDE_CONFIG_DIR` variable.
|
|
@@ -114,7 +115,7 @@ need to authenticate separately in its own directory.
|
|
|
114
115
|
|
|
115
116
|
This describes the local #46 source change; use a candidate/release containing
|
|
116
117
|
that change before relying on the new HOME-only behavior. The Margay website
|
|
117
|
-
account vault uses its own configuration-scoped references, and `
|
|
118
|
+
account vault uses its own configuration-scoped references, and `ccl auth logout`
|
|
118
119
|
targets that website account, not the old OAuth Keychain. These tests use an
|
|
119
120
|
injected fake vault and OAuth receiver; they do not log out a real account.
|
|
120
121
|
|
|
@@ -89,3 +89,7 @@ configuration.
|
|
|
89
89
|
even after a completed one-shot definition has been removed. `ccl daemon status`
|
|
90
90
|
provides the same records from a fresh CLI. Process liveness (`running`) and verified
|
|
91
91
|
scheduler readiness (`owner.ready`) are separate fields.
|
|
92
|
+
|
|
93
|
+
## Restoring an owner with its original launch
|
|
94
|
+
|
|
95
|
+
`ccl daemon ensure --cwd PROJECT` restores a confirmed reusable launch or reuses a compatible ready owner. It does not install a login service. Inspect `recovery` in daemon status; missing or unsafe records require a new handoff from the original host. Credentials are resolved again and are never stored in the recipe. See [background recovery](background-runs.md) for the JSON/SDK interface and failure handling.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Gateway 视觉能力声明(CCL 1.5.1-alpha.6)
|
|
2
|
+
|
|
3
|
+
CCL `1.5.1-alpha.6` 包含本文的动态能力消费实现;Gateway #28 的契约仍待网关确认与部署联合验证。`1.5.1-alpha.5` 修复了本地图片读取路径,但不包含本文的动态能力消费。
|
|
4
|
+
|
|
5
|
+
## 返回形式
|
|
6
|
+
|
|
7
|
+
模型目录 `GET /v1/models` 的每个 `data[i]` 可包含:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{"id":"selected-model","capabilities":{"vision":true,"version":"catalog-v1"}}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`POST /v1/capabilities/resolve` 顶层 `capabilities` 绑定 `resolved_model`;每个 `eligible_candidates[i].capabilities` 只描述该候选,不能将首候选的值复制给其它候选。`vision` 必须为 JSON 布尔值;`version` 为非空、无控制字符且不超过 256 字符的不透明字符串。可选字段缺失或畸形不使整个路由失效。顶层与首候选布尔值冲突时,当前视觉声明为未知。
|
|
14
|
+
|
|
15
|
+
实际推理响应使用同一次实际路由的响应头:
|
|
16
|
+
|
|
17
|
+
```http
|
|
18
|
+
X-Effective-Vision: true
|
|
19
|
+
X-Margay-Served-Model: actual-model
|
|
20
|
+
X-Margay-Served-Deployment: actual-deployment
|
|
21
|
+
X-Margay-Capability-Version: deployment-v2
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`X-Effective-Vision` 只接受 `true` 或 `false`;未知时省略。缺少或非法的视觉值、版本、实际模型或部署标识会使这次视觉观察成为未知。现有上下文窗口和最大输出响应头语义不变。
|
|
25
|
+
|
|
26
|
+
## CLI 如何使用
|
|
27
|
+
|
|
28
|
+
首请求优先使用当前路由解析声明,否则使用目录声明。实际响应会修正同一会话后续请求的视觉提示;缺失响应头会清除先前支持判断,不退回旧目录的 `true`。模型、账号、网关、路由与选模代际隔离;晚到请求不能覆盖更新的选择。没有路由 context 的旧网关按 main、视觉专员、compactor 等用途隔离声明。
|
|
29
|
+
|
|
30
|
+
声明由固定枚举文本写入实际模型请求的 system,并进入 token 预算,不复制版本或凭据到提示中。支持声明不是图片已经送达或已经理解的证明;不支持时建议使用已有视觉专员,未知时保持不确定。这里不会自动切换主模型、移除图片或增加权限拦截。
|
|
31
|
+
|
|
32
|
+
目录读取沿用 5 秒超时;失败后视觉查询按账号短暂退避 30 秒。旧网关无此接口或无字段时,普通对话仍可继续。视觉状态仅存在于当前进程内,不持久化旧能力判断。
|
|
33
|
+
|
|
34
|
+
## 验证边界
|
|
35
|
+
|
|
36
|
+
`gateway-vision-capabilities` 和 `gateway-vision-contract` 用例验证解析、隔离、晚到结果、预算及双协议专员;`gateway-vision-request` 验证实际 HTTP 请求与模型覆盖;`gateway-vision-cli` 用构建后的 CLI 验证 resolve → 会话 → 请求头/提示透传、后续响应修正、切换模型和旧网关/目录超时。
|
|
37
|
+
|
|
38
|
+
受控字段代理连接真实模型的读图试验,分别验证主模型直接读图、主模型调用视觉专员和能力未知时的行为。代理注入的声明只证明客户端消费链,不能作为网关已经按本契约返回真实部署能力的证据。联合验收应使用部署后的网关重复这些场景,再确认发布版本。
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# 多网关账号入口
|
|
2
|
+
|
|
3
|
+
适用于 CCL 1.5.1-alpha.7 与 Margay CLI 1.8.0-alpha.1。两产品分别保存网关账号和凭据。
|
|
4
|
+
|
|
5
|
+
交互会话中使用 `/login` 或 `/gateway login`,会显示已保存网关、官方网关和“连接本机或自建网关”。首次账号引导也使用同一入口。选择已保存网关会验证其账号后切换;手工 API key 配置仍标记为“未验证账号”。
|
|
6
|
+
|
|
7
|
+
添加本机或自建网关时,输入网关地址,例如 `http://127.0.0.1:18090`,再选择:
|
|
8
|
+
|
|
9
|
+
- 已有网关账号 token:隐藏输入;目标网关 `/auth/me` 核对账号有效后才保存到系统凭据库。
|
|
10
|
+
- 此网关的授权网站:明确输入该网关支持的授权网站地址。网站必须支持现有 CLI 授权合同;任意网页登录页不会自动变成 CLI 授权服务。
|
|
11
|
+
|
|
12
|
+
客户端不提供尚未接入服务端协议的 SSO 或设备授权。普通推理 API key 也不等于可用于账号和功能门的网关账号 token。
|
|
13
|
+
|
|
14
|
+
终端中运行 `margay login`(CCL 使用 `ccl login`)进入同样的选择流程。自动化场景可把已有账号 token 经管道输入 `margay login --gateway URL --token-stdin`,不要把 token 写进命令参数或 shell 历史。此选项要求明确网关地址,不能与 `--website` 或 `--force` 同用。
|
|
15
|
+
|
|
16
|
+
`margay account list` 列出本产品保存的网关,`margay account switch URL` 选择已有网关,`margay account status` 验证当前账号。CCL 命令把 `margay` 换成 `ccl`;两产品的默认配置和凭据服务继续分开。
|
|
17
|
+
|
|
18
|
+
有效账号可复用,不必每次访问网站。授权网站来源随网关保存,过期时仍使用对应网站。旧自建网关账号缺少认证来源时,会要求选择认证方式,不能默认发送到官网。网络故障保留账号和当前选择,提示重试;明确认证失败才提示重新认证。取消同样不会清除账号。
|
|
19
|
+
|
|
20
|
+
本机联调时应选择测试网关及测试账号,显式网关环境变量仍可能覆盖保存的选择,界面会提示这一点。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# 1.5.1-alpha.6
|
|
2
|
+
|
|
3
|
+
本预发布版在 [1.5.1-alpha.5](1.5.1-alpha.5.md) 基础上接收并使用网关视觉能力声明。使用 `alpha` 标签分发,`latest` 不变。发布后安装指定版本:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install -g @margay/ccl-core@1.5.1-alpha.6
|
|
7
|
+
ccl --version
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## 视觉能力接入(#62,客户端交付)
|
|
11
|
+
|
|
12
|
+
CCL 从模型目录和路由解析读取版本化视觉声明,再用实际推理响应头刷新后续请求。声明按网关、账号、模型、路由、用途和请求代际隔离,晚到响应不会覆盖新的选择。固定的支持、不支持或未知说明进入模型请求及 token 预算,不按模型名猜测,也不自动更换主模型。
|
|
13
|
+
|
|
14
|
+
旧网关缺接口、字段缺失或声明非法时保持未知;普通对话继续。目录请求有 5 秒超时,视觉目录失败后退避 30 秒。首次模型校验与视觉目录查询可能分别等待,合计约 10 秒。能力支持不等于图片已送达或已被理解;本地图片校验和视觉专员延续上一版行为。
|
|
15
|
+
|
|
16
|
+
字段及响应头的完整格式见[网关视觉契约](../gateway-vision-capabilities.md)。客户端已验证受控 HTTP 链路及连接真实模型的字段代理;网关真实部署仍须联合验收。本版不宣称网关 #28 已上线,也不据此关闭整体 #62。
|
|
17
|
+
|
|
18
|
+
## 命令归属与兼容
|
|
19
|
+
|
|
20
|
+
本包从此版起只提供 `ccl`,版本输出标识为 `CCL`。旧版 `margay` 别名退出本包;后续独立的 `@margay/cli` 提供 `margay`,属于 1.8 cleanhouse 产品线,不包含在本次安装中。
|
|
21
|
+
|
|
22
|
+
已有双入口版本应先升级 CCL,再安装独立 Margay 包。不要用 `--force` 覆盖未知命令;先检查 `type -a ccl margay`,备份并调整自己创建的旧包装脚本。CCL 的原配置、凭据、会话与 SDK 包名保持不变。旧脚本调用 CCL 时应改用 `ccl`。
|
|
23
|
+
|
|
24
|
+
SDK/桌面宿主需升级实际嵌入的 CLI 与 SDK;全局安装不会替换宿主内置版本。运行中的会话和 daemon 需正常退出后重启。回退可安装此前确切版本,但旧版双入口会与独立 Margay 命令冲突;两包并存时先处理命令归属,不覆盖另一产品。回退不会撤销已发生的业务操作。
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @margay/ccl-core 1.5.1-alpha.7
|
|
2
|
+
|
|
3
|
+
本次增量更新包含多网关认证入口和后台运行恢复。
|
|
4
|
+
|
|
5
|
+
- 首次引导、会话内登录与终端登录支持选择已有网关、官方网关或自建网关。
|
|
6
|
+
- 自建网关可使用已有账号 token 或明确指定其授权网站;每个网关独立保存凭据,失败或取消不会覆盖原账号。
|
|
7
|
+
- 新增 `daemon ensure --cwd PROJECT` 与 SDK `ensureDaemon()`,按保存的安全配置恢复后台 owner;缺少恢复记录、配置改变或存在不兼容 owner 时明确拒绝。
|
|
8
|
+
- 恢复不会重新执行已完成的任务,也不提供系统开机自启。升级改变 CLI 文件后,需要正常启动并重新交接,以生成与新版匹配的恢复记录。
|
|
9
|
+
|
|
10
|
+
安装:`npm install -g @margay/ccl-core@1.5.1-alpha.7`,随后运行 `ccl --version`。
|
|
11
|
+
|
|
12
|
+
多网关分别登录不等于网站统一单点登录;授权网站必须与目标网关匹配。服务端最新测试环境的网页登录链路尚未完成本轮验收。
|
|
13
|
+
|
|
14
|
+
CCL 与 Margay CLI 的配置、凭据和后台服务保持独立。运行中的会话或 daemon 不会自动加载新安装的代码;请在任务安排允许时正常停止并重新启动对应产品。
|
|
15
|
+
|
|
16
|
+
需要回退时安装 `@margay/ccl-core@1.5.1-alpha.6` 并重新启动对应产品。程序回退不会撤销工具已经产生的文件修改或服务端数据。
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@margay/ccl-core",
|
|
3
|
-
"version": "1.5.1-alpha.
|
|
3
|
+
"version": "1.5.1-alpha.7",
|
|
4
4
|
"description": "CCL agent runtime for Margay integration",
|
|
5
5
|
"license": "SEE LICENSE IN README.md",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"ccl": "dist/cli.js"
|
|
9
|
-
"margay": "dist/cli.js"
|
|
8
|
+
"ccl": "dist/cli.js"
|
|
10
9
|
},
|
|
11
10
|
"files": [
|
|
12
11
|
"dist/cli.js",
|
|
@@ -57,7 +56,11 @@
|
|
|
57
56
|
"docs/releases/1.5.1-alpha.2.md",
|
|
58
57
|
"docs/releases/1.5.1-alpha.3.md",
|
|
59
58
|
"docs/releases/1.5.1-alpha.4.md",
|
|
60
|
-
"docs/releases/1.5.1-alpha.5.md"
|
|
59
|
+
"docs/releases/1.5.1-alpha.5.md",
|
|
60
|
+
"docs/releases/1.5.1-alpha.6.md",
|
|
61
|
+
"docs/gateway-vision-capabilities.md",
|
|
62
|
+
"docs/multi-gateway-auth-entry-usage.md",
|
|
63
|
+
"docs/releases/1.5.1-alpha.7.md"
|
|
61
64
|
],
|
|
62
65
|
"engines": {
|
|
63
66
|
"node": ">=22.19.0"
|
package/sdk/API.md
CHANGED
|
@@ -739,3 +739,7 @@ the previously published alpha.2 does not support them.
|
|
|
739
739
|
`createBackgroundClient()` 提供 `getScheduledNotificationBinding(selector)` 与 `rebindScheduledNotifications(request)`,用于新会话接收原定时任务通知。选择器为 `{ taskId, taskCreatedAt }` 或 `{ occurrenceId }`;请求包含 `selector`、`targetSessionId`、`expectedRevision`(初始 0)和稳定 `actionId`。返回绑定含 `sessionId/revision/generation/updatedAt`。读取 occurrence 绑定还返回 `effective` 路由;显式 occurrence 优先于 task,task 优先于原 delegation。
|
|
740
740
|
|
|
741
741
|
换绑不启动 owner、不改变原任务或审批状态。超时重试原 actionId 和原请求;同 ID 改内容拒绝,revision 冲突须读取当前状态后决定新动作。模型工具固定绑定到自己的宿主 session,并请求权限确认。已被消费者接受的旧通知不会撤回;新代次只通知当前待办或结果,不重放过期历史。完整 CLI、工具字段、错误和恢复说明见 [新会话接收原任务通知](../docs/background-runs.md#新会话接收原任务通知)。
|
|
742
|
+
|
|
743
|
+
## 原配置恢复 daemon
|
|
744
|
+
|
|
745
|
+
同包 `createBackgroundClient({ cwd, cliPath, env }).ensureDaemon()` 返回 `DaemonEnsureResult`:`action` 为 `reused` 或 `started`,包含真实 `project`、`owner.ready/pid/configId` 和 `recovery.status/reason`。失败使用 `BackgroundClientError.code`;启动超时不表示进程肯定未启动,先查询 daemon status。此方法不使用 `options.launch` 覆盖记录、不提交新任务、不安装自启。详见[后台恢复契约](../docs/background-runs.md)。
|