@amsterdamdatalabs/adl-agent-control-darwin-arm64 0.1.58 → 0.1.59
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/bin/adl +2 -2
- package/bin/repo-search-mcp +2 -2
- package/package.json +1 -1
- package/packages/agent-skills/dist/manifest.d.ts.map +1 -1
- package/packages/agent-skills/dist/manifest.js +7 -1
- package/packages/agent-skills/dist/manifest.js.map +1 -1
- package/packages/agent-skills/src/manifest.ts +8 -3
- package/packages/fleet/src/repo-maintain.ts +16 -16
package/bin/adl
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/bin/adl
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 63654640 bytes
|
|
4
|
+
sha256: 5797631e8286a7b7ea106368718e4b6838cdcacfd178ca397d867af8f973598a
|
package/bin/repo-search-mcp
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/bin/repo-search-mcp
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 62390624 bytes
|
|
4
|
+
sha256: b1c35e4c4383bc4cc9acb5a74ddffdfc87106d1fa6962e9983a885fc404a3c3f
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amsterdamdatalabs/adl-agent-control-darwin-arm64",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.59",
|
|
4
4
|
"description": "adl CLI binary for darwin/arm64 (agent identity + Azure DevOps front door — see docs/architecture/cli-design.md)",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"os": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,sBAAs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,GAAG,OAAO,CAGjG;AAED,6EAA6E;AAC7E,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAUnG;AAED,+HAA+H;AAC/H,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAQxE"}
|
|
@@ -24,7 +24,13 @@ export function readManifest(targetRepo) {
|
|
|
24
24
|
const path = manifestPathFor(targetRepo);
|
|
25
25
|
if (!existsSync(path))
|
|
26
26
|
return { schema: MANIFEST_SCHEMA, files: [] };
|
|
27
|
-
|
|
27
|
+
let raw;
|
|
28
|
+
try {
|
|
29
|
+
raw = JSON.parse(readFileSync(path, "utf8"));
|
|
30
|
+
}
|
|
31
|
+
catch (cause) {
|
|
32
|
+
throw new Error(`agent-skills deploy manifest is not valid JSON: ${path} (${cause.message})`);
|
|
33
|
+
}
|
|
28
34
|
if (raw === null || typeof raw !== "object" || raw.schema !== MANIFEST_SCHEMA || !Array.isArray(raw.files)) {
|
|
29
35
|
throw new Error(`agent-skills deploy manifest is malformed: ${path}`);
|
|
30
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,gCAAgC,CAAC;AACvE,MAAM,eAAe,GAAG,CAAC,CAAC;AAU1B,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,OAAO,IAAI,CAAC,UAAU,EAAE,sBAAsB,CAAC,CAAC;AAClD,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AAM,IAAI,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,SAAS;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,+HAA+H;AAC/H,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACnD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,CAAC;QAClD,YAAY,CAAC,UAAU,EAAE,IAAI,EAAE,mCAAmC,CAAC,CAAC;QACpE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -35,16 +35,21 @@ export function readManifest(targetRepo: string): SkillManifest {
|
|
|
35
35
|
const path = manifestPathFor(targetRepo);
|
|
36
36
|
if (!existsSync(path)) return { schema: MANIFEST_SCHEMA, files: [] };
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
let raw: { schema?: unknown; files?: unknown; hashes?: unknown } | null;
|
|
39
|
+
try {
|
|
40
|
+
raw = JSON.parse(readFileSync(path, "utf8"));
|
|
41
|
+
} catch (cause) {
|
|
42
|
+
throw new Error(`agent-skills deploy manifest is not valid JSON: ${path} (${(cause as Error).message})`);
|
|
43
|
+
}
|
|
39
44
|
if (raw === null || typeof raw !== "object" || raw.schema !== MANIFEST_SCHEMA || !Array.isArray(raw.files)) {
|
|
40
45
|
throw new Error(`agent-skills deploy manifest is malformed: ${path}`);
|
|
41
46
|
}
|
|
42
|
-
const files = raw.files.map(String);
|
|
47
|
+
const files = (raw.files as unknown[]).map(String);
|
|
43
48
|
if (raw.hashes === undefined) return { schema: MANIFEST_SCHEMA, files };
|
|
44
49
|
if (raw.hashes === null || typeof raw.hashes !== "object" || Array.isArray(raw.hashes)) {
|
|
45
50
|
throw new Error(`agent-skills deploy manifest is malformed: ${path}`);
|
|
46
51
|
}
|
|
47
|
-
return { schema: MANIFEST_SCHEMA, files, hashes: Object.fromEntries(Object.entries(raw.hashes).map(([file, hash]) => [file, String(hash)])) };
|
|
52
|
+
return { schema: MANIFEST_SCHEMA, files, hashes: Object.fromEntries(Object.entries(raw.hashes as Record<string, unknown>).map(([file, hash]) => [file, String(hash)])) };
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
/** Skips the write entirely when the serialized content is already byte-identical (independent review, 2026-09-29, finding 8: a genuine no-op run must not touch the manifest's mtime either). */
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* `WARN repo-maintain: <repo>: deleted stale branch <name> at <sha> (last
|
|
31
31
|
* commit <date>)` line, which is how a deleted branch is recovered from the
|
|
32
32
|
* log (`git branch <name> <sha>`); a dry run lists them without deleting;
|
|
33
|
-
* 5. `adl install --repo
|
|
33
|
+
* 5. `cd <repo> && adl install --repo .` -- the existing per-repo enrolment.
|
|
34
34
|
*
|
|
35
35
|
* This runs as the device administrator, never root (the caller,
|
|
36
36
|
* bin/reconcile-host, drops privileges and `adl maintain --expect-user`
|
|
@@ -65,7 +65,7 @@ export interface MaintainOptions {
|
|
|
65
65
|
readonly location: string
|
|
66
66
|
/** The running adl binary, named in the Full Disk Access remedy. */
|
|
67
67
|
readonly executable: string
|
|
68
|
-
/** How to run `adl
|
|
68
|
+
/** How to run `adl`, from inside each repo: `<command> <...leadingArgs> install --repo .`. */
|
|
69
69
|
readonly install: { readonly command: string; readonly leadingArgs: readonly string[] }
|
|
70
70
|
/** Most recent non-protected local branches kept by the prune. Default 3. */
|
|
71
71
|
readonly keep?: number
|
|
@@ -120,8 +120,7 @@ interface GitResult {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
function errorCode(error: unknown): string | undefined {
|
|
123
|
-
|
|
124
|
-
return typeof code === 'string' ? code : undefined
|
|
123
|
+
return (error as { code?: string } | null)?.code
|
|
125
124
|
}
|
|
126
125
|
|
|
127
126
|
function lines(output: string): string[] {
|
|
@@ -156,7 +155,7 @@ export function maintainRepositories(options: MaintainOptions): MaintainResult {
|
|
|
156
155
|
const git = (repo: string, ...args: string[]): GitResult => {
|
|
157
156
|
const result = spawnSync('git', ['-C', repo, ...args], { encoding: 'utf8', env: childEnv() })
|
|
158
157
|
if (result.error !== undefined) throw result.error
|
|
159
|
-
return { ok: result.status === 0, stdout: result.stdout, stderr: result.stderr
|
|
158
|
+
return { ok: result.status === 0, stdout: result.stdout, stderr: result.stderr }
|
|
160
159
|
}
|
|
161
160
|
|
|
162
161
|
const maxAgeDays = options.branchMaxAgeDays
|
|
@@ -185,7 +184,7 @@ export function maintainRepositories(options: MaintainOptions): MaintainResult {
|
|
|
185
184
|
try {
|
|
186
185
|
agent = resolveAgentIdentity(env).agent
|
|
187
186
|
} catch (error) {
|
|
188
|
-
const message = error
|
|
187
|
+
const message = (error as Error).message
|
|
189
188
|
if (message !== NO_AGENT_IDENTITY_MESSAGE) {
|
|
190
189
|
fail(`cannot resolve an Azure DevOps agent identity: ${message}`, 'identity')
|
|
191
190
|
return { ok: false, repositories: 0, failures }
|
|
@@ -225,7 +224,7 @@ export function maintainRepositories(options: MaintainOptions): MaintainResult {
|
|
|
225
224
|
real = realpathSync(candidate)
|
|
226
225
|
} catch (error) {
|
|
227
226
|
if (errorCode(error) === 'ENOENT') continue
|
|
228
|
-
fail(`${candidate}: cannot resolve: ${error
|
|
227
|
+
fail(`${candidate}: cannot resolve: ${(error as Error).message}`, candidate)
|
|
229
228
|
continue
|
|
230
229
|
}
|
|
231
230
|
if (dirname(real) !== locationReal) continue
|
|
@@ -238,7 +237,7 @@ export function maintainRepositories(options: MaintainOptions): MaintainResult {
|
|
|
238
237
|
} catch (error) {
|
|
239
238
|
const code = errorCode(error)
|
|
240
239
|
if (code === 'ENOENT' || code === 'ENOTDIR') continue
|
|
241
|
-
fail(`${real}: cannot read ${MARKER}: ${error
|
|
240
|
+
fail(`${real}: cannot read ${MARKER}: ${(error as Error).message}`, real)
|
|
242
241
|
continue
|
|
243
242
|
}
|
|
244
243
|
seen.add(real)
|
|
@@ -270,7 +269,7 @@ export function maintainRepositories(options: MaintainOptions): MaintainResult {
|
|
|
270
269
|
fail(`${directory}: cannot run ${command}: ${top.error.message}`, directory)
|
|
271
270
|
return 'failed'
|
|
272
271
|
}
|
|
273
|
-
const stderr =
|
|
272
|
+
const stderr = top.stderr.trim()
|
|
274
273
|
if (top.status === 128 && stderr.includes('not a git repository')) return 'not-toplevel'
|
|
275
274
|
if (top.status !== 0) {
|
|
276
275
|
const shown = stderr.split('\n').slice(0, 3).join(' | ')
|
|
@@ -282,7 +281,7 @@ export function maintainRepositories(options: MaintainOptions): MaintainResult {
|
|
|
282
281
|
try {
|
|
283
282
|
return realpathSync(top.stdout.trim()) === directory ? 'toplevel' : 'not-toplevel'
|
|
284
283
|
} catch (error) {
|
|
285
|
-
fail(`${directory}: cannot resolve git toplevel ${top.stdout.trim()}: ${error
|
|
284
|
+
fail(`${directory}: cannot resolve git toplevel ${top.stdout.trim()}: ${(error as Error).message}`, directory)
|
|
286
285
|
return 'failed'
|
|
287
286
|
}
|
|
288
287
|
}
|
|
@@ -328,21 +327,22 @@ export function maintainRepositories(options: MaintainOptions): MaintainResult {
|
|
|
328
327
|
if (maxAgeDays !== undefined) pruneStale(repo, name, current, maxAgeDays)
|
|
329
328
|
|
|
330
329
|
// 5. the per-repo enrolment.
|
|
331
|
-
|
|
332
|
-
const
|
|
330
|
+
// From inside the repo with `--repo .` (Tarun, 2026-10-25): an adl-azdo checkout deploys its own skills, hooks, settings and repo-controls.
|
|
331
|
+
const argv = [...options.install.leadingArgs, 'install', '--repo', '.', '--rewire']
|
|
332
|
+
const shown = `cd ${repo} && adl install --repo . --rewire`
|
|
333
333
|
if (dry) {
|
|
334
334
|
info(`${name}: [dry] would run ${shown}`)
|
|
335
335
|
return
|
|
336
336
|
}
|
|
337
|
-
const result = spawnSync(options.install.command, argv, { encoding: 'utf8', env: childEnv() })
|
|
337
|
+
const result = spawnSync(options.install.command, argv, { cwd: repo, encoding: 'utf8', env: childEnv() })
|
|
338
338
|
if (result.error !== undefined) {
|
|
339
339
|
fail(`${name}: could not run ${options.install.command}: ${result.error.message}`, repo)
|
|
340
340
|
} else if (result.status !== 0) {
|
|
341
|
-
fail(`${name}: ${shown} exited ${result.status}: ${
|
|
341
|
+
fail(`${name}: ${shown} exited ${result.status}: ${result.stderr.trim()}`, repo)
|
|
342
342
|
} else {
|
|
343
343
|
info(`${name}: ${shown}: ok`)
|
|
344
344
|
for (const line of `${result.stdout}${result.stderr}`.split('\n')) {
|
|
345
|
-
if (
|
|
345
|
+
if (/\bWARN|FAIL|COULD-NOT-RUN/.test(line)) warn(`${name}: ${line.trim()}`)
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
}
|
|
@@ -391,7 +391,7 @@ export function maintainRepositories(options: MaintainOptions): MaintainResult {
|
|
|
391
391
|
// %1f (unit separator) cannot appear in a ref name, unlike `|`.
|
|
392
392
|
const format = '%(refname:short)%1f%(objectname)%1f%(committerdate:unix)%1f%(worktreepath)'
|
|
393
393
|
for (const line of lines(git(repo, 'for-each-ref', 'refs/heads/', `--format=${format}`).stdout)) {
|
|
394
|
-
const [branch
|
|
394
|
+
const [branch, sha, committed, worktree] = line.split('\x1f') as [string, string, string, string]
|
|
395
395
|
if (branch === '' || PROTECTED.has(branch) || branch === current) continue
|
|
396
396
|
const tip = Number(committed)
|
|
397
397
|
if (!Number.isFinite(tip) || tip >= cutoff) continue
|