@uxnan/shared 0.0.13-alpha.20260804 → 0.0.14-alpha.20260810
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/src/agents/agent-adapter.d.ts +2 -2
- package/dist/src/agents/agent-capabilities.d.ts +2 -4
- package/dist/src/jsonrpc/method-registry.d.ts +1 -1
- package/dist/src/jsonrpc/method-registry.js +1 -0
- package/dist/src/jsonrpc/method-registry.js.map +1 -1
- package/dist/src/jsonrpc/methods.d.ts +10 -3
- package/dist/src/models/git.d.ts +22 -0
- package/dist/src/models/usage.d.ts +1 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ equivalents (see
|
|
|
13
13
|
[`architecture/02b-contracts-and-requirements.md`](../architecture/02b-contracts-and-requirements.md)
|
|
14
14
|
§1 for the canonical contract list).
|
|
15
15
|
|
|
16
|
-
> **Status:** implemented and stable — **
|
|
16
|
+
> **Status:** implemented and stable — **70 JSON-RPC methods** + **12 streaming
|
|
17
17
|
> notifications**, kept lock-step at build time with the `METHOD_NAMES` array and
|
|
18
18
|
> the `StreamNotification` enum (a compile-time assertion in
|
|
19
19
|
> `src/jsonrpc/method-registry.ts` fails the build on any drift). Changes are
|
|
@@ -163,7 +163,7 @@ export interface IAgentAdapter {
|
|
|
163
163
|
* reachable headless plus user-defined prompt-template commands scanned from
|
|
164
164
|
* disk (optional; adapters with none simply don't implement it). `cwd` is the
|
|
165
165
|
* thread/project directory so project-scoped custom commands (`<cwd>/.claude/
|
|
166
|
-
* commands`, `<cwd>/.
|
|
166
|
+
* commands`, `<cwd>/.opencode/command`, …) are discovered alongside user-level
|
|
167
167
|
* ones. Discovery only; invocation flows through {@link sendTurn} with {@link
|
|
168
168
|
* SendTurnOptions.command}.
|
|
169
169
|
*/
|
|
@@ -172,7 +172,7 @@ export interface IAgentAdapter {
|
|
|
172
172
|
* Resolve a custom prompt-template command to the final prompt text (reads the
|
|
173
173
|
* template file from `cwd`/user config, substitutes arguments). Implemented
|
|
174
174
|
* only by adapters whose commands are prompt templates the bridge expands
|
|
175
|
-
* itself (Codex/
|
|
175
|
+
* itself (Codex/OpenCode); adapters whose commands run natively (Claude
|
|
176
176
|
* Code, ACP agents) leave it unset and receive the composed `/name args` form
|
|
177
177
|
* as {@link SendTurnOptions.text}. Throw if `name` is not a known custom command.
|
|
178
178
|
*/
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
* Source: architecture/02a-system-architecture.md §5.8.2 (adapters).
|
|
5
5
|
*/
|
|
6
6
|
export type AgentId = 'codex' | 'opencode' | 'claude-code'
|
|
7
|
-
/**
|
|
8
|
-
| 'gemini-cli'
|
|
9
|
-
/** Antigravity — Google's `agy` CLI, the successor to the deprecated Gemini CLI. */
|
|
7
|
+
/** Antigravity — Google's supported `agy` CLI. */
|
|
10
8
|
| 'antigravity-cli' | 'pi-agent'
|
|
11
9
|
/** Zero — open-source Go coding agent, driven over the Agent Client Protocol. */
|
|
12
10
|
| 'zero'
|
|
@@ -168,7 +166,7 @@ export interface AgentModel {
|
|
|
168
166
|
* (Claude Code's `/compact` sent as the prompt with `--resume`; the commands
|
|
169
167
|
* ACP agents advertise via `available_commands_update`), and
|
|
170
168
|
* - **custom** user-defined prompt-template commands (`.claude/commands`,
|
|
171
|
-
* `~/.codex/prompts`, `.
|
|
169
|
+
* `~/.codex/prompts`, `.opencode/command`) that the bridge
|
|
172
170
|
* expands itself before running a normal turn.
|
|
173
171
|
*
|
|
174
172
|
* The phone is a generic renderer: it lists the advertised commands in its `/`
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* compile-time {@link JsonRpcMethodRegistry} via the assertion below.
|
|
4
4
|
*/
|
|
5
5
|
import type { JsonRpcMethodName } from './methods.js';
|
|
6
|
-
export declare const METHOD_NAMES: readonly ["thread/list", "thread/read", "thread/start", "thread/resume", "thread/fork", "thread/setModel", "thread/rename", "thread/setAccessMode", "thread/archive", "thread/unarchive", "thread/delete", "turn/list", "turn/read", "turn/send", "turn/cancel", "queue/resume", "queue/clear", "git/status", "git/diff", "git/commit", "git/push", "git/pull", "git/checkout", "git/createBranch", "git/createWorktree", "git/stage", "git/unstage", "git/discard", "git/createPr", "git/undoCommit", "git/branches", "git/switchBranch", "git/revert", "git/deleteBranch", "git/removeWorktree", "git/log", "git/commitShow", "workspace/readFile", "workspace/readImage", "workspace/list", "workspace/searchFiles", "workspace/resolveFileLink", "workspace/browseDirs", "workspace/checkpoint", "workspace/diffCheckpoint", "workspace/applyCheckpoint", "workspace/applyPatch", "workspace/exists", "project/list", "project/resolve", "agent/list", "agent/models", "agent/commands", "agent/usageStats", "metrics/get", "metrics/export", "metrics/import", "auth/status", "auth/login", "auth/logout", "notifications/register", "notifications/update", "notifications/unregister", "bridge/status", "bridge/generatePairingQr", "bridge/connectedPhones", "bridge/disconnectPhone", "bridge/trustedDevices", "bridge/removeTrustedDevice"];
|
|
6
|
+
export declare const METHOD_NAMES: readonly ["thread/list", "thread/read", "thread/start", "thread/resume", "thread/fork", "thread/setModel", "thread/rename", "thread/setAccessMode", "thread/archive", "thread/unarchive", "thread/delete", "turn/list", "turn/read", "turn/send", "turn/cancel", "queue/resume", "queue/clear", "git/status", "git/diff", "git/commit", "git/push", "git/pull", "git/checkout", "git/createBranch", "git/createWorktree", "git/stage", "git/unstage", "git/discard", "git/createPr", "git/undoCommit", "git/branches", "git/switchBranch", "git/revert", "git/deleteBranch", "git/removeWorktree", "git/worktrees", "git/log", "git/commitShow", "workspace/readFile", "workspace/readImage", "workspace/list", "workspace/searchFiles", "workspace/resolveFileLink", "workspace/browseDirs", "workspace/checkpoint", "workspace/diffCheckpoint", "workspace/applyCheckpoint", "workspace/applyPatch", "workspace/exists", "project/list", "project/resolve", "agent/list", "agent/models", "agent/commands", "agent/usageStats", "metrics/get", "metrics/export", "metrics/import", "auth/status", "auth/login", "auth/logout", "notifications/register", "notifications/update", "notifications/unregister", "bridge/status", "bridge/generatePairingQr", "bridge/connectedPhones", "bridge/disconnectPhone", "bridge/trustedDevices", "bridge/removeTrustedDevice"];
|
|
7
7
|
export declare function isKnownMethod(method: string): method is JsonRpcMethodName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method-registry.js","sourceRoot":"","sources":["../../../src/jsonrpc/method-registry.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,kBAAkB;IAClB,aAAa;IACb,aAAa;IACb,cAAc;IACd,eAAe;IACf,aAAa;IACb,iBAAiB;IACjB,eAAe;IACf,sBAAsB;IACtB,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,WAAW;IACX,WAAW;IACX,WAAW;IACX,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,aAAa;IACb,MAAM;IACN,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,UAAU;IACV,UAAU;IACV,cAAc;IACd,kBAAkB;IAClB,oBAAoB;IACpB,WAAW;IACX,aAAa;IACb,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,kBAAkB;IAClB,YAAY;IACZ,kBAAkB;IAClB,oBAAoB;IACpB,SAAS;IACT,gBAAgB;IAChB,YAAY;IACZ,oBAAoB;IACpB,qBAAqB;IACrB,gBAAgB;IAChB,uBAAuB;IACvB,2BAA2B;IAC3B,sBAAsB;IACtB,sBAAsB;IACtB,0BAA0B;IAC1B,2BAA2B;IAC3B,sBAAsB;IACtB,kBAAkB;IAClB,WAAW;IACX,cAAc;IACd,iBAAiB;IACjB,SAAS;IACT,YAAY;IACZ,cAAc;IACd,gBAAgB;IAChB,kBAAkB;IAClB,yEAAyE;IACzE,aAAa;IACb,gBAAgB;IAChB,gBAAgB;IAChB,OAAO;IACP,aAAa;IACb,YAAY;IACZ,aAAa;IACb,uBAAuB;IACvB,wBAAwB;IACxB,sBAAsB;IACtB,0BAA0B;IAC1B,iBAAiB;IACjB,eAAe;IACf,0BAA0B;IAC1B,wBAAwB;IACxB,wBAAwB;IACxB,uBAAuB;IACvB,4BAA4B;CACpB,CAAC;AAQX,MAAM,sBAAsB,GAAqB,IAAI,CAAC;AACtD,MAAM,sBAAsB,GAAqB,IAAI,CAAC;AACtD,KAAK,sBAAsB,CAAC;AAC5B,KAAK,sBAAsB,CAAC;AAE5B,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;AAEnE,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC"}
|
|
1
|
+
{"version":3,"file":"method-registry.js","sourceRoot":"","sources":["../../../src/jsonrpc/method-registry.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,kBAAkB;IAClB,aAAa;IACb,aAAa;IACb,cAAc;IACd,eAAe;IACf,aAAa;IACb,iBAAiB;IACjB,eAAe;IACf,sBAAsB;IACtB,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,WAAW;IACX,WAAW;IACX,WAAW;IACX,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,aAAa;IACb,MAAM;IACN,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,UAAU;IACV,UAAU;IACV,cAAc;IACd,kBAAkB;IAClB,oBAAoB;IACpB,WAAW;IACX,aAAa;IACb,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,kBAAkB;IAClB,YAAY;IACZ,kBAAkB;IAClB,oBAAoB;IACpB,eAAe;IACf,SAAS;IACT,gBAAgB;IAChB,YAAY;IACZ,oBAAoB;IACpB,qBAAqB;IACrB,gBAAgB;IAChB,uBAAuB;IACvB,2BAA2B;IAC3B,sBAAsB;IACtB,sBAAsB;IACtB,0BAA0B;IAC1B,2BAA2B;IAC3B,sBAAsB;IACtB,kBAAkB;IAClB,WAAW;IACX,cAAc;IACd,iBAAiB;IACjB,SAAS;IACT,YAAY;IACZ,cAAc;IACd,gBAAgB;IAChB,kBAAkB;IAClB,yEAAyE;IACzE,aAAa;IACb,gBAAgB;IAChB,gBAAgB;IAChB,OAAO;IACP,aAAa;IACb,YAAY;IACZ,aAAa;IACb,uBAAuB;IACvB,wBAAwB;IACxB,sBAAsB;IACtB,0BAA0B;IAC1B,iBAAiB;IACjB,eAAe;IACf,0BAA0B;IAC1B,wBAAwB;IACxB,wBAAwB;IACxB,uBAAuB;IACvB,4BAA4B;CACpB,CAAC;AAQX,MAAM,sBAAsB,GAAqB,IAAI,CAAC;AACtD,MAAM,sBAAsB,GAAqB,IAAI,CAAC;AACtD,KAAK,sBAAsB,CAAC;AAC5B,KAAK,sBAAsB,CAAC;AAE5B,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;AAEnE,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* uxnandesktop/architecture/02e-bridge-integration.md §4.4.
|
|
7
7
|
*/
|
|
8
8
|
import type { AccessMode, QueuePausedReason, Thread, ThreadList, Turn, TurnList } from '../models/thread.js';
|
|
9
|
-
import type { GitBranchList, GitBranchResult, GitCommitDetails, GitCommitResult, GitCommitShowParams, GitDiff, GitLogParams, GitLogResult, GitPrResult, GitPullResult, GitPushResult, GitRepoStatus, GitWorktreeResult } from '../models/git.js';
|
|
9
|
+
import type { GitBranchList, GitBranchResult, GitCommitDetails, GitCommitResult, GitCommitShowParams, GitDiff, GitLogParams, GitLogResult, GitPrResult, GitPullResult, GitPushResult, GitRepoStatus, GitWorktreeList, GitWorktreeResult } from '../models/git.js';
|
|
10
10
|
import type { ApplyResult, BrowseResult, Checkpoint, CheckpointDiff, FileContent, ImageContent, PatchChange, TurnAttachment, WorkspaceFileTarget, WorkspaceExistsResult, WorkspaceListing, SearchFilesParams, WorkspaceSearchResult } from '../models/workspace.js';
|
|
11
11
|
import type { AuthStatus, Project } from '../models/project.js';
|
|
12
12
|
import type { ApprovalResponse } from '../models/approval.js';
|
|
@@ -99,7 +99,7 @@ export interface TurnSendParams {
|
|
|
99
99
|
* wants to handle the busy case itself).
|
|
100
100
|
* - absent — **queue it anyway**. Queueing is the safe default because the
|
|
101
101
|
* bridge can only drive ONE turn per thread: half the agents run one-shot
|
|
102
|
-
* per turn (`claude -p --resume`,
|
|
102
|
+
* per turn (`claude -p --resume`, pi, antigravity) and a second
|
|
103
103
|
* concurrent turn would put two CLI processes on the same session.
|
|
104
104
|
*
|
|
105
105
|
* Ignored when no turn is in flight — the turn simply starts.
|
|
@@ -284,7 +284,7 @@ export interface AgentCommandsParams {
|
|
|
284
284
|
agentId: AgentId;
|
|
285
285
|
/**
|
|
286
286
|
* Thread/project directory, so project-scoped custom commands (e.g.
|
|
287
|
-
* `<cwd>/.claude/commands`, `<cwd>/.
|
|
287
|
+
* `<cwd>/.claude/commands`, `<cwd>/.opencode/command`) are discovered alongside
|
|
288
288
|
* the user-level ones. Omitted → only user-level commands are returned.
|
|
289
289
|
*/
|
|
290
290
|
cwd?: string;
|
|
@@ -485,6 +485,13 @@ export interface JsonRpcMethodRegistry {
|
|
|
485
485
|
params: GitRemoveWorktreeParams;
|
|
486
486
|
result: void;
|
|
487
487
|
};
|
|
488
|
+
/** Which directories are worktrees of the repository at `cwd`. */
|
|
489
|
+
'git/worktrees': {
|
|
490
|
+
params: {
|
|
491
|
+
cwd: string;
|
|
492
|
+
};
|
|
493
|
+
result: GitWorktreeList;
|
|
494
|
+
};
|
|
488
495
|
'git/log': {
|
|
489
496
|
params: GitLogParams;
|
|
490
497
|
result: GitLogResult;
|
package/dist/src/models/git.d.ts
CHANGED
|
@@ -53,6 +53,28 @@ export interface GitWorktreeResult {
|
|
|
53
53
|
path: string;
|
|
54
54
|
branch: string;
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* One entry of `git worktree list --porcelain`.
|
|
58
|
+
*
|
|
59
|
+
* A repository's worktrees are siblings on disk, not children — a checkout of
|
|
60
|
+
* `repo` at `../repo-feature` is a peer directory with no path relationship to
|
|
61
|
+
* its main worktree. That is precisely why a client cannot infer the hierarchy
|
|
62
|
+
* from paths alone and has to be told.
|
|
63
|
+
*/
|
|
64
|
+
export interface GitWorktreeEntry {
|
|
65
|
+
/** Absolute path of the worktree. */
|
|
66
|
+
path: string;
|
|
67
|
+
/** Checked-out branch; absent when the worktree is in a detached HEAD. */
|
|
68
|
+
branch?: string;
|
|
69
|
+
/** Whether this is the repository's main worktree. */
|
|
70
|
+
isMain: boolean;
|
|
71
|
+
/** Whether `git worktree lock` has been applied to it. */
|
|
72
|
+
isLocked?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface GitWorktreeList {
|
|
75
|
+
/** The main worktree first, then the linked ones in git's own order. */
|
|
76
|
+
worktrees: GitWorktreeEntry[];
|
|
77
|
+
}
|
|
56
78
|
export interface GitBranchList {
|
|
57
79
|
/** The currently checked-out branch (`HEAD` when detached). */
|
|
58
80
|
current: string;
|
|
@@ -15,9 +15,7 @@
|
|
|
15
15
|
* user-pasted API keys.
|
|
16
16
|
*/
|
|
17
17
|
/** A coding CLI whose usage we read from its own stored token. */
|
|
18
|
-
export type UsageProvider = 'codex' | 'claude' | 'copilot'
|
|
19
|
-
/** @deprecated Legacy read-only usage source for retired Gemini CLI installs. */
|
|
20
|
-
| 'gemini' | 'grok';
|
|
18
|
+
export type UsageProvider = 'codex' | 'claude' | 'copilot' | 'grok';
|
|
21
19
|
/** Outcome of reading one provider's usage. */
|
|
22
20
|
export type UsageStatus =
|
|
23
21
|
/** Fresh quota/credit data was read. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxnan/shared",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14-alpha.20260810",
|
|
4
4
|
"description": "Shared JSON-RPC and E2EE contracts for the Uxnan ecosystem (bridge, relay, mobile).",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "Luis Donaldo Gamas Vazquez",
|