@c4a/context-cli 0.7.91 → 0.7.92
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/cli.js +5513 -3884
- package/indexers/bundles/context-code-indexer/references/indexer.md +3 -1
- package/indexers/bundles/context-markdown-indexer/references/indexer.md +4 -1
- package/indexers/contracts/profile-contract.json +245 -245
- package/indexers/release-manifest.json +5 -5
- package/package.json +12 -12
- package/parserEntryWorker.js +157 -162
- package/plugins/VERSION +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/codex/.codex-plugin/plugin.json +2 -2
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/plugins/skills/context-code-indexer/references/indexer.md +3 -1
- package/plugins/skills/context-markdown-indexer/references/indexer.md +4 -1
- package/providers/context/manifest.json +20 -20
- package/providers/context/provider.yaml +1 -1
- package/providers/context/resources/dialogue/knowledge-review.md +1 -1
- package/providers/context/resources/manuals/guides/knowledge-updates.md +6 -0
- package/providers/context/resources/manuals/guides/workspace-restore.md +7 -0
- package/providers/context/resources/procedures/approved-revision.md +33 -0
- package/providers/context/resources/procedures/knowledge-review.md +4 -2
- package/providers/context/resources/procedures/knowledge-updates.md +6 -0
- package/providers/context/resources/procedures/source-update.md +19 -2
- package/providers/context/resources/procedures/workspace-restore.md +7 -0
- package/providers/context/schemas/indexer-agent-step-result.schema.json +21 -0
- package/providers/context/skills/run-indexer-agent-step/SKILL.md +31 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"protocol": "context.indexer.cli-release-manifest/v1",
|
|
3
3
|
"package": "@c4a/context-cli",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.92",
|
|
5
5
|
"issuer": "context4ai/context",
|
|
6
6
|
"bundles": [
|
|
7
7
|
{
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"kind": "cli-bundled",
|
|
12
12
|
"locator": "cli-bundled://context/context-code-indexer"
|
|
13
13
|
},
|
|
14
|
-
"integrity": "sha256:
|
|
14
|
+
"integrity": "sha256:eef7f293b204730cc9509ea6370f4e2f2b299355a2d050772f1b12c19773f9a9",
|
|
15
15
|
"manifest_digest": "sha256:1bb49c2cfaaf1cc847dccd90c5f2bb6465941217a0e0d6053c0a5aeff467a013",
|
|
16
16
|
"files": [
|
|
17
17
|
{
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
"path": "references/indexer.md",
|
|
139
|
-
"digest": "sha256:
|
|
139
|
+
"digest": "sha256:076917c0f6d690b8e33798527504b768926d257ab9fbea5df21debff76cfa23b"
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
"path": "references/metrics.md",
|
|
@@ -539,7 +539,7 @@
|
|
|
539
539
|
"kind": "cli-bundled",
|
|
540
540
|
"locator": "cli-bundled://context/context-markdown-indexer"
|
|
541
541
|
},
|
|
542
|
-
"integrity": "sha256:
|
|
542
|
+
"integrity": "sha256:f9f40b9b18fa700d26305059f6987e9b7008120430a5ce350d3d16f2945e8436",
|
|
543
543
|
"manifest_digest": "sha256:4b6ea2307077abd4899515d32f72941ab8e6bceaa89f2b7662d732bbf817bce5",
|
|
544
544
|
"files": [
|
|
545
545
|
{
|
|
@@ -628,7 +628,7 @@
|
|
|
628
628
|
},
|
|
629
629
|
{
|
|
630
630
|
"path": "references/indexer.md",
|
|
631
|
-
"digest": "sha256:
|
|
631
|
+
"digest": "sha256:c8f8a1a007f9860312ec5f71eb0c68aaeab84fa1bc6849393bcfff6e3f229c60"
|
|
632
632
|
},
|
|
633
633
|
{
|
|
634
634
|
"path": "references/semantic-planning.md",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c4a/context-cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.92",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local runtime and Agent integration for traceable knowledge production",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@c4a/agent-graph": "0.3.0",
|
|
27
|
-
"@c4a/context": "0.7.
|
|
28
|
-
"@c4a/extract": "0.7.
|
|
29
|
-
"@c4a/extract-contract": "0.7.
|
|
30
|
-
"@c4a/extract-go": "0.7.
|
|
31
|
-
"@c4a/extract-mdx": "0.7.
|
|
32
|
-
"@c4a/extract-proto": "0.7.
|
|
33
|
-
"@c4a/extract-rush": "0.7.
|
|
34
|
-
"@c4a/extract-sql": "0.7.
|
|
35
|
-
"@c4a/extract-style": "0.7.
|
|
36
|
-
"@c4a/extract-thrift": "0.7.
|
|
37
|
-
"@c4a/extract-ts": "0.7.
|
|
27
|
+
"@c4a/context": "0.7.92",
|
|
28
|
+
"@c4a/extract": "0.7.92",
|
|
29
|
+
"@c4a/extract-contract": "0.7.92",
|
|
30
|
+
"@c4a/extract-go": "0.7.92",
|
|
31
|
+
"@c4a/extract-mdx": "0.7.92",
|
|
32
|
+
"@c4a/extract-proto": "0.7.92",
|
|
33
|
+
"@c4a/extract-rush": "0.7.92",
|
|
34
|
+
"@c4a/extract-sql": "0.7.92",
|
|
35
|
+
"@c4a/extract-style": "0.7.92",
|
|
36
|
+
"@c4a/extract-thrift": "0.7.92",
|
|
37
|
+
"@c4a/extract-ts": "0.7.92",
|
|
38
38
|
"@mermaid-js/layout-elk": "0.2.0",
|
|
39
39
|
"commander": "^11.0.0",
|
|
40
40
|
"d3-force": "3.0.0",
|
package/parserEntryWorker.js
CHANGED
|
@@ -4869,13 +4869,13 @@ var init_indexerProtocolCommon = __esm(() => {
|
|
|
4869
4869
|
import { createHash as createHash3 } from "node:crypto";
|
|
4870
4870
|
function articleFragmentReferenceListSchema(item) {
|
|
4871
4871
|
return exports_external.array(item).max(ARTICLE_FRAGMENT_REGION_LIMIT, {
|
|
4872
|
-
message: `A fragment can cite at most ${ARTICLE_FRAGMENT_REGION_LIMIT} source regions`
|
|
4872
|
+
message: `A fragment can cite at most ${ARTICLE_FRAGMENT_REGION_LIMIT} source regions; split by topic or retain the most relevant supporting regions`
|
|
4873
4873
|
}).superRefine((references, context) => {
|
|
4874
4874
|
const files = new Set(references.map((reference) => JSON.stringify([reference.source_ref, reference.locator.path])));
|
|
4875
4875
|
if (files.size > ARTICLE_FRAGMENT_SOURCE_FILE_LIMIT)
|
|
4876
4876
|
context.addIssue({
|
|
4877
4877
|
code: exports_external.ZodIssueCode.custom,
|
|
4878
|
-
message: `A fragment can cite at most ${ARTICLE_FRAGMENT_SOURCE_FILE_LIMIT} distinct source files (got ${files.size}); split
|
|
4878
|
+
message: `A fragment can cite at most ${ARTICLE_FRAGMENT_SOURCE_FILE_LIMIT} distinct source files (got ${files.size}); split by topic or retain the most relevant supporting files`
|
|
4879
4879
|
});
|
|
4880
4880
|
});
|
|
4881
4881
|
}
|
|
@@ -18610,6 +18610,7 @@ var init_indexerSemanticInput = __esm(() => {
|
|
|
18610
18610
|
]);
|
|
18611
18611
|
sourceUpdateSemanticInputSchema = exports_external.object({
|
|
18612
18612
|
stage: exports_external.literal("source-update"),
|
|
18613
|
+
format_only: exports_external.array(exports_external.object({ source_ref: exports_external.string().min(1), reason: exports_external.string().trim().min(1) }).strict()).optional(),
|
|
18613
18614
|
decisions: exports_external.array(exports_external.object({
|
|
18614
18615
|
path: exports_external.string().min(1),
|
|
18615
18616
|
instruction: exports_external.string().trim().min(1).optional(),
|
|
@@ -20905,49 +20906,6 @@ async function prepareCodeAnalysisInput(input) {
|
|
|
20905
20906
|
}
|
|
20906
20907
|
var init_codeAnalysisInput = () => {};
|
|
20907
20908
|
|
|
20908
|
-
// src/project/parserConcurrency.ts
|
|
20909
|
-
async function mapParserWork(items, concurrency, run) {
|
|
20910
|
-
if (!Number.isSafeInteger(concurrency) || concurrency < 1) {
|
|
20911
|
-
throw new TypeError("parser concurrency must be a positive integer");
|
|
20912
|
-
}
|
|
20913
|
-
const results = new Array(items.length);
|
|
20914
|
-
let cursor = 0;
|
|
20915
|
-
let failed = false;
|
|
20916
|
-
let failure;
|
|
20917
|
-
await Promise.all(Array.from({ length: Math.min(concurrency, items.length) }, async () => {
|
|
20918
|
-
while (!failed && cursor < items.length) {
|
|
20919
|
-
const index = cursor++;
|
|
20920
|
-
try {
|
|
20921
|
-
results[index] = await run(items[index], index);
|
|
20922
|
-
} catch (error) {
|
|
20923
|
-
if (!failed)
|
|
20924
|
-
failure = error;
|
|
20925
|
-
failed = true;
|
|
20926
|
-
}
|
|
20927
|
-
}
|
|
20928
|
-
}));
|
|
20929
|
-
if (failed)
|
|
20930
|
-
throw failure;
|
|
20931
|
-
return results;
|
|
20932
|
-
}
|
|
20933
|
-
|
|
20934
|
-
// src/project/currentIndexerRegistry.ts
|
|
20935
|
-
var init_currentIndexerRegistry = __esm(() => {
|
|
20936
|
-
init_src();
|
|
20937
|
-
init_commandReadCache();
|
|
20938
|
-
});
|
|
20939
|
-
// src/project/indexerReadScopeAuthorization.ts
|
|
20940
|
-
var init_indexerReadScopeAuthorization = __esm(() => {
|
|
20941
|
-
init_src();
|
|
20942
|
-
});
|
|
20943
|
-
|
|
20944
|
-
// src/project/indexerSourceBoundary.ts
|
|
20945
|
-
var init_indexerSourceBoundary = __esm(() => {
|
|
20946
|
-
init_currentIndexerRegistry();
|
|
20947
|
-
init_src();
|
|
20948
|
-
init_indexerReadScopeAuthorization();
|
|
20949
|
-
});
|
|
20950
|
-
|
|
20951
20909
|
// src/lib/errors.ts
|
|
20952
20910
|
var ContextError;
|
|
20953
20911
|
var init_errors2 = __esm(() => {
|
|
@@ -21010,11 +20968,162 @@ var init_cliFeedback = __esm(() => {
|
|
|
21010
20968
|
};
|
|
21011
20969
|
});
|
|
21012
20970
|
|
|
20971
|
+
// src/parserEntryWorker.ts
|
|
20972
|
+
import { readFile as readFile7, writeFile as writeFile2 } from "node:fs/promises";
|
|
20973
|
+
|
|
20974
|
+
// src/project/indexerParserRuntimeImport.ts
|
|
20975
|
+
init_commandReadCache();
|
|
20976
|
+
init_src();
|
|
20977
|
+
import { createHash as createHash4 } from "node:crypto";
|
|
20978
|
+
import { readFile as readFile4 } from "node:fs/promises";
|
|
20979
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
20980
|
+
import { dirname as dirname3, join as join3, parse as parse3 } from "node:path";
|
|
20981
|
+
import { pathToFileURL } from "node:url";
|
|
20982
|
+
var requireFromCli = createRequire2(import.meta.url);
|
|
20983
|
+
async function packageManifestForEntry(entryPath, expectedPackage) {
|
|
20984
|
+
let directory = dirname3(entryPath);
|
|
20985
|
+
const root = parse3(directory).root;
|
|
20986
|
+
while (directory !== root) {
|
|
20987
|
+
const path = join3(directory, "package.json");
|
|
20988
|
+
try {
|
|
20989
|
+
const parsed = await reuseCommandFileRead({
|
|
20990
|
+
key: "parser-package-manifest",
|
|
20991
|
+
paths: [path],
|
|
20992
|
+
read: async () => JSON.parse(await readFile4(path, "utf8"))
|
|
20993
|
+
});
|
|
20994
|
+
if (parsed.name === expectedPackage) {
|
|
20995
|
+
if (typeof parsed.version !== "string") {
|
|
20996
|
+
throw new TypeError(`installed parser ${expectedPackage} has no package version`);
|
|
20997
|
+
}
|
|
20998
|
+
return { path, value: { name: expectedPackage, version: parsed.version } };
|
|
20999
|
+
}
|
|
21000
|
+
} catch (error) {
|
|
21001
|
+
if (error instanceof SyntaxError || error && typeof error === "object" && "code" in error && error.code !== "ENOENT") {
|
|
21002
|
+
throw error;
|
|
21003
|
+
}
|
|
21004
|
+
}
|
|
21005
|
+
directory = dirname3(directory);
|
|
21006
|
+
}
|
|
21007
|
+
throw new TypeError(`cannot locate installed package manifest for ${expectedPackage}`);
|
|
21008
|
+
}
|
|
21009
|
+
async function resolveInstalledParserPackage(input) {
|
|
21010
|
+
let entryPath;
|
|
21011
|
+
try {
|
|
21012
|
+
entryPath = requireFromCli.resolve(input.package);
|
|
21013
|
+
} catch (error) {
|
|
21014
|
+
throw new TypeError(`locked parser package is not installed: ${input.package}`, {
|
|
21015
|
+
cause: error
|
|
21016
|
+
});
|
|
21017
|
+
}
|
|
21018
|
+
const manifest = await packageManifestForEntry(entryPath, input.package);
|
|
21019
|
+
if (manifest.value.version !== input.version) {
|
|
21020
|
+
throw new TypeError(`installed parser ${manifest.value.name}@${manifest.value.version} does not match lock ${input.version}`);
|
|
21021
|
+
}
|
|
21022
|
+
return {
|
|
21023
|
+
entry_path: entryPath,
|
|
21024
|
+
manifest: manifest.value
|
|
21025
|
+
};
|
|
21026
|
+
}
|
|
21027
|
+
function receiptDigest(value) {
|
|
21028
|
+
return indexerProtocolDigest(value);
|
|
21029
|
+
}
|
|
21030
|
+
async function loadProjectIndexerParser(input) {
|
|
21031
|
+
const lock = validateIndexerParserResolutionLock({
|
|
21032
|
+
requirement: input.requirement,
|
|
21033
|
+
mapping: input.mapping,
|
|
21034
|
+
lock: input.lock
|
|
21035
|
+
});
|
|
21036
|
+
validateIndexerParserImport({
|
|
21037
|
+
requirement: input.requirement,
|
|
21038
|
+
mapping: input.mapping,
|
|
21039
|
+
lock,
|
|
21040
|
+
parser_import: {
|
|
21041
|
+
capability: lock.capability,
|
|
21042
|
+
...lock.actual_coordinate,
|
|
21043
|
+
parser_lock_digest: lock.lock_digest
|
|
21044
|
+
}
|
|
21045
|
+
});
|
|
21046
|
+
const installed = await resolveInstalledParserPackage({
|
|
21047
|
+
package: lock.actual_coordinate.package,
|
|
21048
|
+
version: lock.actual_coordinate.version
|
|
21049
|
+
});
|
|
21050
|
+
const resolvedEntryDigest = `sha256:${createHash4("sha256").update(await readFile4(installed.entry_path)).digest("hex")}`;
|
|
21051
|
+
const loaded = await import(pathToFileURL(installed.entry_path).href);
|
|
21052
|
+
const adapter = loaded[lock.actual_coordinate.export];
|
|
21053
|
+
if (typeof adapter !== "function") {
|
|
21054
|
+
throw new TypeError(`installed parser ${lock.actual_coordinate.package} does not export ${lock.actual_coordinate.export}`);
|
|
21055
|
+
}
|
|
21056
|
+
const payload = {
|
|
21057
|
+
protocol: "context.indexer.parser-import-receipt/v1",
|
|
21058
|
+
capability: lock.capability,
|
|
21059
|
+
requirement_digest: lock.requirement_digest,
|
|
21060
|
+
mapping_digest: lock.mapping_digest,
|
|
21061
|
+
parser_lock_digest: lock.lock_digest,
|
|
21062
|
+
package: lock.actual_coordinate.package,
|
|
21063
|
+
export: lock.actual_coordinate.export,
|
|
21064
|
+
version: lock.actual_coordinate.version,
|
|
21065
|
+
resolved_entry_digest: resolvedEntryDigest,
|
|
21066
|
+
resolved_content_digest: lock.resolved_content_digest
|
|
21067
|
+
};
|
|
21068
|
+
return {
|
|
21069
|
+
adapter,
|
|
21070
|
+
module: loaded,
|
|
21071
|
+
receipt: { ...payload, receipt_digest: receiptDigest(payload) }
|
|
21072
|
+
};
|
|
21073
|
+
}
|
|
21074
|
+
|
|
21075
|
+
// src/project/indexerParserSourceMaterialization.ts
|
|
21076
|
+
init_codeAnalysisInput();
|
|
21077
|
+
|
|
21078
|
+
// src/project/parserConcurrency.ts
|
|
21079
|
+
async function mapParserWork(items, concurrency, run) {
|
|
21080
|
+
if (!Number.isSafeInteger(concurrency) || concurrency < 1) {
|
|
21081
|
+
throw new TypeError("parser concurrency must be a positive integer");
|
|
21082
|
+
}
|
|
21083
|
+
const results = new Array(items.length);
|
|
21084
|
+
let cursor = 0;
|
|
21085
|
+
let failed = false;
|
|
21086
|
+
let failure;
|
|
21087
|
+
await Promise.all(Array.from({ length: Math.min(concurrency, items.length) }, async () => {
|
|
21088
|
+
while (!failed && cursor < items.length) {
|
|
21089
|
+
const index = cursor++;
|
|
21090
|
+
try {
|
|
21091
|
+
results[index] = await run(items[index], index);
|
|
21092
|
+
} catch (error) {
|
|
21093
|
+
if (!failed)
|
|
21094
|
+
failure = error;
|
|
21095
|
+
failed = true;
|
|
21096
|
+
}
|
|
21097
|
+
}
|
|
21098
|
+
}));
|
|
21099
|
+
if (failed)
|
|
21100
|
+
throw failure;
|
|
21101
|
+
return results;
|
|
21102
|
+
}
|
|
21103
|
+
|
|
21104
|
+
// src/project/currentIndexerRegistry.ts
|
|
21105
|
+
init_src();
|
|
21106
|
+
init_commandReadCache();
|
|
21107
|
+
|
|
21013
21108
|
// src/project/indexerParserSourceMaterialization.ts
|
|
21109
|
+
init_src();
|
|
21014
21110
|
import { execFile } from "node:child_process";
|
|
21015
21111
|
import { lstat as lstat2, readFile as readFile6, stat as stat2 } from "node:fs/promises";
|
|
21016
21112
|
import { promisify } from "node:util";
|
|
21017
21113
|
import { basename, extname, join as join4 } from "node:path";
|
|
21114
|
+
|
|
21115
|
+
// src/project/indexerReadScopeAuthorization.ts
|
|
21116
|
+
init_src();
|
|
21117
|
+
|
|
21118
|
+
// src/project/indexerSourceBoundary.ts
|
|
21119
|
+
init_src();
|
|
21120
|
+
|
|
21121
|
+
// src/project/indexerParserSourceMaterialization.ts
|
|
21122
|
+
init_errors2();
|
|
21123
|
+
init_exitCode();
|
|
21124
|
+
init_cliFeedback();
|
|
21125
|
+
init_commandReadCache();
|
|
21126
|
+
var execFileAsync = promisify(execFile);
|
|
21018
21127
|
function sourceRefName(sourceRef) {
|
|
21019
21128
|
return sourceRef.startsWith("repo:") ? sourceRef.slice("repo:".length) : null;
|
|
21020
21129
|
}
|
|
@@ -21028,6 +21137,9 @@ async function trackedPaths(root, ref) {
|
|
|
21028
21137
|
return Buffer.from(stdout).toString("utf8").split("\x00").filter(Boolean).sort();
|
|
21029
21138
|
}
|
|
21030
21139
|
async function assertPinnedSource(root, ref) {
|
|
21140
|
+
return reuseCommandValue(`pinned-parser-source:${JSON.stringify([root, ref])}`, () => checkPinnedSource(root, ref));
|
|
21141
|
+
}
|
|
21142
|
+
async function checkPinnedSource(root, ref) {
|
|
21031
21143
|
const sourceStat = await stat2(root).catch((error) => {
|
|
21032
21144
|
if (error.code === "ENOENT" || error.code === "ENOTDIR")
|
|
21033
21145
|
return;
|
|
@@ -21114,125 +21226,8 @@ async function materializeProjectIndexerParserEntryInput(input) {
|
|
|
21114
21226
|
await assertPinnedSource(root, source2.ref);
|
|
21115
21227
|
return result;
|
|
21116
21228
|
}
|
|
21117
|
-
var execFileAsync;
|
|
21118
|
-
var init_indexerParserSourceMaterialization = __esm(() => {
|
|
21119
|
-
init_codeAnalysisInput();
|
|
21120
|
-
init_currentIndexerRegistry();
|
|
21121
|
-
init_src();
|
|
21122
|
-
init_indexerReadScopeAuthorization();
|
|
21123
|
-
init_indexerSourceBoundary();
|
|
21124
|
-
init_errors2();
|
|
21125
|
-
init_exitCode();
|
|
21126
|
-
init_cliFeedback();
|
|
21127
|
-
execFileAsync = promisify(execFile);
|
|
21128
|
-
});
|
|
21129
|
-
|
|
21130
|
-
// src/parserEntryWorker.ts
|
|
21131
|
-
import { readFile as readFile7, writeFile as writeFile2 } from "node:fs/promises";
|
|
21132
|
-
|
|
21133
|
-
// src/project/indexerParserRuntimeImport.ts
|
|
21134
|
-
init_commandReadCache();
|
|
21135
|
-
init_src();
|
|
21136
|
-
import { createHash as createHash4 } from "node:crypto";
|
|
21137
|
-
import { readFile as readFile4 } from "node:fs/promises";
|
|
21138
|
-
import { createRequire as createRequire2 } from "node:module";
|
|
21139
|
-
import { dirname as dirname3, join as join3, parse as parse3 } from "node:path";
|
|
21140
|
-
import { pathToFileURL } from "node:url";
|
|
21141
|
-
var requireFromCli = createRequire2(import.meta.url);
|
|
21142
|
-
async function packageManifestForEntry(entryPath, expectedPackage) {
|
|
21143
|
-
let directory = dirname3(entryPath);
|
|
21144
|
-
const root = parse3(directory).root;
|
|
21145
|
-
while (directory !== root) {
|
|
21146
|
-
const path = join3(directory, "package.json");
|
|
21147
|
-
try {
|
|
21148
|
-
const parsed = await reuseCommandFileRead({
|
|
21149
|
-
key: "parser-package-manifest",
|
|
21150
|
-
paths: [path],
|
|
21151
|
-
read: async () => JSON.parse(await readFile4(path, "utf8"))
|
|
21152
|
-
});
|
|
21153
|
-
if (parsed.name === expectedPackage) {
|
|
21154
|
-
if (typeof parsed.version !== "string") {
|
|
21155
|
-
throw new TypeError(`installed parser ${expectedPackage} has no package version`);
|
|
21156
|
-
}
|
|
21157
|
-
return { path, value: { name: expectedPackage, version: parsed.version } };
|
|
21158
|
-
}
|
|
21159
|
-
} catch (error) {
|
|
21160
|
-
if (error instanceof SyntaxError || error && typeof error === "object" && "code" in error && error.code !== "ENOENT") {
|
|
21161
|
-
throw error;
|
|
21162
|
-
}
|
|
21163
|
-
}
|
|
21164
|
-
directory = dirname3(directory);
|
|
21165
|
-
}
|
|
21166
|
-
throw new TypeError(`cannot locate installed package manifest for ${expectedPackage}`);
|
|
21167
|
-
}
|
|
21168
|
-
async function resolveInstalledParserPackage(input) {
|
|
21169
|
-
let entryPath;
|
|
21170
|
-
try {
|
|
21171
|
-
entryPath = requireFromCli.resolve(input.package);
|
|
21172
|
-
} catch (error) {
|
|
21173
|
-
throw new TypeError(`locked parser package is not installed: ${input.package}`, {
|
|
21174
|
-
cause: error
|
|
21175
|
-
});
|
|
21176
|
-
}
|
|
21177
|
-
const manifest = await packageManifestForEntry(entryPath, input.package);
|
|
21178
|
-
if (manifest.value.version !== input.version) {
|
|
21179
|
-
throw new TypeError(`installed parser ${manifest.value.name}@${manifest.value.version} does not match lock ${input.version}`);
|
|
21180
|
-
}
|
|
21181
|
-
return {
|
|
21182
|
-
entry_path: entryPath,
|
|
21183
|
-
manifest: manifest.value
|
|
21184
|
-
};
|
|
21185
|
-
}
|
|
21186
|
-
function receiptDigest(value) {
|
|
21187
|
-
return indexerProtocolDigest(value);
|
|
21188
|
-
}
|
|
21189
|
-
async function loadProjectIndexerParser(input) {
|
|
21190
|
-
const lock = validateIndexerParserResolutionLock({
|
|
21191
|
-
requirement: input.requirement,
|
|
21192
|
-
mapping: input.mapping,
|
|
21193
|
-
lock: input.lock
|
|
21194
|
-
});
|
|
21195
|
-
validateIndexerParserImport({
|
|
21196
|
-
requirement: input.requirement,
|
|
21197
|
-
mapping: input.mapping,
|
|
21198
|
-
lock,
|
|
21199
|
-
parser_import: {
|
|
21200
|
-
capability: lock.capability,
|
|
21201
|
-
...lock.actual_coordinate,
|
|
21202
|
-
parser_lock_digest: lock.lock_digest
|
|
21203
|
-
}
|
|
21204
|
-
});
|
|
21205
|
-
const installed = await resolveInstalledParserPackage({
|
|
21206
|
-
package: lock.actual_coordinate.package,
|
|
21207
|
-
version: lock.actual_coordinate.version
|
|
21208
|
-
});
|
|
21209
|
-
const resolvedEntryDigest = `sha256:${createHash4("sha256").update(await readFile4(installed.entry_path)).digest("hex")}`;
|
|
21210
|
-
const loaded = await import(pathToFileURL(installed.entry_path).href);
|
|
21211
|
-
const adapter = loaded[lock.actual_coordinate.export];
|
|
21212
|
-
if (typeof adapter !== "function") {
|
|
21213
|
-
throw new TypeError(`installed parser ${lock.actual_coordinate.package} does not export ${lock.actual_coordinate.export}`);
|
|
21214
|
-
}
|
|
21215
|
-
const payload = {
|
|
21216
|
-
protocol: "context.indexer.parser-import-receipt/v1",
|
|
21217
|
-
capability: lock.capability,
|
|
21218
|
-
requirement_digest: lock.requirement_digest,
|
|
21219
|
-
mapping_digest: lock.mapping_digest,
|
|
21220
|
-
parser_lock_digest: lock.lock_digest,
|
|
21221
|
-
package: lock.actual_coordinate.package,
|
|
21222
|
-
export: lock.actual_coordinate.export,
|
|
21223
|
-
version: lock.actual_coordinate.version,
|
|
21224
|
-
resolved_entry_digest: resolvedEntryDigest,
|
|
21225
|
-
resolved_content_digest: lock.resolved_content_digest
|
|
21226
|
-
};
|
|
21227
|
-
return {
|
|
21228
|
-
adapter,
|
|
21229
|
-
module: loaded,
|
|
21230
|
-
receipt: { ...payload, receipt_digest: receiptDigest(payload) }
|
|
21231
|
-
};
|
|
21232
|
-
}
|
|
21233
21229
|
|
|
21234
21230
|
// src/project/indexerParserEntryWorker.ts
|
|
21235
|
-
init_indexerParserSourceMaterialization();
|
|
21236
21231
|
init_debugTrace();
|
|
21237
21232
|
async function prepareParserEntryInProcess(input) {
|
|
21238
21233
|
const loaded = await loadProjectIndexerParser(input);
|
package/plugins/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.7.
|
|
1
|
+
0.7.92
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c4a",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.92",
|
|
4
4
|
"description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
|
|
5
5
|
"author": { "name": "c4a" },
|
|
6
6
|
"homepage": "https://github.com/context4ai/c4a",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"skills": "./skills/",
|
|
11
11
|
"interface": {
|
|
12
12
|
"displayName": "C4A Context",
|
|
13
|
-
"shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.7.
|
|
13
|
+
"shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.7.92",
|
|
14
14
|
"longDescription": "Create a Context workspace and use agent-guided next steps to register sources, run extraction, review candidates, build package outputs, and verify health without silently mutating source repositories.",
|
|
15
15
|
"developerName": "c4a",
|
|
16
16
|
"category": "Productivity",
|
|
@@ -130,7 +130,9 @@ and confirmed contributions. New explanatory context does not require
|
|
|
130
130
|
repartitioning unchanged code.
|
|
131
131
|
|
|
132
132
|
Each fragment uses actual source regions from at most three source files (up
|
|
133
|
-
to eight regions in total); the CLI computes content digests.
|
|
133
|
+
to eight regions in total); the CLI computes content digests. Organize fragments
|
|
134
|
+
by topic and cite only sources that support that fragment. If either limit is
|
|
135
|
+
exceeded, split by topic or keep the primary supporting files. Do not use fallback evidence from an unrelated
|
|
134
136
|
member, fabricate a continuous span for unrelated locations, or include
|
|
135
137
|
process identities, full source bodies or credentials in reader output.
|
|
136
138
|
|
|
@@ -28,7 +28,10 @@ description follow that schema; there is no ArtifactResult, subject identity
|
|
|
28
28
|
or profile-owned output mapping to assemble.
|
|
29
29
|
|
|
30
30
|
For each output fragment, cite the actual source regions used, from at most
|
|
31
|
-
three source files (up to eight regions in total).
|
|
31
|
+
three source files (up to eight regions in total). Organize fragments by topic
|
|
32
|
+
and cite only sources that support that fragment. If either limit is exceeded,
|
|
33
|
+
split by topic or keep the primary supporting files.
|
|
34
|
+
Use source_ref and an inclusive file/line locator; the CLI computes
|
|
32
35
|
content digests. Do not attach an entire corpus to a generic paragraph or
|
|
33
36
|
combine unrelated locations into a fabricated continuous span. Split genuinely
|
|
34
37
|
distinct explanations when they need distinct references.
|