@lark-codem/lark-cli 0.1.1 → 0.1.2-test.20261116.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.
Files changed (2) hide show
  1. package/README.md +44 -2
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -6,7 +6,7 @@ Install `@lark-codem/lark-cli` as an exact private dependency with optional depe
6
6
 
7
7
  The pinned official CLI owns personal commands, OAuth, profiles, user credentials, document formats, output and exit codes. With no task context, `CODEM_LARK_CLI_MODE=personal` (or unset) executes that CLI unchanged, including the host's managed UAT and `LARKSUITE_CLI_STRICT_MODE=user` environment.
8
8
 
9
- `CODEM_LARK_CLI_MODE=task`, a task token, dispatch ID or native sandbox marker selects the task boundary. `CODEM_TOKEN` and the current `CODEM_SANDBOX_DISPATCH_ID` (legacy `CODEM_DISPATCH_ID`) are both required. The CLI requests public scene metadata from Base through the same gateway: Tag resolves to the persisted initiator's user identity, while Meego AI nodes resolve to bot. No UAT, RT or application secret enters the CLI. Placeholder tokens are removed before forwarding; Base obtains the Tag initiator's server-owned Web UAT through UAT Keeper and preserves official API responses. Tag has no CodeM business capability allowlist; Feishu still enforces user scopes, resource permissions and each API's supported identities. AI-node requests retain the existing Base capability and work-item policy with TAT. Neither path falls back to personal profiles, device-owner credentials or another identity. Local credential/install management remains owned by the CodeM host. Deploy the context-capable Base before upgrading this CLI. Help and version stay offline. Dry runs resolve the same task identity as execution. Upstream may perform a read-only user-info lookup, but does not execute the previewed business operation.
9
+ `CODEM_LARK_CLI_MODE=task`, a task token, dispatch ID or native sandbox marker selects the task boundary. `CODEM_TOKEN` and the current `CODEM_SANDBOX_DISPATCH_ID` (legacy `CODEM_DISPATCH_ID`) are both required. The CLI requests public scene metadata from Base through the same gateway: Tag resolves to the persisted initiator's user identity, while Meego AI nodes resolve to bot. No UAT, RT or application secret enters the CLI. Placeholder tokens are removed before forwarding; Base obtains the Tag initiator's server-owned Web UAT through UAT Keeper and preserves official API responses. Tag has no CodeM business capability allowlist; Feishu still enforces user scopes, resource permissions and each API's supported identities. AI-node requests start with TAT and the existing Base capability and work-item policy. With the negotiated Bot-first protocol, Base alone may use the selected user UAT after an eligible permission failure, rollout checks and explicit consent for the current task. Neither path falls back to personal profiles, device-owner credentials or another identity. Local credential/install management remains owned by the CodeM host. Deploy the context-capable Base before upgrading this CLI. Help and version stay offline. Dry runs resolve the same task identity as execution. Upstream may perform a read-only user-info lookup, but does not execute the previewed business operation.
10
10
 
11
11
  Personal and sandbox modes retain the pinned official business commands, parameters and help. The CLI does not consume the capability catalog, filter commands by scene, or rewrite business options. All sandbox scenes share the same functional Skills. Legacy `CODEM_LARK_TASK_SCENE` hints are ignored. Base independently resolves the persisted task scene and authorizes every logical request; a visible command does not grant permission. Official Skills are distributed separately as `@lark-codem/codem-larkcli-plugin` and a static plugin ZIP, loaded unchanged by the existing managed-resource loader in every scene. The sandbox plugin retains only Meegle work-item operations.
12
12
 
@@ -26,6 +26,48 @@ On local installations the dependency lives inside the selected CodeM version un
26
26
 
27
27
  Tag task authorization is checked during the existing `/codem/lark-cli/context` handshake, before a business request is constructed. A missing server grant returns a public `_codem_authorization` object (kind `server_user_authorization`, status `authorization_required`). The CLI emits that object to stdout and exits nonzero; the host displays its opaque CodeM short link and stops the turn. No token, personal profile or callback URL is read or persisted by this path. Malformed invitations, dependency failures and generic 403 responses never become authorization links.
28
28
 
29
- After the initiator confirms completion, run exactly `lark-cli whoami` in the same task. For Tag this checks Base's keeper directly and reports identity `user` with `_codem_authorization.status=ready`, without an extra user-info API or replaying the blocked operation. If the grant is still absent, the new check may create a fresh invitation; display the current link and stop rather than polling. AI-node identity and capability policy are unchanged. Deploy the context authorization support in Base !2126 first, then release this adapter and the paired Bridge !709 instructions. Existing package versions remain immutable.
29
+ After the initiator confirms completion, run exactly `lark-cli whoami` in the same task. For Tag this checks Base's keeper directly and reports identity `user` with `_codem_authorization.status=ready`, without an extra user-info API or replaying the blocked operation. If the grant is still absent, the new check may create a fresh invitation; display the current link and stop rather than polling. Deploy the context authorization support in Base !2126 first, then release this adapter and the paired Bridge !709 instructions. Existing package versions remain immutable.
30
30
 
31
31
  When an existing Tag UAT lacks a business scope, Base may return its own HTTP 403 authorization response marked `X-Codem-Authorization: server_user_authorization`. The transport adapter projects only validated public intent fields and stops with a nonzero exit; it does not retry the business request or borrow local credentials. Later requests in the same invocation are blocked, including batch shortcuts that normally return partial results as success; partial output is preserved with an explicit authorization error and nonzero exit. Ordinary responses, attachments and streams are not buffered or interpreted. Base owns the shared scope-upgrade allowlist, initiating-user binding and callback scope validation. Missing application permissions or resource ACL failures do not enter this flow. Deploy the Base response support before releasing this adapter; previously published packages are unchanged.
32
+
33
+ Meego AI-node commands negotiate `meego-bot-first-v1`. Context always reports
34
+ `identity=bot`, with public `fallback_authorization` status; this remains true
35
+ when task consent is granted. The official CLI receives intercepted Bot and User
36
+ placeholder credentials with automatic command selection, so user-only commands
37
+ can reach Base. No real credential or execution-identity decision moves to the
38
+ client. Base attempts Bot on every request and controls eligible UAT fallback.
39
+
40
+ The first eligible permission failure can select the execution user and return a
41
+ Base-marked HTTP 403 invitation with `kind=task_user_consent` and
42
+ `status=confirmation_required`. The selected person must click “允许当前任务” on
43
+ the confirmation page. Existing UAT, opening the link, or chat confirmation does
44
+ not grant task consent. The adapter projects only validated public fields and
45
+ stops subsequent requests in the invocation with a nonzero exit. If context
46
+ already identifies a principal, invitations naming another user are rejected;
47
+ first-time selection may occur after context. A later `server_user_authorization`
48
+ invitation for an expired or insufficient UAT is accepted only after task consent
49
+ is `granted` and the same principal is named. Tokens and unknown fields remain
50
+ excluded. Denied or uncertain writes are never replayed automatically.
51
+
52
+ After feedback, `lark-cli whoami` reads Base's `fallback_authorization` without a
53
+ business request. Continue only when the same selected person's status is
54
+ `granted`; `identity=bot` remains expected. Legacy user execution and Tag retain
55
+ their `server_user_authorization`/`authorization_required` invitation and
56
+ `identity=user`/`ready` recheck contracts.
57
+
58
+ This adapter change must be included in a newly published multi-platform Lark CLI
59
+ package and pinned by the companion Bridge release before enabling Base's
60
+ `runtime_client_policy.larkProxy.meegoUserEnabled` and execution-user FG
61
+ `codem.ai_node.lark_cli_uat`. The source change does not publish packages or
62
+ change npm tags. Deploy compatible Base across the fleet before rollout; existing
63
+ published packages remain immutable. Base chooses and binds the fallback user;
64
+ the adapter never selects an owner or substitutes a local account.
65
+
66
+ ### Direct node confirmation
67
+
68
+ Base may return `task_user_consent` with `confirmation_method=ask_user`, a server-owned
69
+ `question_header`, `question` and two `options` (`允许当前节点` / `拒绝`). The adapter validates
70
+ and projects these public fields without requiring a login intent, URL or OAuth expiry.
71
+ Only Base's authenticated HITL decision grants node consent. Subsequent OAuth scope
72
+ invitations retain the existing validated short-link flow. The adapter never grants consent
73
+ or treats an agent's acknowledgement as a human decision.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-codem/lark-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2-test.20261116.1",
4
4
  "description": "Official Lark CLI with CodeM personal and task credential boundaries.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -20,12 +20,12 @@
20
20
  "test:package": "node scripts/test-package.mjs"
21
21
  },
22
22
  "optionalDependencies": {
23
- "@lark-codem/lark-cli-darwin-x64": "0.1.1",
24
- "@lark-codem/lark-cli-darwin-arm64": "0.1.1",
25
- "@lark-codem/lark-cli-linux-x64": "0.1.1",
26
- "@lark-codem/lark-cli-linux-arm64": "0.1.1",
27
- "@lark-codem/lark-cli-win32-x64": "0.1.1",
28
- "@lark-codem/lark-cli-win32-arm64": "0.1.1"
23
+ "@lark-codem/lark-cli-darwin-x64": "0.1.2-test.20261116.1",
24
+ "@lark-codem/lark-cli-darwin-arm64": "0.1.2-test.20261116.1",
25
+ "@lark-codem/lark-cli-linux-x64": "0.1.2-test.20261116.1",
26
+ "@lark-codem/lark-cli-linux-arm64": "0.1.2-test.20261116.1",
27
+ "@lark-codem/lark-cli-win32-x64": "0.1.2-test.20261116.1",
28
+ "@lark-codem/lark-cli-win32-arm64": "0.1.2-test.20261116.1"
29
29
  },
30
30
  "engines": {
31
31
  "node": ">=18"