@astralos/cli 0.1.5 → 0.1.6
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 +7 -1
- package/dist/astral.js +11 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,11 +65,17 @@ one repo: `astral code search` needs `--repo owner/repo`, and
|
|
|
65
65
|
`astral code list-repos` lists the workspace repos instead of `repo list`.
|
|
66
66
|
|
|
67
67
|
For an Astral repo, `repo clone` and `repo view` work. Astral repos have no pull
|
|
68
|
-
requests. Use `astral code clone`, `astral code push
|
|
68
|
+
requests. Use `astral code clone`, then `astral code push` or plain `git push`
|
|
69
|
+
in the clone.
|
|
69
70
|
|
|
70
71
|
`astral code setup-git` makes git ask `astral code credential` for github.com.
|
|
71
72
|
Plain `git clone`, `fetch`, and `push` then use the same one-repo token.
|
|
72
73
|
|
|
74
|
+
Limit: the git credential protocol does not tell the helper if git fetches or
|
|
75
|
+
pushes. So for plain git, the helper always asks for the push password or
|
|
76
|
+
token first (one repo, short-lived). Without push access it gets a read one:
|
|
77
|
+
a clone or fetch works, and a push fails with a permission error.
|
|
78
|
+
|
|
73
79
|
## Agent instructions
|
|
74
80
|
|
|
75
81
|
`astral agent-setup` prints a marked AGENTS.md snippet. It needs no sign-in.
|
package/dist/astral.js
CHANGED
|
@@ -10275,7 +10275,7 @@ var ASTRAL_APPROVAL_HEADER = "Astral-Approval";
|
|
|
10275
10275
|
// package.json
|
|
10276
10276
|
var package_default = {
|
|
10277
10277
|
name: "@astralos/cli",
|
|
10278
|
-
version: "0.1.
|
|
10278
|
+
version: "0.1.6",
|
|
10279
10279
|
license: "MIT",
|
|
10280
10280
|
description: "The Astral command line. Every Astral tool, from a terminal or an agent.",
|
|
10281
10281
|
publishConfig: {
|
|
@@ -10926,6 +10926,15 @@ var URL_ENV = "ASTRAL_GIT_URL";
|
|
|
10926
10926
|
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
10927
10927
|
var toolPath = (name) => `/api/v1/tools/${encodeURIComponent(name)}`;
|
|
10928
10928
|
var readCredentials = async (client, id) => (await client.call({ method: "POST", path: toolPath("code.git_read_credentials"), json: { id } })).credentials;
|
|
10929
|
+
var helperRepoCredentials = async (client, id) => {
|
|
10930
|
+
try {
|
|
10931
|
+
return (await client.call({ method: "POST", path: toolPath("code.git_write_credentials"), json: { id } })).credentials;
|
|
10932
|
+
} catch (error) {
|
|
10933
|
+
if (!(error instanceof CliError) || error.error.type !== "permission_denied")
|
|
10934
|
+
throw error;
|
|
10935
|
+
return readCredentials(client, id);
|
|
10936
|
+
}
|
|
10937
|
+
};
|
|
10929
10938
|
var resolveRepo = async (client, ref) => {
|
|
10930
10939
|
if (UUID.test(ref))
|
|
10931
10940
|
return { id: ref, name: ref, kind: "astral" };
|
|
@@ -11089,7 +11098,7 @@ var helperCredentials = async (runtime, globals, repoId) => {
|
|
|
11089
11098
|
}
|
|
11090
11099
|
if (!repoId)
|
|
11091
11100
|
return null;
|
|
11092
|
-
return
|
|
11101
|
+
return helperRepoCredentials(clientFor(runtime, globals), repoId);
|
|
11093
11102
|
};
|
|
11094
11103
|
|
|
11095
11104
|
// src/gh.ts
|