@andromarces/agent-loops 0.2.0 → 0.2.2
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 +26 -1
- package/package.json +4 -4
- package/src/cli.mjs +0 -0
- package/src/entrypoints/copilot.mjs +6 -1
package/README.md
CHANGED
|
@@ -245,7 +245,7 @@ happens only through explicit invocation.
|
|
|
245
245
|
`--dangerously-bypass-hook-trust` for normal use.
|
|
246
246
|
- The Copilot CLI entry point is `src/entrypoints/copilot.mjs`, exposed as
|
|
247
247
|
`agent-loop-copilot`. It mints a UUID, starts
|
|
248
|
-
`copilot --session-id <uuid> --interactive <prompt>`, and includes the
|
|
248
|
+
`copilot --session-id <uuid> --add-dir <docs dir> --interactive <prompt>`, and includes the
|
|
249
249
|
instruction file, task, and same id for `--parent-session` in the first
|
|
250
250
|
prompt. The current CLI documentation exposes no custom command-template
|
|
251
251
|
session-id placeholder, so the launcher is the native entry point.
|
|
@@ -428,6 +428,31 @@ pnpm lint # Lint files with oxlint
|
|
|
428
428
|
pnpm test # Run Vitest test suite
|
|
429
429
|
```
|
|
430
430
|
|
|
431
|
+
## Releasing
|
|
432
|
+
|
|
433
|
+
The release workflow stages a version on a published GitHub release or a manual dispatch, authenticated by OIDC trusted publishing. No npm token is stored.
|
|
434
|
+
|
|
435
|
+
npm requires the package to exist before a trusted publisher can be configured, so the first version is published once from a checkout:
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
npm login
|
|
439
|
+
npm publish
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
Then add a trusted publisher on npmjs.com: package settings, **Trusted publishing**, **GitHub Actions**, organization or user `andromarces`, repository `agent-loops`, workflow filename `release.yml`, allowed actions `npm stage publish`.
|
|
443
|
+
|
|
444
|
+
For later releases, bump the version, then publish a GitHub release with tag `v<version>`. The tag must match the `package.json` version. The workflow runs `npm stage publish` and prints a stage id. Review and approve the staged version with 2FA:
|
|
445
|
+
|
|
446
|
+
```bash
|
|
447
|
+
npm stage list
|
|
448
|
+
npm stage view <stage-id>
|
|
449
|
+
npm stage approve <stage-id>
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
A manual dispatch must run on the release tag, for example `gh workflow run release.yml --ref v<version>`. A dispatch on a branch is rejected, because npm records provenance from the run ref, not the checked-out commit.
|
|
453
|
+
|
|
454
|
+
The version goes live only after approval. Staged publishing needs npm 11.15.0 or later and 2FA on the account.
|
|
455
|
+
|
|
431
456
|
## Manual smoke test
|
|
432
457
|
|
|
433
458
|
Run against real CLI agents in a temporary Git repository:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andromarces/agent-loops",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Run a task loop across several CLI coding agents.",
|
|
6
6
|
"homepage": "https://github.com/andromarces/agent-loops#readme",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"url": "git+https://github.com/andromarces/agent-loops.git"
|
|
14
14
|
},
|
|
15
15
|
"bin": {
|
|
16
|
-
"agent-loop": "
|
|
17
|
-
"agent-loop-copilot": "
|
|
18
|
-
"agent-loops": "
|
|
16
|
+
"agent-loop": "src/cli.mjs",
|
|
17
|
+
"agent-loop-copilot": "src/entrypoints/copilot.mjs",
|
|
18
|
+
"agent-loops": "src/cli.mjs"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
21
|
"src",
|
package/src/cli.mjs
CHANGED
|
File without changes
|
|
@@ -13,13 +13,18 @@ import { isEntryPoint } from "../lib/entrypoint.mjs";
|
|
|
13
13
|
const INSTRUCTIONS_DIR = fileURLToPath(new URL("../../docs", import.meta.url));
|
|
14
14
|
const INSTRUCTIONS_PATH = join(INSTRUCTIONS_DIR, "orchestrator-instructions.md");
|
|
15
15
|
|
|
16
|
+
// The prompt is one line. execa rejects CR or LF in an argument on Windows when
|
|
17
|
+
// it spawns a batch shim through cmd.exe, and npm installs the copilot CLI as a
|
|
18
|
+
// .cmd shim on Windows.
|
|
16
19
|
const INSTRUCTIONS = (sessionId, task) =>
|
|
17
20
|
[
|
|
18
21
|
`Read \`${INSTRUCTIONS_PATH}\` and follow it for this request.`,
|
|
19
22
|
"The task and role settings are:",
|
|
20
23
|
task,
|
|
21
24
|
`This Copilot CLI session id is \`${sessionId}\`. Pass it as \`--parent-session\` on the init dispatch call.`,
|
|
22
|
-
]
|
|
25
|
+
]
|
|
26
|
+
.join(" ")
|
|
27
|
+
.replace(/[\r\n]+/g, " ");
|
|
23
28
|
|
|
24
29
|
export function buildCopilotInvocation(task, sessionId) {
|
|
25
30
|
const normalizedTask = String(task ?? "").trim();
|