@shardflux/cli 0.20.0 → 0.23.0
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/CHANGELOG.md +312 -1
- package/README.md +242 -75
- package/dist/account-args.js +7 -2
- package/dist/account-commands.js +56 -106
- package/dist/account-pool.d.ts +19 -15
- package/dist/account-pool.js +47 -96
- package/dist/account-scope.d.ts +65 -0
- package/dist/account-scope.js +246 -0
- package/dist/acp-journal.js +58 -6
- package/dist/acp-login.d.ts +13 -5
- package/dist/acp-login.js +37 -8
- package/dist/acp-models.d.ts +6 -1
- package/dist/acp-models.js +29 -19
- package/dist/acp.js +120 -14
- package/dist/agent-commands.d.ts +4 -1
- package/dist/agent-commands.js +110 -42
- package/dist/agent-config-return.d.ts +46 -2
- package/dist/agent-config-return.js +110 -4
- package/dist/agent-credentials.js +7 -3
- package/dist/agent-repository.d.ts +16 -3
- package/dist/agent-repository.js +149 -74
- package/dist/agent-setup.d.ts +14 -3
- package/dist/agent-setup.js +78 -36
- package/dist/agent-target-commands.d.ts +20 -1
- package/dist/agent-target-commands.js +73 -31
- package/dist/agent-targets.js +6 -1
- package/dist/args.d.ts +1 -1
- package/dist/args.js +95 -54
- package/dist/bin.js +5 -1
- package/dist/browser.d.ts +13 -2
- package/dist/browser.js +30 -14
- package/dist/claude-cloud-login.d.ts +24 -2
- package/dist/claude-cloud-login.js +151 -11
- package/dist/cli-proxy-hub.d.ts +61 -25
- package/dist/cli-proxy-hub.js +202 -54
- package/dist/cli-proxy.d.ts +44 -1
- package/dist/cli-proxy.js +177 -28
- package/dist/client-settings.d.ts +39 -0
- package/dist/client-settings.js +91 -0
- package/dist/codex-cloud.d.ts +14 -4
- package/dist/codex-cloud.js +135 -31
- package/dist/codex-linux.d.ts +14 -0
- package/dist/codex-linux.js +69 -0
- package/dist/command-center-actions.js +18 -5
- package/dist/command-center-model.d.ts +2 -0
- package/dist/command-center-model.js +6 -1
- package/dist/command-center.js +3 -3
- package/dist/commands.js +173 -24
- package/dist/conversation-commands.d.ts +5 -0
- package/dist/conversation-commands.js +8 -5
- package/dist/conversation-terminal.d.ts +10 -2
- package/dist/conversation-terminal.js +78 -13
- package/dist/conversations.d.ts +86 -1
- package/dist/conversations.js +306 -23
- package/dist/desktop-linux.js +16 -3
- package/dist/device-bridge.d.ts +1 -1
- package/dist/device-bridge.js +6 -4
- package/dist/device-helper.js +43 -22
- package/dist/errors.d.ts +29 -2
- package/dist/errors.js +50 -7
- package/dist/filesystem-commands.d.ts +16 -9
- package/dist/filesystem-commands.js +133 -57
- package/dist/format.d.ts +2 -1
- package/dist/format.js +10 -1
- package/dist/handlers.js +3 -1
- package/dist/initial-prompt.d.ts +8 -0
- package/dist/initial-prompt.js +43 -1
- package/dist/large-media.d.ts +14 -0
- package/dist/large-media.js +100 -0
- package/dist/linux-terminal.d.ts +5 -3
- package/dist/linux-terminal.js +6 -20
- package/dist/local-sessions.d.ts +26 -2
- package/dist/local-sessions.js +113 -24
- package/dist/machine-setup.d.ts +11 -1
- package/dist/machine-setup.js +69 -22
- package/dist/machine-status.d.ts +67 -0
- package/dist/machine-status.js +140 -0
- package/dist/main.js +11 -13
- package/dist/menubar.d.ts +6 -5
- package/dist/menubar.js +38 -28
- package/dist/move-worktrees-restore.py +144 -0
- package/dist/move-worktrees.d.ts +69 -0
- package/dist/move-worktrees.js +252 -0
- package/dist/move.d.ts +10 -1
- package/dist/move.js +111 -16
- package/dist/onboarding.d.ts +11 -7
- package/dist/onboarding.js +63 -29
- package/dist/prepared-repository.d.ts +204 -0
- package/dist/prepared-repository.js +860 -0
- package/dist/prepared-repository.py +1307 -0
- package/dist/project-preparation.d.ts +62 -0
- package/dist/project-preparation.js +316 -0
- package/dist/project-sync-manifest.d.ts +4 -0
- package/dist/project-sync-manifest.js +5 -1
- package/dist/project-sync-transfer.js +1 -1
- package/dist/project-sync.d.ts +22 -4
- package/dist/project-sync.js +34 -8
- package/dist/project-template-setup.d.ts +33 -1
- package/dist/project-template-setup.js +59 -2
- package/dist/secret-ask.d.ts +72 -0
- package/dist/secret-ask.js +351 -0
- package/dist/seed-phases.d.ts +8 -1
- package/dist/seed-phases.js +17 -2
- package/dist/setup-cache.d.ts +7 -0
- package/dist/setup-cache.js +32 -0
- package/dist/t3-launch.d.ts +2 -1
- package/dist/t3-launch.js +12 -6
- package/dist/t3-mode.d.ts +8 -2
- package/dist/t3-mode.js +19 -4
- package/dist/t3-phone.d.ts +4 -2
- package/dist/t3-phone.js +12 -4
- package/dist/t3-proxy.d.ts +81 -0
- package/dist/t3-proxy.js +325 -0
- package/dist/terminal-apps.d.ts +168 -0
- package/dist/terminal-apps.js +574 -0
- package/dist/terminal-onboarding.js +6 -1
- package/dist/this-computer.d.ts +11 -0
- package/dist/this-computer.js +36 -0
- package/dist/thread-on-computer.js +4 -1
- package/dist/update.d.ts +2 -0
- package/dist/update.js +43 -9
- package/dist/worktree-twin.d.ts +10 -2
- package/dist/worktree-twin.js +27 -9
- package/package.json +5 -5
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import type { SyncCell } from './project-sync-transfer.js';
|
|
2
|
+
import type { OutsideFile } from './large-media.js';
|
|
3
|
+
/** One upload part. */
|
|
4
|
+
export declare const PART_BYTES: number;
|
|
5
|
+
/** Blobs of S from this size on leave the thin pack: stored when incompressible, compressed apart otherwise. */
|
|
6
|
+
export declare const LARGE_BLOB_BYTES: number;
|
|
7
|
+
/** Large media above this follow the first prompt when the caller allows it. */
|
|
8
|
+
export declare const DEFER_BYTES: number;
|
|
9
|
+
/** Parts in flight at once, and their bytes. */
|
|
10
|
+
export declare const UPLOAD_WINDOW = 4;
|
|
11
|
+
export declare const UPLOAD_BUDGET_BYTES: number;
|
|
12
|
+
/** The history the laptop sends before the cache fetches it from origin instead. */
|
|
13
|
+
export declare const ORIGIN_FIRST_BYTES: number;
|
|
14
|
+
/** The history the laptop sends before the cache takes the VM's own fetch of the branch (its boot prefetch) instead. */
|
|
15
|
+
export declare const PREFETCH_ADOPT_BYTES: number;
|
|
16
|
+
/** The local spool of generated packs (for resuming), pruned past this or a day. */
|
|
17
|
+
export declare const SPOOL_BYTES: number;
|
|
18
|
+
export interface PreparedExtra {
|
|
19
|
+
path: string;
|
|
20
|
+
sha256: string;
|
|
21
|
+
size: number;
|
|
22
|
+
mode: number;
|
|
23
|
+
symlink: boolean;
|
|
24
|
+
link_target: string;
|
|
25
|
+
}
|
|
26
|
+
export interface PreparedFile {
|
|
27
|
+
path: string;
|
|
28
|
+
oid: string;
|
|
29
|
+
size: number;
|
|
30
|
+
mode: number;
|
|
31
|
+
}
|
|
32
|
+
export interface PreparedManifest {
|
|
33
|
+
version: 2;
|
|
34
|
+
format: 'sha1' | 'sha256';
|
|
35
|
+
head: string;
|
|
36
|
+
seed: string;
|
|
37
|
+
/** The user's branch and its upstream, recreated in the VM as on this computer. */
|
|
38
|
+
branch?: string;
|
|
39
|
+
upstream?: {
|
|
40
|
+
ref: string;
|
|
41
|
+
oid: string;
|
|
42
|
+
};
|
|
43
|
+
origin: string | null;
|
|
44
|
+
repository: string;
|
|
45
|
+
worktree: string;
|
|
46
|
+
deps_hash?: string;
|
|
47
|
+
/** What Git does not hold: .env files (never in a Git object) and files whose filters change their bytes. */
|
|
48
|
+
extras: PreparedExtra[];
|
|
49
|
+
extras_key?: string;
|
|
50
|
+
/** Large untracked media, outside S: Git blobs the VM writes as files its Git ignores. */
|
|
51
|
+
files: PreparedFile[];
|
|
52
|
+
/** Deleted files S still names (only when S is HEAD: the twin snapshot was off or paused). */
|
|
53
|
+
remove: string[];
|
|
54
|
+
/** A shallow clone's boundary commits: the cache and the worktree take the same boundary. */
|
|
55
|
+
shallow?: string[];
|
|
56
|
+
}
|
|
57
|
+
export interface PreparedSnapshot {
|
|
58
|
+
revision: string;
|
|
59
|
+
manifest: PreparedManifest;
|
|
60
|
+
directory: string;
|
|
61
|
+
}
|
|
62
|
+
export interface PreparedTransfer {
|
|
63
|
+
revision: string;
|
|
64
|
+
/** S, its archive and every media file are in the cache. Otherwise `pending` names the media still to send. */
|
|
65
|
+
complete: boolean;
|
|
66
|
+
pending: string[];
|
|
67
|
+
/** Bytes of the packs generated for this transfer: history and small files; large blobs; media; the archive. */
|
|
68
|
+
history_bytes: number;
|
|
69
|
+
large_bytes: number;
|
|
70
|
+
media_bytes: number;
|
|
71
|
+
extras_bytes: number;
|
|
72
|
+
/** Part bytes sent, and bytes the VM already held. */
|
|
73
|
+
uploaded_bytes: number;
|
|
74
|
+
reused_bytes: number;
|
|
75
|
+
puts: number;
|
|
76
|
+
execs: number;
|
|
77
|
+
max_in_flight_bytes: number;
|
|
78
|
+
origin_fetched: boolean;
|
|
79
|
+
/** Media that changed on this computer after the start captured them: they never arrive as captured. */
|
|
80
|
+
changed: string[];
|
|
81
|
+
timings: Record<string, number>;
|
|
82
|
+
/** The checkout the probe made (options.apply) when the cache already held the revision. */
|
|
83
|
+
applied?: PreparedApply;
|
|
84
|
+
}
|
|
85
|
+
export interface PreparedGitConfig {
|
|
86
|
+
origin_url?: string;
|
|
87
|
+
user?: {
|
|
88
|
+
name?: string;
|
|
89
|
+
email?: string;
|
|
90
|
+
};
|
|
91
|
+
tracking?: {
|
|
92
|
+
branch: string;
|
|
93
|
+
merge: string;
|
|
94
|
+
};
|
|
95
|
+
excludes?: string;
|
|
96
|
+
}
|
|
97
|
+
export interface PreparedApply {
|
|
98
|
+
revision: string;
|
|
99
|
+
mode: 'fresh' | 'inplace' | 'existing';
|
|
100
|
+
/** Media not in the cache yet, and media landing right after the reply (Git ignores both). */
|
|
101
|
+
pending: number;
|
|
102
|
+
landing: number;
|
|
103
|
+
dependencies: number;
|
|
104
|
+
timings: Record<string, number>;
|
|
105
|
+
}
|
|
106
|
+
export declare function preparedCachePath(remote: string): string;
|
|
107
|
+
export declare const preparedDirectory: (stateDir: string, folder: string) => string;
|
|
108
|
+
/** The manifest's identity bytes: sorted keys, no spaces, UTF-8 (prepared-repository.py `canonical`). */
|
|
109
|
+
export declare function canonicalJson(value: unknown): string;
|
|
110
|
+
export declare const manifestRevision: (m: PreparedManifest) => string;
|
|
111
|
+
/** A refusal the VM half reports by reason (missing or corrupt parts, an owned worktree, ...). */
|
|
112
|
+
export declare class PreparedRefusal extends Error {
|
|
113
|
+
readonly reason: string;
|
|
114
|
+
readonly chunks: string[];
|
|
115
|
+
constructor(reason: string, message: string, chunks?: string[]);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The prepared revision of a worktree's state: S (the twin seed, already made), its large media and its extras. S's
|
|
119
|
+
* objects stay in the local repository under refs/shard/prepared/<revision> until the start that uses it is done, so a
|
|
120
|
+
* start accepted before a deadline resumes later with exactly the state it began from, whatever the user edits.
|
|
121
|
+
*/
|
|
122
|
+
export declare function capturePreparedSnapshot(stateDir: string, folder: string, seed: {
|
|
123
|
+
commit: string;
|
|
124
|
+
outside?: OutsideFile[];
|
|
125
|
+
}, origin: string | null, signal?: AbortSignal, options?: {
|
|
126
|
+
reachable?: (url: string) => boolean;
|
|
127
|
+
depsHash?: string;
|
|
128
|
+
}): Promise<PreparedSnapshot>;
|
|
129
|
+
/** The local pin of a revision's objects, once its start no longer needs them. */
|
|
130
|
+
export declare function releaseLocalSnapshot(folder: string, revision: string): Promise<void>;
|
|
131
|
+
export declare function readPreparedSnapshot(stateDir: string, folder: string, revision: string): Promise<PreparedSnapshot>;
|
|
132
|
+
/** Where a conversation start's parts go: the VM's own disk, indexed there; the cache receives them after the reply. */
|
|
133
|
+
export declare const PARTS_ROOT = "/home/user/.cache/shardflux/prepared-parts";
|
|
134
|
+
/**
|
|
135
|
+
* Sends the revision, only what the project cache lacks. Without `apply` it goes into the cache (a preparation). With
|
|
136
|
+
* `apply` (a conversation start) it is checked out at that target: in the probe's own exec when the cache already
|
|
137
|
+
* holds the revision (a warm start is one exec), otherwise from parts uploaded to the VM's disk and indexed there, with
|
|
138
|
+
* no Git work on the shared cache before the reply; the cache receives them after it. With `defer`, media beyond
|
|
139
|
+
* DEFER_BYTES wait for a later call: the result names them in `pending`, and the worktree starts without them.
|
|
140
|
+
*/
|
|
141
|
+
export declare function transferPreparedSnapshot(cell: SyncCell, folder: string, cache: string, snapshot: PreparedSnapshot, options?: {
|
|
142
|
+
signal?: AbortSignal;
|
|
143
|
+
defer?: boolean;
|
|
144
|
+
pin?: string;
|
|
145
|
+
originFirstBytes?: number;
|
|
146
|
+
apply?: PreparedApplyTarget;
|
|
147
|
+
partsDir?: string;
|
|
148
|
+
}): Promise<PreparedTransfer>;
|
|
149
|
+
/** Git settings the VM repository copies from this one: origin, identity, the branch's upstream, exclude rules. */
|
|
150
|
+
export declare function preparedGitConfig(folder: string, manifest: PreparedManifest, signal?: AbortSignal): Promise<PreparedGitConfig>;
|
|
151
|
+
export interface PreparedApplyOptions {
|
|
152
|
+
signal?: AbortSignal;
|
|
153
|
+
git?: PreparedGitConfig;
|
|
154
|
+
preparation?: boolean;
|
|
155
|
+
replacePreparation?: boolean;
|
|
156
|
+
dependencySource?: string;
|
|
157
|
+
/** A new VM: files its image left at the worktree path (outside any repository) are checked out over. */
|
|
158
|
+
adopt?: boolean;
|
|
159
|
+
/** false keeps borrowing the cache's objects; 'now' copies them before returning (a template must not borrow). */
|
|
160
|
+
dissociate?: boolean | 'now';
|
|
161
|
+
background?: boolean;
|
|
162
|
+
releasePin?: string;
|
|
163
|
+
/** A shell script the VM runs, detached, once the worktree is ready (the seed's copy to the project hub). */
|
|
164
|
+
after?: {
|
|
165
|
+
script: string;
|
|
166
|
+
args: string[];
|
|
167
|
+
};
|
|
168
|
+
/** The conversation's setup intent (recordSetupIntent), written in the same exec before its repository appears. */
|
|
169
|
+
setupIntent?: {
|
|
170
|
+
conversation: string;
|
|
171
|
+
depsHash: string;
|
|
172
|
+
};
|
|
173
|
+
/** The VM's workspace: a checkout another VM's conversation made (and a template image brought) is taken over. */
|
|
174
|
+
workspace?: string;
|
|
175
|
+
/** Media already sent land before the reply, not after it (a client that compares the worktree's files at once). */
|
|
176
|
+
landNow?: boolean;
|
|
177
|
+
}
|
|
178
|
+
/** Where and how a revision is checked out: the VM half's apply request. */
|
|
179
|
+
export interface PreparedApplyTarget {
|
|
180
|
+
root: string;
|
|
181
|
+
branch: string;
|
|
182
|
+
options?: PreparedApplyOptions;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Checks out the revision as `branch` at `root`, in one exec. Media not in the cache yet stay pending
|
|
186
|
+
* (landDeferredFiles). A root holding the same revision is left as it is; one holding another is refused, unless it is
|
|
187
|
+
* a project template's checkout or `replacePreparation`.
|
|
188
|
+
*/
|
|
189
|
+
export declare function applyPreparedSnapshot(cell: SyncCell, cache: string, revision: string, root: string, branch: string, options?: PreparedApplyOptions): Promise<PreparedApply>;
|
|
190
|
+
/** Lands media that arrived after the start (where nothing is yet: the agent's own file stands); `drop` gives up on blobs that changed. */
|
|
191
|
+
export declare function landDeferredFiles(cell: SyncCell, cache: string, revision: string, root: string, options?: {
|
|
192
|
+
signal?: AbortSignal;
|
|
193
|
+
drop?: string[];
|
|
194
|
+
}): Promise<{
|
|
195
|
+
landed: number;
|
|
196
|
+
kept: number;
|
|
197
|
+
pending: number;
|
|
198
|
+
}>;
|
|
199
|
+
export declare function prunePreparedCache(cell: SyncCell, cache: string, signal?: AbortSignal): Promise<void>;
|
|
200
|
+
/**
|
|
201
|
+
* The local spool stays bounded: a finished transfer's parts go at once; other parts and plans after a day or past
|
|
202
|
+
* the budget, oldest first; a revision's manifest and files archive (what a pending start resumes from) after a week.
|
|
203
|
+
*/
|
|
204
|
+
export declare function pruneLocalPrepared(stateDir: string, limit?: number, every?: number): Promise<void>;
|