@defrex/autobuild 1.10.0 → 1.11.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/README.md +1 -1
- package/SPEC.md +738 -68
- package/bin/ab-dispatch-generation.ts +3 -1
- package/docs/accounts.md +2 -1
- package/docs/answering-blocked-builds.md +20 -0
- package/docs/architecture.md +155 -25
- package/docs/build-store.md +10 -7
- package/docs/cli.md +33 -1
- package/docs/configuration-overview.md +4 -1
- package/docs/configuration.md +381 -29
- package/docs/dispatcher.md +63 -4
- package/docs/forges.md +7 -0
- package/docs/integration-tree.md +2 -2
- package/docs/operating.md +4 -2
- package/docs/operator-api.md +134 -6
- package/docs/operator-surfaces.md +85 -0
- package/docs/optimization-nodes.md +69 -11
- package/docs/plugin-authoring.md +37 -1
- package/docs/remote-store-protocol.md +94 -13
- package/docs/remote-ticket-protocol.md +40 -0
- package/docs/restacking.md +20 -4
- package/docs/setup.md +14 -2
- package/docs/ticket-dependencies.md +10 -3
- package/docs/ticket-sources.md +24 -2
- package/docs/tickets.md +7 -1
- package/docs/troubleshooting.md +8 -0
- package/docs/verification.md +4 -3
- package/docs/workspaces.md +3 -0
- package/package.json +9 -5
- package/packages/core/src/cli/accounts.ts +7 -2
- package/packages/core/src/cli/attention.ts +3 -1
- package/packages/core/src/cli/binary-direct.ts +2 -0
- package/packages/core/src/cli/binary-lifecycle.ts +2 -1
- package/packages/core/src/cli/build-control.ts +79 -1
- package/packages/core/src/cli/context.ts +4 -0
- package/packages/core/src/cli/dashboard/facts.ts +49 -53
- package/packages/core/src/cli/dashboard/header.ts +101 -0
- package/packages/core/src/cli/dashboard/model.ts +31 -39
- package/packages/core/src/cli/dashboard/objective-row.ts +46 -14
- package/packages/core/src/cli/dashboard/poll.ts +178 -76
- package/packages/core/src/cli/dashboard/render.ts +129 -230
- package/packages/core/src/cli/dashboard/row-text.ts +538 -0
- package/packages/core/src/cli/dashboard/timeline.ts +288 -0
- package/packages/core/src/cli/dashboard/vocabulary.ts +188 -0
- package/packages/core/src/cli/dispatch-args.ts +44 -1
- package/packages/core/src/cli/dispatch-frontend.ts +29 -38
- package/packages/core/src/cli/dispatch-launch-stop.ts +18 -0
- package/packages/core/src/cli/dispatch-launcher.ts +20 -7
- package/packages/core/src/cli/dispatch-web.ts +155 -0
- package/packages/core/src/cli/dispatch.ts +200 -34
- package/packages/core/src/cli/help.ts +87 -3
- package/packages/core/src/cli/init-validation.ts +3 -3
- package/packages/core/src/cli/main.ts +70 -6
- package/packages/core/src/cli/mcp.ts +35 -3
- package/packages/core/src/cli/objective.ts +1 -1
- package/packages/core/src/cli/operator-preference.ts +57 -0
- package/packages/core/src/cli/repo-lease.ts +2 -0
- package/packages/core/src/cli/repo-state.ts +56 -6
- package/packages/core/src/cli/repository-status.ts +97 -43
- package/packages/core/src/cli/status.ts +82 -1
- package/packages/core/src/cli/terminal-restore.ts +32 -7
- package/packages/core/src/cli/ticket.ts +98 -36
- package/packages/core/src/cli/wait.ts +14 -6
- package/packages/core/src/cli/watch.ts +20 -4
- package/packages/core/src/cli/web.ts +139 -0
- package/packages/core/src/config/live.ts +99 -14
- package/packages/core/src/config/load.ts +61 -20
- package/packages/core/src/config/local.ts +212 -0
- package/packages/core/src/config/pipeline-source.ts +2 -0
- package/packages/core/src/config/reference.ts +18 -0
- package/packages/core/src/config/schema.ts +45 -10
- package/packages/core/src/events/catalog.ts +4 -0
- package/packages/core/src/events/payloads.ts +97 -0
- package/packages/core/src/events/policy.ts +10 -0
- package/packages/core/src/events/repository.ts +46 -3
- package/packages/core/src/kernel/__snapshots__/reducer-accumulator-shapes.json +316 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/017d8dd5bb6dd80b.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/178e12f1759b7552.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/4932c70a2af97faf.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/536085773daf6b58.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/6bd6275061aaffa5.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/89625654b02e9ac1.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/a98af134be2da8a9.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/d5d5ccca80a893d8.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-corpora/f8155387eb5f375c.json.gz +0 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/3c27f918b194e3b3.json +465 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/79f0e0f4ccd43ba2.json +455 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/859c09edac738823.json +1086 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a283c1f3462b1cc1.json +81 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a6e570fb126991ff.json +36 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/a8acf22c968b6e3d.json +81 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/ba7b85895bf6698e.json +1153 -0
- package/packages/core/src/kernel/__snapshots__/reducer-identity-records/fc66408cde0b6b04.json +637 -0
- package/packages/core/src/kernel/build-roster.ts +230 -0
- package/packages/core/src/kernel/dispatch-capacity.ts +4 -2
- package/packages/core/src/kernel/engine.ts +43 -5
- package/packages/core/src/kernel/execution-intervals.ts +61 -0
- package/packages/core/src/kernel/generators/optimization-log.ts +101 -0
- package/packages/core/src/kernel/generators/repository-journals.ts +13 -0
- package/packages/core/src/kernel/leaf-restack-base.ts +33 -7
- package/packages/core/src/kernel/leaf-restack-state.ts +82 -3
- package/packages/core/src/kernel/log-index.ts +19 -0
- package/packages/core/src/kernel/optimization-admission.ts +244 -3
- package/packages/core/src/kernel/optimization.ts +183 -4
- package/packages/core/src/kernel/phase-failures.ts +121 -0
- package/packages/core/src/kernel/published-branch-head.ts +60 -0
- package/packages/core/src/kernel/reducer-registry.ts +27 -8
- package/packages/core/src/kernel/reducer-revisions.ts +25 -0
- package/packages/core/src/kernel/reducer.ts +63 -4
- package/packages/core/src/kernel/rollup.ts +61 -0
- package/packages/core/src/kernel/setup-streak.ts +38 -0
- package/packages/core/src/kernel/step-durations.ts +257 -0
- package/packages/core/src/kernel/target-observation.ts +6 -1
- package/packages/core/src/kernel/target-rewrite-recovery.ts +116 -0
- package/packages/core/src/kernel/verify-diff-base.ts +5 -0
- package/packages/core/src/kernel/verify-stages.ts +13 -3
- package/packages/core/src/ontology.ts +5 -0
- package/packages/core/src/operator/agent-context-serve.ts +631 -0
- package/packages/core/src/operator/annotations.ts +75 -5
- package/packages/core/src/operator/attention.ts +470 -0
- package/packages/core/src/operator/canonical-skills.ts +35 -0
- package/packages/core/src/operator/cli-equivalents.ts +270 -0
- package/packages/core/src/operator/context-prompts.ts +61 -0
- package/packages/core/src/operator/index.ts +49 -1
- package/packages/core/src/operator/landings.ts +28 -19
- package/packages/core/src/operator/optimization.ts +7 -0
- package/packages/core/src/operator/protocol.ts +3 -0
- package/packages/core/src/operator/query.ts +122 -72
- package/packages/core/src/operator/read-view.ts +5 -2
- package/packages/core/src/operator/registry.ts +406 -46
- package/packages/core/src/operator/requests.ts +20 -18
- package/packages/core/src/operator/sandbox-host.ts +107 -11
- package/packages/core/src/operator/sandbox-resolver.ts +253 -0
- package/packages/core/src/operator/sandbox.ts +778 -82
- package/packages/core/src/operator/ticket-asset-list.ts +77 -0
- package/packages/core/src/operator/ticket-assets.ts +167 -0
- package/packages/core/src/operator/tickets.ts +33 -2
- package/packages/core/src/plugin-sdk/index.ts +22 -0
- package/packages/core/src/plugins/manifest.ts +1 -1
- package/packages/core/src/ports/forge/fake.ts +92 -1
- package/packages/core/src/ports/forge/git-blob.ts +15 -0
- package/packages/core/src/ports/forge/github.ts +82 -0
- package/packages/core/src/ports/forge/local-git.ts +61 -1
- package/packages/core/src/ports/forge-failure.ts +24 -0
- package/packages/core/src/ports/runner/antigravity-test.fixture.ts +149 -0
- package/packages/core/src/ports/runner/claude-test.fixture.ts +71 -0
- package/packages/core/src/ports/runner/codex-test.fixture.ts +63 -0
- package/packages/core/src/ports/tickets/contract.ts +71 -0
- package/packages/core/src/ports/tickets/fake.ts +11 -0
- package/packages/core/src/ports/tickets/file.ts +18 -0
- package/packages/core/src/ports/tickets/github-fake.ts +136 -4
- package/packages/core/src/ports/tickets/github.ts +387 -30
- package/packages/core/src/ports/tickets/hosted-index.ts +10 -0
- package/packages/core/src/ports/tickets/linear.ts +130 -0
- package/packages/core/src/ports/tickets/priority.ts +9 -0
- package/packages/core/src/ports/tickets/remote-protocol.ts +34 -0
- package/packages/core/src/ports/tickets/remote.ts +70 -6
- package/packages/core/src/ports/tickets/search.ts +139 -0
- package/packages/core/src/ports/types.ts +104 -2
- package/packages/core/src/ports/workspace/builtin-capabilities.ts +9 -0
- package/packages/core/src/ports/workspace/create.ts +15 -1
- package/packages/core/src/ports/workspace/fake.ts +340 -12
- package/packages/core/src/ports/workspace/git-worktree.ts +833 -42
- package/packages/core/src/ports/workspace/operator-sandbox.ts +129 -12
- package/packages/core/src/ports/workspace/process-group.ts +48 -0
- package/packages/core/src/ports/workspace/vercel-sandbox.ts +1260 -123
- package/packages/core/src/processes/agent-context-assemble.ts +576 -0
- package/packages/core/src/processes/agent-context.ts +469 -0
- package/packages/core/src/processes/build-runner.ts +387 -236
- package/packages/core/src/processes/dispatcher.ts +211 -55
- package/packages/core/src/processes/execution-no-progress.ts +4 -0
- package/packages/core/src/processes/optimization-activity.ts +120 -0
- package/packages/core/src/processes/phase-failure-budget.ts +1 -0
- package/packages/core/src/processes/repo-view.ts +78 -2
- package/packages/core/src/processes/sandbox-state.ts +53 -6
- package/packages/core/src/processes/tick-publication.ts +2 -0
- package/packages/core/src/processes/workspace-preparation.ts +76 -0
- package/packages/core/src/scenarios/harness.ts +0 -5
- package/packages/core/src/store/account-redaction.ts +1 -0
- package/packages/core/src/store/adapter.ts +52 -1
- package/packages/core/src/store/agent-context.ts +432 -0
- package/packages/core/src/store/build-feed.ts +291 -0
- package/packages/core/src/store/build-scope.ts +19 -1
- package/packages/core/src/store/contract.ts +911 -14
- package/packages/core/src/store/digest.ts +19 -6
- package/packages/core/src/store/histogram.ts +113 -0
- package/packages/core/src/store/local/schema.ts +62 -0
- package/packages/core/src/store/local/store.ts +628 -22
- package/packages/core/src/store/local/ticket-asset-heads.ts +23 -0
- package/packages/core/src/store/memory.ts +461 -69
- package/packages/core/src/store/open-builds.ts +19 -0
- package/packages/core/src/store/phase-session.ts +32 -4
- package/packages/core/src/store/reduced-reads.ts +14 -4
- package/packages/core/src/store/reducer-value-shapes.json +6987 -5749
- package/packages/core/src/store/reducer-values.ts +6 -1
- package/packages/core/src/store/remote/client.ts +208 -2
- package/packages/core/src/store/remote/compatibility.ts +1 -1
- package/packages/core/src/store/remote/index.ts +33 -0
- package/packages/core/src/store/remote/protocol.ts +69 -0
- package/packages/core/src/store/remote/released-clients.json +11 -0
- package/packages/core/src/store/remote/released-reducer-values/1.11.0.json +35680 -0
- package/packages/core/src/store/remote/released-reducer-values/index.ts +18 -16
- package/packages/core/src/store/retention.ts +23 -1
- package/packages/core/src/store/rollups.ts +337 -0
- package/packages/core/src/store/session-handle.ts +20 -2
- package/packages/core/src/store/snapshots.ts +10 -0
- package/packages/core/src/store/types.ts +108 -9
- package/packages/core/src/testing/dispatch-read-budget.ts +1092 -2
- package/packages/core/src/testing/git-config-isolation.ts +7 -5
- package/packages/core/src/testing/index.ts +27 -0
- package/packages/core/src/testing/memory-operator-sandbox.ts +346 -0
- package/packages/core/src/testing/reduced-read-budget.ts +1873 -98
- package/packages/core/src/web/analytics-source.ts +303 -0
- package/packages/core/src/web/assets/Atkinson-OFL.txt +93 -0
- package/packages/core/src/web/assets/AtkinsonHyperlegibleNext.latin.woff2 +0 -0
- package/packages/core/src/web/assets/JetBrains-OFL.txt +93 -0
- package/packages/core/src/web/assets/JetBrainsMono.latin.woff2 +0 -0
- package/packages/core/src/web/assets/app.css +1 -0
- package/packages/core/src/web/assets/app.js +9 -0
- package/packages/core/src/web/assets/manifest.json +31 -0
- package/packages/core/src/web/assets/theme.js +1 -0
- package/packages/core/src/web/bounded.ts +31 -0
- package/packages/core/src/web/http.ts +315 -0
- package/packages/core/src/web/hub.ts +160 -0
- package/packages/core/src/web/options.ts +38 -0
- package/packages/core/src/web/overview-source.ts +322 -0
- package/packages/core/src/web/page.ts +56 -0
- package/packages/core/src/web/protocol.ts +151 -0
- package/packages/core/src/web/read-only.ts +23 -0
- package/packages/core/src/web/repository-source.ts +35 -0
- package/packages/core/src/web/server.ts +97 -0
- package/skills/code-review/SKILL.md +10 -2
- package/skills/guide/SKILL.md +366 -52
- package/skills/guide/references/accounts.md +2 -1
- package/skills/guide/references/integration-tree.md +2 -2
- package/skills/guide/references/operator-api.md +134 -6
- package/skills/guide/references/optimization-nodes.md +69 -11
- package/skills/guide/references/plugin-authoring.md +37 -1
- package/skills/guide/references/remote-store-protocol.md +94 -13
- package/skills/guide/references/remote-ticket-protocol.md +40 -0
- package/skills/guide/references/restacking.md +20 -4
- package/skills/guide/references/setup.md +14 -2
- package/skills/guide/references/ticket-dependencies.md +10 -3
- package/skills/implement/SKILL.md +23 -4
- package/skills/operate/SKILL.md +134 -32
- package/skills/plan/SKILL.md +10 -4
- package/skills/plan-review/SKILL.md +9 -2
- package/skills/spec/SKILL.md +34 -8
- package/skills/tickets/SKILL.md +51 -5
- package/templates/hosted-service/package.json +2 -2
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure assembly of a repository's agent context (`store/agent-context.ts`)
|
|
3
|
+
* from one commit's tree listing and a synchronous blob lookup.
|
|
4
|
+
*
|
|
5
|
+
* The assembler never fetches. Each pass reports the blob ids it needed but
|
|
6
|
+
* could not see (`missing`); the capture stage fetches them and runs the pass
|
|
7
|
+
* again, until nothing is missing. Each pass is deterministic over its
|
|
8
|
+
* inputs, so a checkout dispatcher and an origin-mode dispatcher that list
|
|
9
|
+
* the same commit produce byte-identical records.
|
|
10
|
+
*
|
|
11
|
+
* Selection:
|
|
12
|
+
* - Skills: each direct child directory of `.agents/skills` and
|
|
13
|
+
* `.claude/skills` (resolved through symlinks, dot-names skipped) that holds
|
|
14
|
+
* a `SKILL.md`. One entry per real directory, then per identical content;
|
|
15
|
+
* merged entries keep every install path.
|
|
16
|
+
* - Agent instructions: every `AGENTS.md` and `CLAUDE.md`, root and nested,
|
|
17
|
+
* outside captured skills. Within a directory the two collapse into one
|
|
18
|
+
* entry when they are the same blob.
|
|
19
|
+
* - Imports: `@path` tokens in instruction text, and transitively in imported
|
|
20
|
+
* text, resolved relative to the importing file. A token is an import only
|
|
21
|
+
* when it resolves to a blob; imports are separate entries, never inlined.
|
|
22
|
+
*/
|
|
23
|
+
import { createHash } from 'node:crypto'
|
|
24
|
+
import type { ForgeTreeEntry } from '../ports/types'
|
|
25
|
+
import {
|
|
26
|
+
contentFields,
|
|
27
|
+
type AgentContextImport,
|
|
28
|
+
type AgentContextInstruction,
|
|
29
|
+
type AgentContextOmission,
|
|
30
|
+
type AgentContextRecord,
|
|
31
|
+
type AgentContextSkill,
|
|
32
|
+
} from '../store/agent-context'
|
|
33
|
+
|
|
34
|
+
export const AGENT_CONTEXT_SKILL_ROOTS = ['.agents/skills', '.claude/skills'] as const
|
|
35
|
+
export const AGENT_CONTEXT_INSTRUCTION_NAMES = ['AGENTS.md', 'CLAUDE.md'] as const
|
|
36
|
+
const INSTRUCTION_NAMES: ReadonlySet<string> = new Set(AGENT_CONTEXT_INSTRUCTION_NAMES)
|
|
37
|
+
const FINGERPRINT_ROOTS: ReadonlySet<string> = new Set([
|
|
38
|
+
'.agents',
|
|
39
|
+
'.claude',
|
|
40
|
+
...AGENT_CONTEXT_SKILL_ROOTS,
|
|
41
|
+
])
|
|
42
|
+
const LINK_DEPTH = 40
|
|
43
|
+
const KEY_VERSION = 'agent-context-key/v1'
|
|
44
|
+
|
|
45
|
+
type OmissionReason = AgentContextOmission['reason']
|
|
46
|
+
type Resolved =
|
|
47
|
+
| { kind: 'tree'; path: string }
|
|
48
|
+
| { kind: 'blob'; path: string; entry: ForgeTreeEntry }
|
|
49
|
+
| { kind: 'fail'; reason: OmissionReason }
|
|
50
|
+
| { kind: 'missing' }
|
|
51
|
+
|
|
52
|
+
export interface AgentContextContributor {
|
|
53
|
+
path: string
|
|
54
|
+
bytes: number
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface AssembleResult {
|
|
58
|
+
/** Blob ids the pass needed and could not see, in first-need order. */
|
|
59
|
+
missing: string[]
|
|
60
|
+
/** Every blob id the pass consulted, seen or not. */
|
|
61
|
+
wanted: Set<string>
|
|
62
|
+
/** Captured blob bytes of everything selected so far (exact tree sizes). */
|
|
63
|
+
rawBytes: number
|
|
64
|
+
/** Selected skills, instruction files and imports by raw bytes, largest first. */
|
|
65
|
+
contributors: AgentContextContributor[]
|
|
66
|
+
/** Probed paths outside the fingerprint's fixed set, sorted. */
|
|
67
|
+
dependencies: string[]
|
|
68
|
+
/** The finished record; present only when nothing is missing. */
|
|
69
|
+
record?: AgentContextRecord
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function basename(path: string): string {
|
|
73
|
+
const at = path.lastIndexOf('/')
|
|
74
|
+
return at < 0 ? path : path.slice(at + 1)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function dirname(path: string): string {
|
|
78
|
+
const at = path.lastIndexOf('/')
|
|
79
|
+
return at < 0 ? '' : path.slice(0, at)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function join(base: string, rest: string): string {
|
|
83
|
+
if (base === '') return rest
|
|
84
|
+
if (rest === '') return base
|
|
85
|
+
return `${base}/${rest}`
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Normalize `rel` against directory `base`; null when it escapes the root. */
|
|
89
|
+
export function normalizeRepoPath(base: string, rel: string): string | null {
|
|
90
|
+
const parts = base === '' ? [] : base.split('/')
|
|
91
|
+
for (const part of rel.split('/')) {
|
|
92
|
+
if (part === '' || part === '.') continue
|
|
93
|
+
if (part === '..') {
|
|
94
|
+
if (parts.length === 0) return null
|
|
95
|
+
parts.pop()
|
|
96
|
+
} else parts.push(part)
|
|
97
|
+
}
|
|
98
|
+
return parts.join('/')
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function covered(path: string): boolean {
|
|
102
|
+
return (
|
|
103
|
+
FINGERPRINT_ROOTS.has(path) ||
|
|
104
|
+
AGENT_CONTEXT_SKILL_ROOTS.some((root) => path.startsWith(`${root}/`)) ||
|
|
105
|
+
INSTRUCTION_NAMES.has(basename(path))
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function sha256(text: string): string {
|
|
110
|
+
return createHash('sha256').update(text).digest('hex')
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function compare(a: string, b: string): number {
|
|
114
|
+
return a < b ? -1 : a > b ? 1 : 0
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Fingerprint of everything an assembly can read: every tree entry at or
|
|
119
|
+
* below the skill roots (and `.agents` / `.claude` themselves), every
|
|
120
|
+
* `AGENTS.md` / `CLAUDE.md`, and the current entry (or absence) at each path
|
|
121
|
+
* the previous assembly probed outside that set. Equal key ⇒ equal record.
|
|
122
|
+
*/
|
|
123
|
+
export function contextKey(
|
|
124
|
+
entries: readonly ForgeTreeEntry[],
|
|
125
|
+
dependencies: readonly string[],
|
|
126
|
+
): string {
|
|
127
|
+
const byPath = new Map(entries.map((entry) => [entry.path, entry]))
|
|
128
|
+
const fixed = entries
|
|
129
|
+
.filter((entry) => covered(entry.path))
|
|
130
|
+
.map((entry) => `${entry.path}\0${entry.mode}\0${entry.oid}`)
|
|
131
|
+
.sort(compare)
|
|
132
|
+
const probed = [...new Set(dependencies)].sort(compare).map((path) => {
|
|
133
|
+
const entry = byPath.get(path)
|
|
134
|
+
return entry ? `${path}\0${entry.mode}\0${entry.oid}` : `${path}\0null`
|
|
135
|
+
})
|
|
136
|
+
return sha256(`${KEY_VERSION}\n${fixed.join('\n')}\n--\n${probed.join('\n')}`)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const FENCE = /^ {0,3}(`{3,}|~{3,})/
|
|
140
|
+
const CODE_SPAN = /(`+)[\s\S]*?\1/g
|
|
141
|
+
const TOKEN = /(^|\s)@(\S+)/g
|
|
142
|
+
const TRAILING = /[.,;:!?)\]}>'"]+$/
|
|
143
|
+
|
|
144
|
+
/** `@path` tokens outside fenced code blocks and inline code spans. */
|
|
145
|
+
export function importTokens(text: string): string[] {
|
|
146
|
+
const tokens: string[] = []
|
|
147
|
+
let fence: string | undefined
|
|
148
|
+
for (const line of text.split(/\r?\n/)) {
|
|
149
|
+
const marker = FENCE.exec(line)?.[1]
|
|
150
|
+
if (fence !== undefined) {
|
|
151
|
+
if (marker !== undefined && marker[0] === fence[0] && marker.length >= fence.length)
|
|
152
|
+
fence = undefined
|
|
153
|
+
continue
|
|
154
|
+
}
|
|
155
|
+
if (marker !== undefined) {
|
|
156
|
+
fence = marker
|
|
157
|
+
continue
|
|
158
|
+
}
|
|
159
|
+
for (const match of line.replace(CODE_SPAN, ' ').matchAll(TOKEN)) {
|
|
160
|
+
const token = (match[2] ?? '').replace(TRAILING, '')
|
|
161
|
+
if (token !== '') tokens.push(token)
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return tokens
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
class Assembly {
|
|
168
|
+
private readonly byPath = new Map<string, ForgeTreeEntry>()
|
|
169
|
+
private readonly children = new Map<string, ForgeTreeEntry[]>()
|
|
170
|
+
readonly missing: string[] = []
|
|
171
|
+
private readonly missingSet = new Set<string>()
|
|
172
|
+
readonly wanted = new Set<string>()
|
|
173
|
+
readonly probes = new Set<string>()
|
|
174
|
+
readonly links = new Map<string, string>()
|
|
175
|
+
private readonly omitted = new Map<string, OmissionReason>()
|
|
176
|
+
|
|
177
|
+
constructor(
|
|
178
|
+
entries: readonly ForgeTreeEntry[],
|
|
179
|
+
private readonly blob: (oid: string) => Uint8Array | undefined,
|
|
180
|
+
) {
|
|
181
|
+
for (const entry of entries) {
|
|
182
|
+
this.byPath.set(entry.path, entry)
|
|
183
|
+
const parent = dirname(entry.path)
|
|
184
|
+
const list = this.children.get(parent) ?? []
|
|
185
|
+
list.push(entry)
|
|
186
|
+
this.children.set(parent, list)
|
|
187
|
+
}
|
|
188
|
+
for (const list of this.children.values()) list.sort((a, b) => compare(a.path, b.path))
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
load(oid: string): Uint8Array | undefined {
|
|
192
|
+
this.wanted.add(oid)
|
|
193
|
+
const bytes = this.blob(oid)
|
|
194
|
+
if (bytes === undefined && !this.missingSet.has(oid)) {
|
|
195
|
+
this.missingSet.add(oid)
|
|
196
|
+
this.missing.push(oid)
|
|
197
|
+
}
|
|
198
|
+
return bytes
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
omit(path: string, reason: OmissionReason): void {
|
|
202
|
+
if (!this.omitted.has(path)) this.omitted.set(path, reason)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
omissions(): AgentContextOmission[] {
|
|
206
|
+
return [...this.omitted]
|
|
207
|
+
.map(([path, reason]) => ({ path, reason }))
|
|
208
|
+
.sort((a, b) => compare(a.path, b.path))
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
entry(path: string): ForgeTreeEntry | undefined {
|
|
212
|
+
return this.byPath.get(path)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** Directory listing; records the directory as a dependency (its tree id
|
|
216
|
+
* covers everything below it). */
|
|
217
|
+
list(dir: string): ForgeTreeEntry[] {
|
|
218
|
+
if (dir !== '') this.probes.add(dir)
|
|
219
|
+
return this.children.get(dir) ?? []
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
resolve(path: string, depth = 0): Resolved {
|
|
223
|
+
this.probes.add(path)
|
|
224
|
+
if (path === '') return { kind: 'tree', path: '' }
|
|
225
|
+
const parts = path.split('/')
|
|
226
|
+
let prefix = ''
|
|
227
|
+
for (let i = 0; i < parts.length; i++) {
|
|
228
|
+
const candidate = join(prefix, parts[i]!)
|
|
229
|
+
const entry = this.byPath.get(candidate)
|
|
230
|
+
const last = i === parts.length - 1
|
|
231
|
+
if (entry === undefined) {
|
|
232
|
+
this.probes.add(candidate)
|
|
233
|
+
return { kind: 'fail', reason: 'dangling' }
|
|
234
|
+
}
|
|
235
|
+
if (entry.type === 'tree') {
|
|
236
|
+
prefix = candidate
|
|
237
|
+
if (last) return { kind: 'tree', path: candidate }
|
|
238
|
+
continue
|
|
239
|
+
}
|
|
240
|
+
this.probes.add(candidate)
|
|
241
|
+
if (entry.mode === '160000' || entry.type === 'commit')
|
|
242
|
+
return { kind: 'fail', reason: 'submodule' }
|
|
243
|
+
if (entry.mode === '120000') {
|
|
244
|
+
if (depth >= LINK_DEPTH) return { kind: 'fail', reason: 'link-depth' }
|
|
245
|
+
const bytes = this.load(entry.oid)
|
|
246
|
+
if (bytes === undefined) return { kind: 'missing' }
|
|
247
|
+
const target = new TextDecoder().decode(bytes)
|
|
248
|
+
if (target.startsWith('/')) return { kind: 'fail', reason: 'outside-repository' }
|
|
249
|
+
const joined = normalizeRepoPath(dirname(candidate), target)
|
|
250
|
+
if (joined === null) return { kind: 'fail', reason: 'outside-repository' }
|
|
251
|
+
this.links.set(candidate, target)
|
|
252
|
+
return this.resolve(join(joined, parts.slice(i + 1).join('/')), depth + 1)
|
|
253
|
+
}
|
|
254
|
+
if (!last) return { kind: 'fail', reason: 'dangling' }
|
|
255
|
+
return { kind: 'blob', path: candidate, entry }
|
|
256
|
+
}
|
|
257
|
+
return { kind: 'tree', path: prefix }
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
interface FileSelection {
|
|
262
|
+
path: string
|
|
263
|
+
oid: string
|
|
264
|
+
bytes: number
|
|
265
|
+
content?: Uint8Array
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function selectionFields(file: FileSelection): {
|
|
269
|
+
oid: string
|
|
270
|
+
bytes: number
|
|
271
|
+
text?: string
|
|
272
|
+
base64?: string
|
|
273
|
+
} {
|
|
274
|
+
const content = file.content ?? new Uint8Array()
|
|
275
|
+
return { oid: file.oid, bytes: content.byteLength, ...contentFields(content) }
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function sizeOf(entry: ForgeTreeEntry): number {
|
|
279
|
+
return entry.size ?? 0
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/** Every file of one skill directory, following symlinks inside it. */
|
|
283
|
+
function skillFiles(assembly: Assembly, realDir: string): FileSelection[] {
|
|
284
|
+
const files: FileSelection[] = []
|
|
285
|
+
const walk = (dir: string, rel: string, stack: Set<string>): void => {
|
|
286
|
+
for (const child of assembly.list(dir)) {
|
|
287
|
+
const name = basename(child.path)
|
|
288
|
+
const childRel = join(rel, name)
|
|
289
|
+
if (child.type === 'tree') {
|
|
290
|
+
walk(child.path, childRel, new Set([...stack, child.path]))
|
|
291
|
+
continue
|
|
292
|
+
}
|
|
293
|
+
if (child.mode === '160000' || child.type === 'commit') {
|
|
294
|
+
assembly.omit(child.path, 'submodule')
|
|
295
|
+
continue
|
|
296
|
+
}
|
|
297
|
+
if (child.mode !== '120000') {
|
|
298
|
+
files.push({
|
|
299
|
+
path: childRel,
|
|
300
|
+
oid: child.oid,
|
|
301
|
+
bytes: sizeOf(child),
|
|
302
|
+
content: assembly.load(child.oid),
|
|
303
|
+
})
|
|
304
|
+
continue
|
|
305
|
+
}
|
|
306
|
+
const resolved = assembly.resolve(child.path)
|
|
307
|
+
if (resolved.kind === 'missing') continue
|
|
308
|
+
if (resolved.kind === 'fail') assembly.omit(child.path, resolved.reason)
|
|
309
|
+
else if (resolved.kind === 'blob')
|
|
310
|
+
files.push({
|
|
311
|
+
path: childRel,
|
|
312
|
+
oid: resolved.entry.oid,
|
|
313
|
+
bytes: sizeOf(resolved.entry),
|
|
314
|
+
content: assembly.load(resolved.entry.oid),
|
|
315
|
+
})
|
|
316
|
+
else if (stack.has(resolved.path)) assembly.omit(child.path, 'link-depth')
|
|
317
|
+
else walk(resolved.path, childRel, new Set([...stack, resolved.path]))
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
walk(realDir, '', new Set([realDir]))
|
|
321
|
+
return files.sort((a, b) => compare(a.path, b.path))
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
interface SkillSelection {
|
|
325
|
+
paths: string[]
|
|
326
|
+
realDirs: string[]
|
|
327
|
+
files: FileSelection[]
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function selectSkills(assembly: Assembly): SkillSelection[] {
|
|
331
|
+
const byReal = new Map<string, SkillSelection>()
|
|
332
|
+
for (const root of AGENT_CONTEXT_SKILL_ROOTS) {
|
|
333
|
+
const resolved = assembly.resolve(root)
|
|
334
|
+
if (resolved.kind === 'fail' && assembly.entry(root) !== undefined)
|
|
335
|
+
assembly.omit(root, resolved.reason)
|
|
336
|
+
if (resolved.kind !== 'tree') continue
|
|
337
|
+
for (const child of assembly.list(resolved.path)) {
|
|
338
|
+
const name = basename(child.path)
|
|
339
|
+
if (name.startsWith('.')) continue
|
|
340
|
+
const install = `${root}/${name}`
|
|
341
|
+
const dir = assembly.resolve(install)
|
|
342
|
+
if (dir.kind === 'fail' && child.mode === '120000') assembly.omit(install, dir.reason)
|
|
343
|
+
if (dir.kind !== 'tree') continue
|
|
344
|
+
const marker = assembly.resolve(`${dir.path}/SKILL.md`)
|
|
345
|
+
if (marker.kind !== 'blob') continue
|
|
346
|
+
const existing = byReal.get(dir.path)
|
|
347
|
+
if (existing) existing.paths.push(install)
|
|
348
|
+
else
|
|
349
|
+
byReal.set(dir.path, {
|
|
350
|
+
paths: [install],
|
|
351
|
+
realDirs: [dir.path],
|
|
352
|
+
files: skillFiles(assembly, dir.path),
|
|
353
|
+
})
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
// Byte-identical copies in separate directories collapse too.
|
|
357
|
+
const bySignature = new Map<string, SkillSelection>()
|
|
358
|
+
for (const skill of byReal.values()) {
|
|
359
|
+
const signature = JSON.stringify(skill.files.map((file) => [file.path, file.oid]))
|
|
360
|
+
const existing = bySignature.get(signature)
|
|
361
|
+
if (existing) {
|
|
362
|
+
existing.paths.push(...skill.paths)
|
|
363
|
+
existing.realDirs.push(...skill.realDirs)
|
|
364
|
+
} else bySignature.set(signature, skill)
|
|
365
|
+
}
|
|
366
|
+
const rootIndex = (path: string) =>
|
|
367
|
+
AGENT_CONTEXT_SKILL_ROOTS.findIndex((root) => path.startsWith(`${root}/`))
|
|
368
|
+
const skills = [...bySignature.values()]
|
|
369
|
+
for (const skill of skills)
|
|
370
|
+
skill.paths.sort((a, b) => rootIndex(a) - rootIndex(b) || compare(a, b))
|
|
371
|
+
return skills.sort((a, b) => compare(a.paths[0]!, b.paths[0]!))
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
interface InstructionSelection {
|
|
375
|
+
paths: string[]
|
|
376
|
+
directory: string
|
|
377
|
+
realPath: string
|
|
378
|
+
file: FileSelection
|
|
379
|
+
imports: Set<string>
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
function selectInstructions(
|
|
383
|
+
assembly: Assembly,
|
|
384
|
+
entries: readonly ForgeTreeEntry[],
|
|
385
|
+
skillDirs: readonly string[],
|
|
386
|
+
): InstructionSelection[] {
|
|
387
|
+
const underSkill = (path: string) => skillDirs.some((dir) => path.startsWith(`${dir}/`))
|
|
388
|
+
const byDirectory = new Map<string, string[]>()
|
|
389
|
+
for (const entry of entries) {
|
|
390
|
+
if (!INSTRUCTION_NAMES.has(basename(entry.path)) || entry.type !== 'blob') continue
|
|
391
|
+
if (underSkill(entry.path)) continue
|
|
392
|
+
const dir = dirname(entry.path)
|
|
393
|
+
byDirectory.set(dir, [...(byDirectory.get(dir) ?? []), entry.path])
|
|
394
|
+
}
|
|
395
|
+
const selected: InstructionSelection[] = []
|
|
396
|
+
for (const [directory, paths] of byDirectory) {
|
|
397
|
+
const groups = new Map<string, InstructionSelection>()
|
|
398
|
+
for (const path of paths.sort(compare)) {
|
|
399
|
+
const resolved = assembly.resolve(path)
|
|
400
|
+
if (resolved.kind === 'fail') assembly.omit(path, resolved.reason)
|
|
401
|
+
if (resolved.kind !== 'blob') continue
|
|
402
|
+
const existing = groups.get(resolved.entry.oid)
|
|
403
|
+
if (existing) {
|
|
404
|
+
existing.paths.push(path)
|
|
405
|
+
continue
|
|
406
|
+
}
|
|
407
|
+
groups.set(resolved.entry.oid, {
|
|
408
|
+
paths: [path],
|
|
409
|
+
directory,
|
|
410
|
+
realPath: resolved.path,
|
|
411
|
+
file: {
|
|
412
|
+
path,
|
|
413
|
+
oid: resolved.entry.oid,
|
|
414
|
+
bytes: sizeOf(resolved.entry),
|
|
415
|
+
content: assembly.load(resolved.entry.oid),
|
|
416
|
+
},
|
|
417
|
+
imports: new Set(),
|
|
418
|
+
})
|
|
419
|
+
}
|
|
420
|
+
selected.push(...groups.values())
|
|
421
|
+
}
|
|
422
|
+
return selected.sort((a, b) => compare(a.paths[0]!, b.paths[0]!))
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
interface ImportSelection {
|
|
426
|
+
path: string
|
|
427
|
+
realPath: string
|
|
428
|
+
importedBy: Set<string>
|
|
429
|
+
file: FileSelection
|
|
430
|
+
imports: Set<string>
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
function selectImports(
|
|
434
|
+
assembly: Assembly,
|
|
435
|
+
instructions: readonly InstructionSelection[],
|
|
436
|
+
): ImportSelection[] {
|
|
437
|
+
// Every entry, instruction or import, is keyed by (resolved file, real
|
|
438
|
+
// directory its imports resolve from). Two aliases of one file in different
|
|
439
|
+
// directories resolve their own relative imports differently, so each is
|
|
440
|
+
// traversed; an alias of an instruction file from another directory is an
|
|
441
|
+
// import entry of its own for the same reason. The key set is finite (real
|
|
442
|
+
// blobs × real directories), so cycles and looping directory links still
|
|
443
|
+
// terminate.
|
|
444
|
+
const traversalKey = (realPath: string, directory: string) => `${realPath}\0${directory}`
|
|
445
|
+
const instructionAt = new Map<string, string>()
|
|
446
|
+
for (const instruction of instructions)
|
|
447
|
+
instructionAt.set(
|
|
448
|
+
traversalKey(instruction.realPath, instruction.directory),
|
|
449
|
+
instruction.paths[0]!,
|
|
450
|
+
)
|
|
451
|
+
const byKey = new Map<string, ImportSelection>()
|
|
452
|
+
const queue: { id: string; directory: string; file: FileSelection; imports: Set<string> }[] =
|
|
453
|
+
instructions.map((instruction) => ({
|
|
454
|
+
id: instruction.paths[0]!,
|
|
455
|
+
directory: instruction.directory,
|
|
456
|
+
file: instruction.file,
|
|
457
|
+
imports: instruction.imports,
|
|
458
|
+
}))
|
|
459
|
+
while (queue.length > 0) {
|
|
460
|
+
const importer = queue.shift()!
|
|
461
|
+
if (importer.file.content === undefined) continue
|
|
462
|
+
const text = new TextDecoder().decode(importer.file.content)
|
|
463
|
+
for (const token of importTokens(text)) {
|
|
464
|
+
if (token.startsWith('~') || token.startsWith('/')) {
|
|
465
|
+
assembly.omit(token, 'outside-repository')
|
|
466
|
+
continue
|
|
467
|
+
}
|
|
468
|
+
const path = normalizeRepoPath(importer.directory, token)
|
|
469
|
+
if (path === null || path === '') {
|
|
470
|
+
if (path === null) assembly.omit(token, 'outside-repository')
|
|
471
|
+
continue
|
|
472
|
+
}
|
|
473
|
+
const resolved = assembly.resolve(path)
|
|
474
|
+
if (resolved.kind !== 'blob') continue
|
|
475
|
+
const parent = assembly.resolve(dirname(path))
|
|
476
|
+
if (parent.kind !== 'tree') continue
|
|
477
|
+
const key = traversalKey(resolved.path, parent.path)
|
|
478
|
+
const instruction = instructionAt.get(key)
|
|
479
|
+
if (instruction !== undefined) {
|
|
480
|
+
if (instruction !== importer.id) importer.imports.add(instruction)
|
|
481
|
+
continue
|
|
482
|
+
}
|
|
483
|
+
const existing = byKey.get(key)
|
|
484
|
+
if (existing) {
|
|
485
|
+
existing.importedBy.add(importer.id)
|
|
486
|
+
if (existing.path !== importer.id) importer.imports.add(existing.path)
|
|
487
|
+
continue
|
|
488
|
+
}
|
|
489
|
+
const selection: ImportSelection = {
|
|
490
|
+
path,
|
|
491
|
+
realPath: resolved.path,
|
|
492
|
+
importedBy: new Set([importer.id]),
|
|
493
|
+
file: {
|
|
494
|
+
path,
|
|
495
|
+
oid: resolved.entry.oid,
|
|
496
|
+
bytes: sizeOf(resolved.entry),
|
|
497
|
+
content: assembly.load(resolved.entry.oid),
|
|
498
|
+
},
|
|
499
|
+
imports: new Set(),
|
|
500
|
+
}
|
|
501
|
+
byKey.set(key, selection)
|
|
502
|
+
importer.imports.add(path)
|
|
503
|
+
queue.push({
|
|
504
|
+
id: path,
|
|
505
|
+
directory: parent.path,
|
|
506
|
+
file: selection.file,
|
|
507
|
+
imports: selection.imports,
|
|
508
|
+
})
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
return [...byKey.values()].sort((a, b) => compare(a.path, b.path))
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/** One assembly pass over `entries`; see the module comment. */
|
|
515
|
+
export function assembleAgentContext(input: {
|
|
516
|
+
commit: string
|
|
517
|
+
baseBranch: string
|
|
518
|
+
entries: readonly ForgeTreeEntry[]
|
|
519
|
+
blob: (oid: string) => Uint8Array | undefined
|
|
520
|
+
}): AssembleResult {
|
|
521
|
+
const assembly = new Assembly(input.entries, input.blob)
|
|
522
|
+
const skills = selectSkills(assembly)
|
|
523
|
+
const skillDirs = skills.flatMap((skill) => [...skill.paths, ...skill.realDirs])
|
|
524
|
+
const instructions = selectInstructions(assembly, input.entries, skillDirs)
|
|
525
|
+
const imports = selectImports(assembly, instructions)
|
|
526
|
+
|
|
527
|
+
const contributors: AgentContextContributor[] = [
|
|
528
|
+
...skills.map((skill) => ({
|
|
529
|
+
path: skill.paths[0]!,
|
|
530
|
+
bytes: skill.files.reduce((total, file) => total + file.bytes, 0),
|
|
531
|
+
})),
|
|
532
|
+
...instructions.map((entry) => ({ path: entry.paths[0]!, bytes: entry.file.bytes })),
|
|
533
|
+
...imports.map((entry) => ({ path: entry.path, bytes: entry.file.bytes })),
|
|
534
|
+
].sort((a, b) => b.bytes - a.bytes || compare(a.path, b.path))
|
|
535
|
+
const rawBytes = contributors.reduce((total, entry) => total + entry.bytes, 0)
|
|
536
|
+
const dependencies = [...assembly.probes].filter((path) => !covered(path)).sort(compare)
|
|
537
|
+
const result: AssembleResult = {
|
|
538
|
+
missing: assembly.missing,
|
|
539
|
+
wanted: assembly.wanted,
|
|
540
|
+
rawBytes,
|
|
541
|
+
contributors,
|
|
542
|
+
dependencies,
|
|
543
|
+
}
|
|
544
|
+
if (assembly.missing.length > 0) return result
|
|
545
|
+
|
|
546
|
+
const recordSkills: AgentContextSkill[] = skills.map((skill) => ({
|
|
547
|
+
name: basename(skill.paths[0]!),
|
|
548
|
+
paths: skill.paths,
|
|
549
|
+
files: skill.files.map((file) => ({ path: file.path, ...selectionFields(file) })),
|
|
550
|
+
}))
|
|
551
|
+
const recordInstructions: AgentContextInstruction[] = instructions.map((entry) => ({
|
|
552
|
+
paths: entry.paths,
|
|
553
|
+
directory: entry.directory,
|
|
554
|
+
...selectionFields(entry.file),
|
|
555
|
+
imports: [...entry.imports].sort(compare),
|
|
556
|
+
}))
|
|
557
|
+
const recordImports: AgentContextImport[] = imports.map((entry) => ({
|
|
558
|
+
path: entry.path,
|
|
559
|
+
importedBy: [...entry.importedBy].sort(compare),
|
|
560
|
+
...selectionFields(entry.file),
|
|
561
|
+
imports: [...entry.imports].sort(compare),
|
|
562
|
+
}))
|
|
563
|
+
result.record = {
|
|
564
|
+
version: 1,
|
|
565
|
+
commit: input.commit,
|
|
566
|
+
baseBranch: input.baseBranch,
|
|
567
|
+
skills: recordSkills,
|
|
568
|
+
instructions: recordInstructions,
|
|
569
|
+
imports: recordImports,
|
|
570
|
+
links: [...assembly.links]
|
|
571
|
+
.map(([path, target]) => ({ path, target }))
|
|
572
|
+
.sort((a, b) => compare(a.path, b.path)),
|
|
573
|
+
omitted: assembly.omissions(),
|
|
574
|
+
}
|
|
575
|
+
return result
|
|
576
|
+
}
|