arcane-os 0.89.0 → 0.90.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 +13 -0
- package/docs/reference/core-native-packaging.md +5 -0
- package/docs/reference/core-repositories.md +58 -6
- package/docs/reference/git-text-snapshot.md +16 -1
- package/docs/reference/inventory/package-api.json +13 -13
- package/docs/reference/local-ai.md +22 -6
- package/docs/reference/sdk-api.md +68 -13
- package/package.json +1 -1
- package/src/core/repositories.mjs +7 -6
- package/src/git-text-snapshot.mjs +4 -2
- package/src/repository.mjs +33 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.90.0
|
|
4
|
+
|
|
5
|
+
- Add optional `remoteBase` to repository workspaces, Git text snapshots and
|
|
6
|
+
explicit pull/push targets. Applications can declare a remote as a local
|
|
7
|
+
filesystem locator and capture its native absolute Git argument before
|
|
8
|
+
asynchronous work or queueing, independently of later directory changes.
|
|
9
|
+
- Preserve original remote, ref and base text in public outcomes. Omission
|
|
10
|
+
retains ordinary Git remote names, URLs, SCP-like addresses and remote-helper
|
|
11
|
+
strings without guessed parsing; existing identity, cancellation, complete
|
|
12
|
+
diagnostics and configured-operation behavior remain unchanged.
|
|
13
|
+
- Reuse the retained compatible Windows host, Whisper and ONNX runtime assets
|
|
14
|
+
on this numeric release. No native implementation change is included.
|
|
15
|
+
|
|
3
16
|
## 0.89.0
|
|
4
17
|
|
|
5
18
|
- Add explicitly selected clone-local author name/email before the first
|
|
@@ -401,6 +401,11 @@ or service. Availability of a particular engine belongs to the selected
|
|
|
401
401
|
local-AI installer and service; a generic ONNX runtime is not a speech model.
|
|
402
402
|
|
|
403
403
|
Selected `onnx` bundles its complete managed `onnxruntime-node` dependency tree.
|
|
404
|
+
For the SDK-selected Windows x64 ONNX `1.30.0` distribution, that tree includes
|
|
405
|
+
the corrected native libraries and its runtime record retains
|
|
406
|
+
`nativeDistributionRevision: '1.30.0-directml-reshape-1'`. See
|
|
407
|
+
[ONNX runtime preparation](local-ai.md#development) for selection,
|
|
408
|
+
release-asset acquisition and existing-installation behavior.
|
|
404
409
|
Its `modulePath` resolves against the artifact root just as a server runtime's
|
|
405
410
|
`executable` does. Library/module records need no executable. The generated Core
|
|
406
411
|
service exposes retained worker sessions through `onnx.load/run/unload/status`;
|
|
@@ -47,7 +47,7 @@ const status = await repository.status({signal});
|
|
|
47
47
|
await repository.close();
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
`createRepositoryWorkspace({name,directory,dataRoot,remote,branch,longPaths,cloneIdentity,gitIdentity,onEvent,run}={})`
|
|
50
|
+
`createRepositoryWorkspace({name,directory,dataRoot,remote,remoteBase,branch,longPaths,cloneIdentity,gitIdentity,onEvent,run}={})`
|
|
51
51
|
returns `{directory,open,status,configuration,pull,push,write,close,drain,dispose}`. The `directory`
|
|
52
52
|
property is the absolute selected working path.
|
|
53
53
|
|
|
@@ -63,6 +63,10 @@ property is the absolute selected working path.
|
|
|
63
63
|
`branch`, when supplied, is passed unchanged to Git's `clone --branch` option;
|
|
64
64
|
otherwise Git selects the remote's default branch. Existing checkouts keep
|
|
65
65
|
their own branch, remote, tracked files, untracked files and local changes.
|
|
66
|
+
- Supplying `remoteBase` explicitly declares this initial-clone `remote` to be
|
|
67
|
+
a local filesystem locator. Its native absolute command argument is captured
|
|
68
|
+
during construction. Omission leaves Git's original string interpretation
|
|
69
|
+
unchanged. See [relative local repository locators](#relative-local-repository-locators).
|
|
66
70
|
- Optional `longPaths` is a boolean for newly cloned Windows checkouts. Explicit
|
|
67
71
|
`true` or `false` supplies `clone --config core.longpaths=<value>`, so Git
|
|
68
72
|
writes that choice to the new repository before its first checkout. Omission
|
|
@@ -173,13 +177,13 @@ commands for an attached local branch, or three otherwise. Results are not a
|
|
|
173
177
|
transaction with later work or external Git activity. The app owns any decision
|
|
174
178
|
that the current checkout corresponds to its selected repository and branch.
|
|
175
179
|
|
|
176
|
-
The optional `target:{remote,ref}` on `pull`, `push` and `write` selects
|
|
177
|
-
operation's Git destination.
|
|
180
|
+
The optional `target:{remote,ref,remoteBase?}` on `pull`, `push` and `write` selects
|
|
181
|
+
that operation's Git destination. `remote` and `ref` are nonempty strings representable by
|
|
178
182
|
the native process transport. The SDK captures their exact strings when the
|
|
179
183
|
call is accepted; later edits to the target object or UI selection cannot
|
|
180
184
|
redirect queued or active work. Git owns ref parsing, URL interpretation,
|
|
181
185
|
credentials, hooks and remote outcomes. This target is independent of the
|
|
182
|
-
factory's `remote`/`branch`, which remain initial-clone inputs only.
|
|
186
|
+
factory's `remote`/`remoteBase`/`branch`, which remain initial-clone inputs only.
|
|
183
187
|
|
|
184
188
|
```javascript
|
|
185
189
|
const observed = await repository.configuration({signal});
|
|
@@ -208,6 +212,54 @@ observe, refresh, write and publish. See Git's [pull](https://git-scm.com/docs/g
|
|
|
208
212
|
[push](https://git-scm.com/docs/git-push) and [configuration](https://git-scm.com/docs/git-config)
|
|
209
213
|
contracts.
|
|
210
214
|
|
|
215
|
+
### Relative local repository locators
|
|
216
|
+
|
|
217
|
+
`remoteBase` is an explicit local-path choice, not a hint for a URL parser.
|
|
218
|
+
With it, the SDK derives the Git remote argument using the host's native
|
|
219
|
+
`path.resolve(remoteBase, remote)`. A relative base, including `''` for the
|
|
220
|
+
current directory, is resolved once when a workspace/snapshot owner is
|
|
221
|
+
constructed or a targeted operation is accepted. Later working-directory or
|
|
222
|
+
options-object changes cannot redirect that accepted operation. Base text
|
|
223
|
+
must be representable as a native filesystem path; invalid non-string, NUL or
|
|
224
|
+
unpaired-surrogate input reports `TypeError` without changing the supplied text.
|
|
225
|
+
|
|
226
|
+
Use the same selected absolute base for owners created at different times:
|
|
227
|
+
|
|
228
|
+
```javascript
|
|
229
|
+
import {createGitTextSnapshot} from 'arcane-os';
|
|
230
|
+
import {createRepositoryWorkspace} from 'arcane-os/core/repositories';
|
|
231
|
+
|
|
232
|
+
const remote = connection.locator; // Keep the original catalog string.
|
|
233
|
+
const remoteBase = connection.localBaseDirectory; // App-selected absolute base.
|
|
234
|
+
const repository = createRepositoryWorkspace({name: connection.name, remote, remoteBase});
|
|
235
|
+
const snapshot = createGitTextSnapshot({
|
|
236
|
+
cacheDirectory: connection.cacheDirectory,
|
|
237
|
+
remote, remoteBase, ref: connection.ref, selectPath: applicationSelectPath
|
|
238
|
+
});
|
|
239
|
+
const target = {remote, remoteBase, ref: connection.ref};
|
|
240
|
+
await repository.write({files: selectedFiles, message, target, signal});
|
|
241
|
+
// This reader wants the newly published selection, so refresh after the write.
|
|
242
|
+
await snapshot.refresh({signal});
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
The original locator and ref remain unchanged. Public targeted results and
|
|
246
|
+
writer failure outcomes also retain the explicitly supplied original
|
|
247
|
+
`remoteBase`, including its relative spelling or empty string; the derived
|
|
248
|
+
absolute argument stays with the Git invocation. No catalog/configuration
|
|
249
|
+
rewrite, directory change or extra Git command is introduced. The existing
|
|
250
|
+
Git clone may save its supplied remote argument as its ordinary origin setting.
|
|
251
|
+
|
|
252
|
+
Omit `remoteBase` for configured names such as `origin`, URLs, SCP-like addresses,
|
|
253
|
+
remote-helper syntax, or any other string Git should interpret normally. With
|
|
254
|
+
an explicit base, even `origin` means the local path under that base. The SDK
|
|
255
|
+
does not infer intent from slashes, colons or platform path spelling. Factory
|
|
256
|
+
`remoteBase` affects only cloning; an individual pull/push/write uses only its
|
|
257
|
+
own `target.remoteBase`. Omitting `target` retains configured Git behavior.
|
|
258
|
+
The public `repositoryPull` and `repositoryPush` functions accept the same
|
|
259
|
+
target field and capture it before their first asynchronous status operation.
|
|
260
|
+
Actual filesystem, Git, credential and remote failures retain their existing
|
|
261
|
+
complete diagnostics; this option adds no fallback, retry or unborn-state rule.
|
|
262
|
+
|
|
211
263
|
## Git identity configuration
|
|
212
264
|
|
|
213
265
|
```javascript
|
|
@@ -438,8 +490,8 @@ Successful completion returns:
|
|
|
438
490
|
|
|
439
491
|
Each output record retains complete stdout/stderr. `code` and the process
|
|
440
492
|
termination `signal` are included when a completed process result is available.
|
|
441
|
-
When supplied, `target:{remote,ref}` is included in the result or
|
|
442
|
-
with the original accepted strings.
|
|
493
|
+
When supplied, `target:{remote,ref,remoteBase?}` is included in the result or
|
|
494
|
+
failure outcome with the original accepted strings.
|
|
443
495
|
An in-progress write also records its current `path` on a failure outcome.
|
|
444
496
|
`writtenPaths` records successful filesystem writes in input order; `written`
|
|
445
497
|
becomes true only after every requested write succeeds. The other booleans
|
|
@@ -33,12 +33,27 @@ policy stable for the lifetime of its snapshot owner.
|
|
|
33
33
|
|
|
34
34
|
## API and lifecycle
|
|
35
35
|
|
|
36
|
-
`createGitTextSnapshot({cacheDirectory,remote,ref,selectPath,gitIdentity,onEvent,run})`
|
|
36
|
+
`createGitTextSnapshot({cacheDirectory,remote,remoteBase,ref,selectPath,gitIdentity,onEvent,run})`
|
|
37
37
|
returns `{refresh,close,drain,dispose}`. `run` defaults to the SDK's existing
|
|
38
38
|
`runProcess`; applications normally omit it. It is the same process adapter
|
|
39
39
|
contract, not a second process supervisor. `onEvent` is the ordinary SDK event
|
|
40
40
|
callback and follows its asynchronous completion/error contract.
|
|
41
41
|
|
|
42
|
+
Optional `remoteBase` explicitly selects `remote` as a local filesystem locator.
|
|
43
|
+
The owner derives its native absolute Git argument once during construction
|
|
44
|
+
using `path.resolve(remoteBase, remote)`, independently of the cache location
|
|
45
|
+
and later working-directory changes. A relative base is captured against the
|
|
46
|
+
construction-time working directory; `''` explicitly selects that directory.
|
|
47
|
+
The caller's original locator and options remain unchanged. Without this field,
|
|
48
|
+
every existing Git remote string keeps its ordinary meaning; the SDK does not
|
|
49
|
+
guess whether a name, URL, colon or slash describes a local path.
|
|
50
|
+
|
|
51
|
+
Use the same app-selected absolute base for snapshot, workspace clone and each
|
|
52
|
+
explicit pull/push/write target. Factory clone inputs do not become operation
|
|
53
|
+
targets. See [relative local repository locators](core-repositories.md#relative-local-repository-locators)
|
|
54
|
+
for the shared contract, original target outcomes and example. This option adds
|
|
55
|
+
no I/O, remote probe, configuration change, retry or empty-remote success path.
|
|
56
|
+
|
|
42
57
|
Optional `gitIdentity:{name?,email?,username?}` uses the shared
|
|
43
58
|
[Git identity configuration contract](core-repositories.md#git-identity-configuration).
|
|
44
59
|
Supplied strings are captured during construction and accompany every Git
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"sdkVersion": "0.
|
|
3
|
+
"sdkVersion": "0.89.0",
|
|
4
4
|
"environment": {
|
|
5
5
|
"runtime": "Node.js for Node entrypoints; browser for browser-only entrypoints",
|
|
6
6
|
"minimumVersion": "22.23.2 for Node entrypoints",
|
|
@@ -311,14 +311,14 @@
|
|
|
311
311
|
"name": "createRepositoryWorkspace",
|
|
312
312
|
"displayName": "createRepositoryWorkspace()",
|
|
313
313
|
"kind": "function",
|
|
314
|
-
"signature": "createRepositoryWorkspace({name,directory,dataRoot,remote,branch,longPaths,cloneIdentity,gitIdentity,onEvent,run=runProcess}={})",
|
|
314
|
+
"signature": "createRepositoryWorkspace({name,directory,dataRoot,remote,remoteBase,branch,longPaths,cloneIdentity,gitIdentity,onEvent,run=runProcess}={})",
|
|
315
315
|
"entrypoints": ["arcane-os/core/repositories"],
|
|
316
316
|
"primaryImport": "arcane-os/core/repositories",
|
|
317
317
|
"group": "Native repository workspaces",
|
|
318
318
|
"summary": "Owns one selected native working checkout with ArcaneData/Repos defaults and existing Git/process lifecycle.",
|
|
319
319
|
"availability": "Node with Git on Windows, Linux and macOS; Android requires host process adaptation",
|
|
320
320
|
"protocol": "Git working repository and SDK process adapter",
|
|
321
|
-
"normalization": "Returns directory, open, status, configuration, pull, push, write and identical close/drain/dispose hooks. Only missing or empty destinations clone; existing roots are preserved. Optional longPaths captures a boolean: explicit Windows true/false supplies clone-local core.longpaths before the first checkout, persisting only in the new repository under ordinary Git configuration precedence. Omission preserves configuration; existing repositories and non-Windows clone commands remain unchanged. No global setting or migration. configuration observes the existing root, symbolic HEAD, origin URL/pushURL arrays and branch remote/merge/upstream URL arrays without clone/init/fetch, preserving unset, empty and repeated values. Explicit paths remain selected. Same-directory operations serialize within the process; cancellation and shutdown join accepted process work. pull/push/write accept a captured target {remote,ref} for current-branch fast-forward pull or non-force current-HEAD selected-ref push; omission retains ordinary configured behavior. write snapshots exact text and paths, stages/commits only literal owned paths and preserves unrelated staged files and Git filters. Complete outputs and causal failures retain confirmed local/committed/pushed and uncertain outcomes plus the supplied target. Optional gitIdentity captures name/email/username for child Git operations only; omitted fields remain inherited and identity selection writes no config file. Optional cloneIdentity captures exact name/email strings and persists only supplied fields through clone --config before the first checkout on every supported platform. Empty strings are explicit; omitted or undefined fields preserve inherited/template configuration. Existing checkouts are never reconfigured. Unrepresentable process arguments fail honestly without transforming them. This option changes no global configuration or credentials and does not identify an authenticated account; command-local gitIdentity remains independent."
|
|
321
|
+
"normalization": "Returns directory, open, status, configuration, pull, push, write and identical close/drain/dispose hooks. Only missing or empty destinations clone; existing roots are preserved. Optional factory remoteBase explicitly selects the initial-clone remote as a local filesystem locator and captures path.resolve(remoteBase, remote) once at construction. A relative base, including an empty string, uses the construction-time working directory. Only the Git argument is derived; the caller's original locator remains unchanged. Omission preserves every Git remote name, URL, SCP-like address and remote-helper string without guessed parsing. Optional longPaths captures a boolean: explicit Windows true/false supplies clone-local core.longpaths before the first checkout, persisting only in the new repository under ordinary Git configuration precedence. Omission preserves configuration; existing repositories and non-Windows clone commands remain unchanged. No global setting or migration. configuration observes the existing root, symbolic HEAD, origin URL/pushURL arrays and branch remote/merge/upstream URL arrays without clone/init/fetch, preserving unset, empty and repeated values. Explicit paths remain selected. Same-directory operations serialize within the process; cancellation and shutdown join accepted process work. pull/push/write accept a captured target {remote,ref,remoteBase?} for current-branch fast-forward pull or non-force current-HEAD selected-ref push; omission retains ordinary configured behavior. An operation's own remoteBase declares local-path intent and captures its native absolute argument once at acceptance, before queueing; factory remote/remoteBase/branch remain independent clone inputs. Targeted pull/push results and writer results/failure outcomes retain the original remote, ref and supplied remoteBase, including relative or empty base text. Unrepresentable base text reports TypeError without transformation. write snapshots exact text and paths, stages/commits only literal owned paths and preserves unrelated staged files and Git filters. Complete outputs and causal failures retain confirmed local/committed/pushed and uncertain outcomes plus the supplied target. Optional gitIdentity captures name/email/username for child Git operations only; omitted fields remain inherited and identity selection writes no config file. Optional cloneIdentity captures exact name/email strings and persists only supplied fields through clone --config before the first checkout on every supported platform. Empty strings are explicit; omitted or undefined fields preserve inherited/template configuration. Existing checkouts are never reconfigured. Unrepresentable process arguments fail honestly without transforming them. This option changes no global configuration or credentials and does not identify an authenticated account; command-local gitIdentity remains independent."
|
|
322
322
|
},
|
|
323
323
|
{
|
|
324
324
|
"id": "core-repositories:readGitIdentity",
|
|
@@ -493,14 +493,14 @@
|
|
|
493
493
|
"name": "createGitTextSnapshot",
|
|
494
494
|
"displayName": "createGitTextSnapshot()",
|
|
495
495
|
"kind": "function",
|
|
496
|
-
"signature": "createGitTextSnapshot({cacheDirectory,remote,ref,selectPath,gitIdentity,onEvent,run=runProcess}={})",
|
|
496
|
+
"signature": "createGitTextSnapshot({cacheDirectory,remote,remoteBase,ref,selectPath,gitIdentity,onEvent,run=runProcess}={})",
|
|
497
497
|
"entrypoints": ["arcane-os"],
|
|
498
498
|
"primaryImport": "arcane-os",
|
|
499
499
|
"group": "Workspace, doctor, repository, and server",
|
|
500
500
|
"summary": "Reads complete selected text from one fetched revision using a dedicated bare Git object cache and batched retrieval.",
|
|
501
501
|
"availability": "Node with Git; Android requires a host supplying Git/process capability",
|
|
502
502
|
"protocol": "Git tree and batched blob transport through the shared process owner",
|
|
503
|
-
"normalization": "Returns {refresh,close,drain,dispose}; refresh yields {revision,files:[{path,content}]}, shares concurrent work, reuses unchanged revisions, preserves exact UTF-8 text, isolates caller cancellation and drains accepted work. Optional gitIdentity captures name/email/username for child Git commands including bare init and fetch, without changing config files, payloads or shared acquisition lifetime. See git-text-snapshot.md."
|
|
503
|
+
"normalization": "Returns {refresh,close,drain,dispose}; refresh yields {revision,files:[{path,content}]}, shares concurrent work, reuses unchanged revisions, preserves exact UTF-8 text, isolates caller cancellation and drains accepted work. Optional remoteBase explicitly selects remote as a local filesystem locator and derives only its Git fetch argument through path.resolve(remoteBase, remote), once at construction independently of the cache location and later working-directory changes. A relative base, including an empty string, uses the construction-time working directory; original locator/options remain unchanged. Omission preserves every Git remote name, URL, SCP-like address and remote-helper string without guessed parsing. Unrepresentable base text reports TypeError without transformation; existing Git failures remain errors. Optional gitIdentity captures name/email/username for child Git commands including bare init and fetch, without changing config files, payloads or shared acquisition lifetime. See git-text-snapshot.md."
|
|
504
504
|
},
|
|
505
505
|
{
|
|
506
506
|
"id": "diarization:createDiarization",
|
|
@@ -609,10 +609,10 @@
|
|
|
609
609
|
"entrypoints": ["arcane-os/local-ai"],
|
|
610
610
|
"primaryImport": "arcane-os/local-ai",
|
|
611
611
|
"group": "Core local AI",
|
|
612
|
-
"summary": "Reuses selected managed native runtimes or installs complete
|
|
613
|
-
"availability": "Node;
|
|
614
|
-
"protocol": "
|
|
615
|
-
"normalization": "Returns absolute runtime records, including image library/binding/variant/model metadata; shares matching installs, preserves libraries, reports failures without changing global PATH or services and prepares no model files"
|
|
612
|
+
"summary": "Reuses selected managed native runtimes or installs complete llama.cpp/Ollama/image distributions, ONNX npm runtime trees with selected SDK native libraries, or NeMo libraries.",
|
|
613
|
+
"availability": "Node; selected distribution platform and architecture assets determine runtime availability",
|
|
614
|
+
"protocol": "Upstream release archives and selected ONNX/Koffi npm installations; corrected Windows x64 ONNX native libraries from the installed SDK numeric release",
|
|
615
|
+
"normalization": "Returns absolute runtime records, including image library/binding/variant/model metadata; Windows x64 ONNX with no explicit URL and omitted version or 1.30.0 adds nativeDistributionRevision 1.30.0-directml-reshape-1, reuses that revision or prepares a fresh installation while preserving older trees; explicit URLs and other ONNX versions/platforms retain their upstream package path; shares matching installs, preserves libraries, reports failures without changing global PATH or services and prepares no model files"
|
|
616
616
|
},
|
|
617
617
|
{
|
|
618
618
|
"id": "local-ai:bundleLocalAIRuntimes",
|
|
@@ -624,9 +624,9 @@
|
|
|
624
624
|
"primaryImport": "arcane-os/local-ai",
|
|
625
625
|
"group": "Core local AI",
|
|
626
626
|
"summary": "Copies selected complete runtime distributions into a fresh native artifact staging root.",
|
|
627
|
-
"availability": "Node; supports bundling published
|
|
627
|
+
"availability": "Node; supports bundling selected published platform assets independently of the build host",
|
|
628
628
|
"protocol": "Artifact-relative runtime/local-ai layout",
|
|
629
|
-
"normalization": "Returns {runtimes,files} with artifact-relative runtime/variant paths and complete inventory; image URL descriptors remain for post-launch preparation and external model working paths report portability incompatibility"
|
|
629
|
+
"normalization": "Returns {runtimes,files} with artifact-relative runtime/variant paths and complete inventory; corrected Windows x64 ONNX retains nativeDistributionRevision and complete native libraries while modulePath becomes artifact-relative; image URL descriptors remain for post-launch preparation and external model working paths report portability incompatibility"
|
|
630
630
|
},
|
|
631
631
|
{
|
|
632
632
|
"id": "root:WS",
|
|
@@ -2269,7 +2269,7 @@
|
|
|
2269
2269
|
"summary": "Runs one fast-forward-only pull into the selected clean worktree, optionally from a captured remote/ref target.",
|
|
2270
2270
|
"availability": "Node; network-assisted Git",
|
|
2271
2271
|
"protocol": "Node ESM",
|
|
2272
|
-
"normalization": "
|
|
2272
|
+
"normalization": "Optional target {remote,ref,remoteBase?} is captured before the first asynchronous status operation. A supplied remoteBase declares local-path intent and derives only the Git remote argument using path.resolve(remoteBase, remote), once at acceptance; relative and empty bases use that working directory. Omitted remoteBase preserves Git remote names, URLs, SCP-like addresses and remote-helper strings unchanged. Targeted results retain original remote/ref/supplied remoteBase text and complete stdout/stderr alongside the existing pull result. Unrepresentable base text reports TypeError without transformation. Omitted target preserves configured pull behavior and result shape; clean-worktree, fast-forward-only, cancellation and actual Git error behavior remain unchanged."
|
|
2273
2273
|
},
|
|
2274
2274
|
{
|
|
2275
2275
|
"id": "root:repositoryPush",
|
|
@@ -2285,7 +2285,7 @@
|
|
|
2285
2285
|
"summary": "Pushes the attached branch through ordinary configured Git or an explicit captured current-HEAD destination without force.",
|
|
2286
2286
|
"availability": "Node; network-assisted Git",
|
|
2287
2287
|
"protocol": "Node ESM",
|
|
2288
|
-
"normalization": "
|
|
2288
|
+
"normalization": "Optional target {remote,ref,remoteBase?} is captured before the first asynchronous status operation. A supplied remoteBase declares local-path intent and derives only the Git remote argument using path.resolve(remoteBase, remote), once at acceptance; relative and empty bases use that working directory. Omitted remoteBase preserves Git remote names, URLs, SCP-like addresses and remote-helper strings unchanged. Targeted results retain original remote/ref/supplied remoteBase text and complete stdout/stderr alongside the existing push result. Unrepresentable base text reports TypeError without transformation. Omitted target preserves configured push behavior and result shape; attached-branch, non-force current-HEAD publication, cancellation and actual Git error behavior remain unchanged."
|
|
2289
2289
|
},
|
|
2290
2290
|
{
|
|
2291
2291
|
"id": "root:repositoryStatus",
|
|
@@ -138,10 +138,23 @@ Zstandard archives use the supported Node runtime's decompressor.
|
|
|
138
138
|
|
|
139
139
|
Selected ONNX preparation installs `onnxruntime-node@1.30.0` by default into a
|
|
140
140
|
managed npm prefix, retaining its complete published runtime dependency tree.
|
|
141
|
-
|
|
141
|
+
The npm installation skips supplementary upstream GPU downloads. On Windows
|
|
142
|
+
x64, an omitted version or explicit `1.30.0`, with no explicit `url`, also
|
|
143
|
+
selects the SDK's corrected native distribution, revision
|
|
144
|
+
`1.30.0-directml-reshape-1`. The installer downloads
|
|
145
|
+
`arcane-onnx-runtime-windows-x64.tar.gz` from the installed `arcane-os` package's
|
|
146
|
+
numeric GitHub release and extracts its native libraries into the new
|
|
147
|
+
installation. Its URL is
|
|
148
|
+
`https://github.com/TheWizardNexus/arcane-os-sdk/releases/download/<sdk-version>/arcane-onnx-runtime-windows-x64.tar.gz`.
|
|
149
|
+
The same-version npm JavaScript and binding remain in place. Explicit URLs,
|
|
150
|
+
other ONNX versions and other platform/architecture selections retain their
|
|
151
|
+
upstream package path. For the corrected selection, an existing installation
|
|
152
|
+
without the matching `nativeDistributionRevision` is left intact and a fresh
|
|
153
|
+
installation is prepared; running installations keep their original trees.
|
|
142
154
|
Node/npm must be available while preparing that runtime; a native app consumes
|
|
143
155
|
the bundled tree without installing it again. Applications that omit ONNX do
|
|
144
|
-
not install its package.
|
|
156
|
+
not install its package. Runtime preparation alone establishes no model or
|
|
157
|
+
device execution result.
|
|
145
158
|
|
|
146
159
|
For the optional development browser connection, load the bootstrap after the
|
|
147
160
|
managed import map and before creating a Core-backed provider:
|
|
@@ -722,7 +735,7 @@ not execution evidence on each platform.
|
|
|
722
735
|
|
|
723
736
|
## Native bundling
|
|
724
737
|
|
|
725
|
-
The SDK portable native build includes selected
|
|
738
|
+
The SDK portable native build includes complete selected runtime trees under
|
|
726
739
|
`runtime/local-ai/<runtime-id>`. Runtime records in the artifact are relative
|
|
727
740
|
to the artifact root and resolve on the destination machine. The generated
|
|
728
741
|
Core entry composes the local AI service only when the application selects it.
|
|
@@ -732,13 +745,16 @@ Model files remain application-selected native resources.
|
|
|
732
745
|
`arcane-os/local-ai`. Both accept `{runtimes,directory,platform,architecture,
|
|
733
746
|
signal,onEvent}`; bundling also requires `outputRoot`. Platform names follow
|
|
734
747
|
Node: `win32`, `linux`, `darwin`, and supported Android distributions.
|
|
735
|
-
Architectures are `x64` or `arm64`. Availability depends on the
|
|
736
|
-
|
|
748
|
+
Architectures are `x64` or `arm64`. Availability depends on the selected
|
|
749
|
+
distribution's published platform assets; Ollama has no official Android runtime
|
|
737
750
|
archive in this installer.
|
|
738
751
|
|
|
739
752
|
Ensure returns absolute `{id,version,platform,architecture,root}` records.
|
|
740
753
|
Server runtimes also include `executable`; ONNX includes `modulePath` pointing
|
|
741
|
-
to its public package entry.
|
|
754
|
+
to its public package entry. The corrected Windows x64 ONNX selection also
|
|
755
|
+
includes `nativeDistributionRevision: '1.30.0-directml-reshape-1'`; bundling
|
|
756
|
+
retains that metadata with the complete native libraries. Image records include
|
|
757
|
+
`libraryPath`,
|
|
742
758
|
`bindingModulePath`, requested `backend`, installed `variants` and selected
|
|
743
759
|
`models` metadata. Variant records carry backend, runtime root and library path.
|
|
744
760
|
Bundle returns `{runtimes,files}`,
|
|
@@ -3831,12 +3831,21 @@ async repositoryPull({ workspaceRoot=process.cwd(), target, signal, onEvent, run
|
|
|
3831
3831
|
|
|
3832
3832
|
Import it from `arcane-os`. The signature above states whether settlement is synchronous or promise-based. The overview and owning group define result authority, side effects, callbacks, events, cancellation, and lifecycle.
|
|
3833
3833
|
|
|
3834
|
-
Optional `target:{remote,ref}` captures exact nonempty
|
|
3835
|
-
strings before any wait and selects
|
|
3834
|
+
Optional `target:{remote,ref,remoteBase?}` captures the exact nonempty
|
|
3835
|
+
native-representable `remote` and `ref` strings before any wait and selects
|
|
3836
|
+
`git pull --ff-only -- <remote> <ref>:`.
|
|
3836
3837
|
The current clean branch receives a fast-forward-only integration; the SDK
|
|
3837
3838
|
never switches branches, resets or changes configuration. Without a target,
|
|
3838
3839
|
the existing configured pull and result remain unchanged. Targeted results
|
|
3839
3840
|
add `target`, complete `stdout` and `stderr` to the existing pull result.
|
|
3841
|
+
|
|
3842
|
+
Supplying `target.remoteBase` explicitly selects a local filesystem locator:
|
|
3843
|
+
only the Git remote argument becomes `path.resolve(remoteBase, remote)`, captured
|
|
3844
|
+
once at acceptance before status work. Relative bases, including `''`, use the
|
|
3845
|
+
working directory at that moment. The returned target retains the original
|
|
3846
|
+
`remote`, `ref` and supplied base text. Omission preserves Git remote names,
|
|
3847
|
+
URLs, SCP-like addresses and remote-helper strings without guessed parsing.
|
|
3848
|
+
Unrepresentable base text reports `TypeError` without transformation.
|
|
3840
3849
|
See [checkout configuration and selected targets](core-repositories.md#existing-checkout-configuration-and-selected-targets).
|
|
3841
3850
|
|
|
3842
3851
|
### Availability and normalization
|
|
@@ -3877,20 +3886,29 @@ detached HEAD, then, without `target`, runs plain `git push`; the repository's c
|
|
|
3877
3886
|
configured upstream/remote, Git credentials, hooks, and server policy remain
|
|
3878
3887
|
authoritative. Unlike `repositoryPull()`, this function does **not** require a
|
|
3879
3888
|
clean worktree. It does not create a commit or choose an application destination.
|
|
3880
|
-
Optional `target:{remote,ref}` captures the original nonempty
|
|
3881
|
-
native-representable strings before any wait and runs
|
|
3889
|
+
Optional `target:{remote,ref,remoteBase?}` captures the original nonempty
|
|
3890
|
+
native-representable `remote` and `ref` strings before any wait and runs
|
|
3882
3891
|
`git push --no-follow-tags -- <remote> HEAD:<ref>`. This publishes current HEAD
|
|
3883
3892
|
to the caller-selected ref without force or implicit configured tag following.
|
|
3884
3893
|
It changes no branch or Git configuration; credentials, URL interpretation,
|
|
3885
3894
|
hooks and remote rejection remain Git-owned.
|
|
3886
3895
|
|
|
3896
|
+
Supplying `target.remoteBase` explicitly selects a local filesystem locator:
|
|
3897
|
+
only the Git remote argument becomes `path.resolve(remoteBase, remote)`, captured
|
|
3898
|
+
once at acceptance before status work. Relative bases, including `''`, use the
|
|
3899
|
+
working directory at that moment. Later directory or target-object changes do
|
|
3900
|
+
not redirect accepted work. Omission preserves Git remote names, URLs, SCP-like
|
|
3901
|
+
addresses and remote-helper strings without guessed parsing. Unrepresentable
|
|
3902
|
+
base text reports `TypeError` without transformation.
|
|
3903
|
+
|
|
3887
3904
|
The promise resolves to
|
|
3888
3905
|
`{action:'push', repositoryRoot, branch, output}`. `output` is trimmed stdout,
|
|
3889
3906
|
or trimmed stderr when stdout is empty. A missing Git executable, failed status
|
|
3890
3907
|
probe, rejected/nonzero push, cancellation, or event-callback failure rejects
|
|
3891
3908
|
with the normalized process error. Cancellation stops the local process tree;
|
|
3892
3909
|
it cannot prove that a remote accepted no objects before the interruption.
|
|
3893
|
-
Targeted results also contain the captured `target
|
|
3910
|
+
Targeted results also contain the captured `target`, retaining original
|
|
3911
|
+
`remote`, `ref` and any supplied `remoteBase`, and complete
|
|
3894
3912
|
`stdout`/`stderr`; omitting the target preserves the existing result shape.
|
|
3895
3913
|
See [checkout configuration and selected targets](core-repositories.md#existing-checkout-configuration-and-selected-targets).
|
|
3896
3914
|
|
|
@@ -5367,7 +5385,7 @@ a dedicated bare Git cache. It does not create or alter a working checkout.
|
|
|
5367
5385
|
### Signature, lifecycle, and result
|
|
5368
5386
|
|
|
5369
5387
|
```text
|
|
5370
|
-
createGitTextSnapshot({cacheDirectory,remote,ref,selectPath,gitIdentity,onEvent,run=runProcess}={})
|
|
5388
|
+
createGitTextSnapshot({cacheDirectory,remote,remoteBase,ref,selectPath,gitIdentity,onEvent,run=runProcess}={})
|
|
5371
5389
|
```
|
|
5372
5390
|
|
|
5373
5391
|
Import from `arcane-os`. The application owns the cache location, remote, ref,
|
|
@@ -5379,6 +5397,16 @@ await accepted refresh/process cleanup. Errors remain observable instead of
|
|
|
5379
5397
|
returning stale or partial success. See [Git text snapshots](git-text-snapshot.md)
|
|
5380
5398
|
for complete inputs, text semantics, errors, events and Core service composition.
|
|
5381
5399
|
|
|
5400
|
+
Optional `remoteBase` explicitly selects `remote` as a local filesystem locator.
|
|
5401
|
+
Only its Git fetch argument is derived using `path.resolve(remoteBase, remote)`,
|
|
5402
|
+
once at construction, independently of the cache location and later changes to
|
|
5403
|
+
the working directory. Relative bases, including `''`, use the construction-time
|
|
5404
|
+
working directory. Original locator/options remain unchanged. Omission preserves
|
|
5405
|
+
Git remote names, URLs, SCP-like addresses and remote-helper strings without
|
|
5406
|
+
guessed parsing. Unrepresentable base text reports `TypeError` without
|
|
5407
|
+
transformation; actual Git failures retain their existing error behavior.
|
|
5408
|
+
See [relative local repository locators](core-repositories.md#relative-local-repository-locators).
|
|
5409
|
+
|
|
5382
5410
|
Optional `gitIdentity:{name?,email?,username?}` captures a child-process-only
|
|
5383
5411
|
selection for init/fetch and subsequent Git commands, preserving shared refresh
|
|
5384
5412
|
cancellation and complete content. See [Git identity configuration](core-repositories.md#git-identity-configuration)
|
|
@@ -8348,7 +8376,7 @@ explicit existing path. The application owns the remote, branch and Core API.
|
|
|
8348
8376
|
### Signature and result
|
|
8349
8377
|
|
|
8350
8378
|
```text
|
|
8351
|
-
createRepositoryWorkspace({name,directory,dataRoot,remote,branch,longPaths,cloneIdentity,gitIdentity,onEvent,run=runProcess}={})
|
|
8379
|
+
createRepositoryWorkspace({name,directory,dataRoot,remote,remoteBase,branch,longPaths,cloneIdentity,gitIdentity,onEvent,run=runProcess}={})
|
|
8352
8380
|
```
|
|
8353
8381
|
|
|
8354
8382
|
Returns `{directory,open,status,configuration,pull,push,write,close,drain,dispose}`. Construction does
|
|
@@ -8359,6 +8387,16 @@ work and preserves the checkout. No CLI cwd, launch state, preference, snapshot
|
|
|
8359
8387
|
cache or existing user-data location changes. See the [complete inputs, results,
|
|
8360
8388
|
errors and lifecycle](core-repositories.md#one-connected-working-checkout).
|
|
8361
8389
|
|
|
8390
|
+
Optional factory `remoteBase` explicitly selects the initial-clone `remote` as
|
|
8391
|
+
a local filesystem locator. Only its Git argument is derived through the host's
|
|
8392
|
+
native `path.resolve(remoteBase, remote)`, once at construction. Relative bases,
|
|
8393
|
+
including `''`, use the construction-time working directory. The caller's
|
|
8394
|
+
original locator remains unchanged; Git clone may save the derived argument as
|
|
8395
|
+
its ordinary origin setting. Omission preserves Git remote names, URLs, SCP-like
|
|
8396
|
+
addresses and remote-helper strings without guessed parsing. Unrepresentable
|
|
8397
|
+
base text reports `TypeError` without transformation.
|
|
8398
|
+
See [relative local repository locators](core-repositories.md#relative-local-repository-locators).
|
|
8399
|
+
|
|
8362
8400
|
Optional `longPaths` captures a boolean for new Windows clones. Explicit true
|
|
8363
8401
|
or false supplies clone-local `core.longpaths` before the first checkout and
|
|
8364
8402
|
persists it only in the new repository. Omission preserves inherited/template
|
|
@@ -8394,11 +8432,15 @@ reports `ARCANE_GIT_CONFIGURATION_NOT_TEXT` with full diagnostics.
|
|
|
8394
8432
|
|
|
8395
8433
|
`pull({target,signal})`, `push({target,signal})` and
|
|
8396
8434
|
`write({files:[{path,content}],message,target,signal})` accept optional
|
|
8397
|
-
`target:{remote,ref}`, captured as original strings at acceptance. The target
|
|
8435
|
+
`target:{remote,ref,remoteBase?}`, captured as original strings at acceptance. The target
|
|
8398
8436
|
selects a fast-forward-only pull into the current branch or a non-force push
|
|
8399
8437
|
of current HEAD to the selected ref, without switching branches or changing
|
|
8400
|
-
configuration.
|
|
8401
|
-
|
|
8438
|
+
configuration. An operation's own `remoteBase` declares local-path intent and
|
|
8439
|
+
captures the native absolute Git argument once at acceptance, before queueing.
|
|
8440
|
+
It is independent of initial-clone `remote`/`remoteBase`/`branch`; omission of
|
|
8441
|
+
`target` preserves ordinary configured behavior. Targeted pull/push results and
|
|
8442
|
+
writer results/failure outcomes retain original `remote`, `ref` and any supplied
|
|
8443
|
+
`remoteBase`, including relative or empty base text. See the [complete configuration and
|
|
8402
8444
|
target contract](core-repositories.md#existing-checkout-configuration-and-selected-targets).
|
|
8403
8445
|
|
|
8404
8446
|
`write` snapshots the exact selected
|
|
@@ -9003,7 +9045,7 @@ import createLocalAIService from 'arcane-os/core/local-ai';
|
|
|
9003
9045
|
|
|
9004
9046
|
### Overview
|
|
9005
9047
|
|
|
9006
|
-
Reuses matching managed runtimes or installs complete selected
|
|
9048
|
+
Reuses matching managed runtimes or installs complete selected
|
|
9007
9049
|
llama.cpp/Ollama/ONNX/image distributions or NeMo libraries in an explicitly supplied directory.
|
|
9008
9050
|
|
|
9009
9051
|
### Signature and result
|
|
@@ -9016,14 +9058,22 @@ Import it from `arcane-os/local-ai`. Runtime requirements accept IDs or
|
|
|
9016
9058
|
`{id,version?,url?}` records. The result is an array of absolute
|
|
9017
9059
|
`{id,version,platform,architecture,root}` records, with `executable` for servers,
|
|
9018
9060
|
`modulePath` for ONNX, image `libraryPath`/`bindingModulePath`/`variants`/`models`,
|
|
9019
|
-
or NeMo library directories.
|
|
9061
|
+
or NeMo library directories. The SDK-selected Windows x64 ONNX `1.30.0`
|
|
9062
|
+
distribution also returns `nativeDistributionRevision: '1.30.0-directml-reshape-1'`.
|
|
9063
|
+
With no explicit `url`, an omitted ONNX version or explicit `1.30.0` selects
|
|
9064
|
+
the corrected native archive from the installed SDK's numeric release.
|
|
9065
|
+
Other ONNX versions, platforms/architectures and explicit URLs retain their
|
|
9066
|
+
upstream package path. Reuse requires the selected revision; older installation
|
|
9067
|
+
trees remain intact while a fresh installation is prepared. See
|
|
9068
|
+
[ONNX runtime preparation](local-ai.md#development).
|
|
9069
|
+
Image requirements also accept `backend` and
|
|
9020
9070
|
`models`; their pinned default runtime, CPU/Metal selection and separate model
|
|
9021
9071
|
preparation are described in [local image generation](local-image-generation.md).
|
|
9022
9072
|
Matching concurrent
|
|
9023
9073
|
installs share their work. Downloads retain runtime libraries and surface
|
|
9024
9074
|
network/archive failures; cancellation and operation events remain observable.
|
|
9025
9075
|
Installation changes no global PATH or system service and loads no model.
|
|
9026
|
-
Supported assets belong to the selected
|
|
9076
|
+
Supported assets belong to the selected distribution; see
|
|
9027
9077
|
[platform and archive requirements](local-ai.md#native-bundling).
|
|
9028
9078
|
|
|
9029
9079
|
```javascript
|
|
@@ -9057,6 +9107,11 @@ contains the complete emitted inventory. Existing runtime destinations are
|
|
|
9057
9107
|
preserved and reported as a conflict. Copying settles all started work and
|
|
9058
9108
|
reports failures/cancellation without executing app services or models.
|
|
9059
9109
|
|
|
9110
|
+
The corrected Windows x64 ONNX selection retains its
|
|
9111
|
+
`nativeDistributionRevision` and complete native libraries. Its `modulePath`
|
|
9112
|
+
is relocated with the other runtime paths; bundling introduces no separate
|
|
9113
|
+
runtime selection. See [ONNX runtime preparation](local-ai.md#development).
|
|
9114
|
+
|
|
9060
9115
|
Image records relocate the complete library, binding and variant paths. Model
|
|
9061
9116
|
URL descriptors retain their original acquisition metadata for preparation
|
|
9062
9117
|
after launch. Runtime-contained native model paths become artifact-relative;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import path from 'node:path';
|
|
|
4
4
|
import Is from 'strong-type';
|
|
5
5
|
import {ArcaneError, throwIfAborted} from '../errors.mjs';
|
|
6
6
|
import {runProcess} from '../process.mjs';
|
|
7
|
-
import {captureRepositoryTarget, repositoryConfiguration,
|
|
7
|
+
import {captureRepositoryRemote, captureRepositoryTarget, repositoryConfiguration, pullRepositoryTarget, pushRepositoryTarget,
|
|
8
8
|
repositoryPushArguments, repositoryStatus} from '../repository.mjs';
|
|
9
9
|
import {createGitIdentityRunner} from '../git-identity.mjs';
|
|
10
10
|
|
|
@@ -45,7 +45,7 @@ export function resolveArcaneDataPaths({dataRoot} = {}) {
|
|
|
45
45
|
|
|
46
46
|
/** One connected checkout, composed into an application's own Core service. */
|
|
47
47
|
export function createRepositoryWorkspace(
|
|
48
|
-
{name, directory, dataRoot, remote, branch, longPaths, cloneIdentity = {}, gitIdentity, onEvent, run = runProcess} = {}
|
|
48
|
+
{name, directory, dataRoot, remote, remoteBase, branch, longPaths, cloneIdentity = {}, gitIdentity, onEvent, run = runProcess} = {}
|
|
49
49
|
) {
|
|
50
50
|
let selected = directory;
|
|
51
51
|
if (selected === undefined) {
|
|
@@ -57,6 +57,7 @@ export function createRepositoryWorkspace(
|
|
|
57
57
|
}
|
|
58
58
|
requireString(selected, 'directory');
|
|
59
59
|
if (remote !== undefined) requireString(remote, 'remote');
|
|
60
|
+
const remoteArgument = captureRepositoryRemote(remote, remoteBase);
|
|
60
61
|
if (branch !== undefined) requireString(branch, 'branch');
|
|
61
62
|
if (longPaths !== undefined && !is.boolean(longPaths)) {
|
|
62
63
|
throw new TypeError('longPaths must be a boolean when supplied.');
|
|
@@ -119,7 +120,7 @@ export function createRepositoryWorkspace(
|
|
|
119
120
|
}
|
|
120
121
|
arguments_.push(...cloneConfiguration);
|
|
121
122
|
if (branch !== undefined) arguments_.push('--branch', branch);
|
|
122
|
-
arguments_.push('--',
|
|
123
|
+
arguments_.push('--', remoteArgument, repositoryDirectory);
|
|
123
124
|
const result = await prepareRun(
|
|
124
125
|
'git',
|
|
125
126
|
arguments_,
|
|
@@ -187,7 +188,7 @@ export function createRepositoryWorkspace(
|
|
|
187
188
|
return accept(
|
|
188
189
|
async function pullRepository() {
|
|
189
190
|
await prepare(signal);
|
|
190
|
-
return
|
|
191
|
+
return pullRepositoryTarget(selectedTarget, {workspaceRoot: repositoryDirectory, signal, onEvent, run: execute});
|
|
191
192
|
},
|
|
192
193
|
signal
|
|
193
194
|
);
|
|
@@ -200,7 +201,7 @@ export function createRepositoryWorkspace(
|
|
|
200
201
|
return accept(
|
|
201
202
|
async function pushRepository() {
|
|
202
203
|
await prepare(signal);
|
|
203
|
-
return
|
|
204
|
+
return pushRepositoryTarget(selectedTarget, {workspaceRoot: repositoryDirectory, signal, onEvent, run: execute});
|
|
204
205
|
},
|
|
205
206
|
signal
|
|
206
207
|
);
|
|
@@ -246,7 +247,7 @@ export function createRepositoryWorkspace(
|
|
|
246
247
|
async function writeRepositoryFiles() {
|
|
247
248
|
const outcome = {
|
|
248
249
|
directory: repositoryDirectory,
|
|
249
|
-
...(selectedTarget === undefined ? {} : {target: {...selectedTarget}}),
|
|
250
|
+
...(selectedTarget === undefined ? {} : {target: {...selectedTarget.target}}),
|
|
250
251
|
state: 'local',
|
|
251
252
|
stage: 'prepare',
|
|
252
253
|
paths: selectedFiles.map(function selectedPath(file) { return file.path; }),
|
|
@@ -5,6 +5,7 @@ import {runProcess} from './process.mjs';
|
|
|
5
5
|
import {ArcaneError, ERROR_CODES, throwIfAborted} from './errors.mjs';
|
|
6
6
|
import {createEventQueue} from './event-queue.mjs';
|
|
7
7
|
import {createGitIdentityRunner} from './git-identity.mjs';
|
|
8
|
+
import {captureRepositoryRemote} from './repository.mjs';
|
|
8
9
|
|
|
9
10
|
const is = new Is(false);
|
|
10
11
|
const snapshotRef = 'refs/arcane/text-snapshot';
|
|
@@ -14,11 +15,12 @@ const snapshotRef = 'refs/arcane/text-snapshot';
|
|
|
14
15
|
* One application service owns each dedicated cache directory. Construction
|
|
15
16
|
* performs no I/O; refresh coalesces callers and close drains accepted work.
|
|
16
17
|
*/
|
|
17
|
-
export function createGitTextSnapshot({cacheDirectory, remote, ref, selectPath, gitIdentity, onEvent, run = runProcess} = {}) {
|
|
18
|
+
export function createGitTextSnapshot({cacheDirectory, remote, remoteBase, ref, selectPath, gitIdentity, onEvent, run = runProcess} = {}) {
|
|
18
19
|
for (const [name, value] of Object.entries({cacheDirectory, remote, ref})) {
|
|
19
20
|
if (!is.string(value) || value === '') throw new TypeError(`${name} must be a nonempty string.`);
|
|
20
21
|
}
|
|
21
22
|
if (!is.function(selectPath)) throw new TypeError('selectPath must be a function.');
|
|
23
|
+
const remoteArgument = captureRepositoryRemote(remote, remoteBase);
|
|
22
24
|
const execute = createGitIdentityRunner(run, gitIdentity);
|
|
23
25
|
const directory = path.resolve(cacheDirectory);
|
|
24
26
|
let prepared = false;
|
|
@@ -68,7 +70,7 @@ export function createGitTextSnapshot({cacheDirectory, remote, ref, selectPath,
|
|
|
68
70
|
try {
|
|
69
71
|
await events.send({type: 'git.snapshot.refreshing', message: 'Refreshing the selected repository revision.', data: {ref}});
|
|
70
72
|
await prepare(events);
|
|
71
|
-
await git(['fetch', '--no-tags', '--no-write-fetch-head', '--',
|
|
73
|
+
await git(['fetch', '--no-tags', '--no-write-fetch-head', '--', remoteArgument, `+${ref}:${snapshotRef}`], {onEvent: events.send});
|
|
72
74
|
const selected = await git(['rev-parse', '--verify', `${snapshotRef}^{commit}`], {onEvent: events.send});
|
|
73
75
|
const revision = selected.stdout.trim();
|
|
74
76
|
if (retained?.revision === revision) {
|
package/src/repository.mjs
CHANGED
|
@@ -56,20 +56,33 @@ export async function readGitText(args, {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
/**
|
|
59
|
+
/** Derive a Git argument only when the caller explicitly selects a local base. */
|
|
60
|
+
export function captureRepositoryRemote(remote, remoteBase) {
|
|
61
|
+
if (remoteBase === undefined) return remote;
|
|
62
|
+
if (!is.string(remoteBase) || !remoteBase.isWellFormed() || remoteBase.includes('\0')) {
|
|
63
|
+
throw new TypeError('remoteBase must be text representable as a native filesystem path.');
|
|
64
|
+
}
|
|
65
|
+
return remote === undefined ? undefined : path.resolve(remoteBase, remote);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Keep original selection text separate from the accepted command argument. */
|
|
60
69
|
export function captureRepositoryTarget(target) {
|
|
61
70
|
if (target === undefined) return undefined;
|
|
62
|
-
const {remote, ref} = target;
|
|
71
|
+
const {remote, ref, remoteBase} = target;
|
|
63
72
|
for (const [name, value] of Object.entries({remote, ref})) {
|
|
64
73
|
if (!is.string(value) || value === '' || !value.isWellFormed() || value.includes('\0')) {
|
|
65
74
|
throw new TypeError(`target.${name} must be nonempty text representable as a native process argument.`);
|
|
66
75
|
}
|
|
67
76
|
}
|
|
68
|
-
return {
|
|
77
|
+
return {
|
|
78
|
+
target: {remote, ref, ...(remoteBase === undefined ? {} : {remoteBase})},
|
|
79
|
+
remoteArgument: captureRepositoryRemote(remote, remoteBase)
|
|
80
|
+
};
|
|
69
81
|
}
|
|
70
82
|
|
|
71
|
-
export function repositoryPushArguments(
|
|
72
|
-
return
|
|
83
|
+
export function repositoryPushArguments(selection) {
|
|
84
|
+
return selection === undefined ? ['push']
|
|
85
|
+
: ['push', '--no-follow-tags', '--', selection.remoteArgument, `HEAD:${selection.target.ref}`];
|
|
73
86
|
}
|
|
74
87
|
|
|
75
88
|
/** Observe an existing workspace without initializing or refreshing it. */
|
|
@@ -167,6 +180,12 @@ export async function repositoryPull({
|
|
|
167
180
|
}={}){
|
|
168
181
|
throwIfAborted(signal);
|
|
169
182
|
const selectedTarget=captureRepositoryTarget(target);
|
|
183
|
+
return pullRepositoryTarget(selectedTarget,{workspaceRoot,signal,onEvent,run});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Internal workspace path: its target was already captured before queueing. */
|
|
187
|
+
export async function pullRepositoryTarget(selectedTarget,{workspaceRoot,signal,onEvent,run=runProcess}){
|
|
188
|
+
throwIfAborted(signal);
|
|
170
189
|
const before=await repositoryStatus({workspaceRoot,signal,onEvent,run});
|
|
171
190
|
if(!before.clean){
|
|
172
191
|
throw new ArcaneError(
|
|
@@ -176,14 +195,14 @@ export async function repositoryPull({
|
|
|
176
195
|
);
|
|
177
196
|
}
|
|
178
197
|
const args=selectedTarget===undefined?['pull','--ff-only']
|
|
179
|
-
:['pull','--ff-only','--',selectedTarget.
|
|
198
|
+
:['pull','--ff-only','--',selectedTarget.remoteArgument,`${selectedTarget.target.ref}:`];
|
|
180
199
|
const result=await git(args,{cwd:workspaceRoot,signal,onEvent,run});
|
|
181
200
|
return {
|
|
182
201
|
action:'pull',
|
|
183
202
|
repositoryRoot:before.repositoryRoot,
|
|
184
203
|
branch:before.branch,
|
|
185
204
|
output:result.stdout.trim(),
|
|
186
|
-
...(selectedTarget===undefined?{}:{target:selectedTarget,stdout:result.stdout,stderr:result.stderr})
|
|
205
|
+
...(selectedTarget===undefined?{}:{target:selectedTarget.target,stdout:result.stdout,stderr:result.stderr})
|
|
187
206
|
};
|
|
188
207
|
}
|
|
189
208
|
|
|
@@ -196,6 +215,12 @@ export async function repositoryPush({
|
|
|
196
215
|
}={}){
|
|
197
216
|
throwIfAborted(signal);
|
|
198
217
|
const selectedTarget=captureRepositoryTarget(target);
|
|
218
|
+
return pushRepositoryTarget(selectedTarget,{workspaceRoot,signal,onEvent,run});
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** Internal workspace path: its target was already captured before queueing. */
|
|
222
|
+
export async function pushRepositoryTarget(selectedTarget,{workspaceRoot,signal,onEvent,run=runProcess}){
|
|
223
|
+
throwIfAborted(signal);
|
|
199
224
|
const before=await repositoryStatus({workspaceRoot,signal,onEvent,run});
|
|
200
225
|
if(!before.branch){
|
|
201
226
|
throw new ArcaneError(
|
|
@@ -209,7 +234,7 @@ export async function repositoryPush({
|
|
|
209
234
|
repositoryRoot:before.repositoryRoot,
|
|
210
235
|
branch:before.branch,
|
|
211
236
|
output:(result.stdout||result.stderr).trim(),
|
|
212
|
-
...(selectedTarget===undefined?{}:{target:selectedTarget,stdout:result.stdout,stderr:result.stderr})
|
|
237
|
+
...(selectedTarget===undefined?{}:{target:selectedTarget.target,stdout:result.stdout,stderr:result.stderr})
|
|
213
238
|
};
|
|
214
239
|
}
|
|
215
240
|
|