@c4a/context-cli 0.6.4 → 0.6.5

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 CHANGED
@@ -47498,12 +47498,22 @@ var loadSourceInfo = async (modulePath, fs) => {
47498
47498
  content: { raw: await fs.readFile(GO_MOD) }
47499
47499
  });
47500
47500
  }
47501
+ const detectedLanguages = [
47502
+ ...manifests.some((manifest) => manifest.type === GO_MOD) ? ["go"] : [],
47503
+ ...manifests.some((manifest) => manifest.type === PACKAGE_JSON) ? ["typescript"] : []
47504
+ ];
47501
47505
  return {
47502
47506
  path: normalizeRelativePath(modulePath),
47503
47507
  manifests,
47504
- ...manifests.some((manifest) => manifest.type === GO_MOD) ? { language: "go" } : manifests.some((manifest) => manifest.type === PACKAGE_JSON) ? { language: "typescript" } : {}
47508
+ ...detectedLanguages.length === 1 ? { language: detectedLanguages[0] } : {}
47505
47509
  };
47506
47510
  };
47511
+ function manifestForPlugin(source2, plugin) {
47512
+ if (plugin.manifestTypes !== undefined) {
47513
+ return source2.manifests.find((manifest) => plugin.manifestTypes?.includes(manifest.type));
47514
+ }
47515
+ return source2.manifests.length === 1 ? source2.manifests[0] : undefined;
47516
+ }
47507
47517
  var prefixSymbolPaths = (symbol, modulePath) => ({
47508
47518
  ...symbol,
47509
47519
  ...symbol.file.trim() ? { file: resolveRepoRelativePath(modulePath, symbol.file) } : {},
@@ -47600,12 +47610,12 @@ var runRepositoryExtraction = async (input) => {
47600
47610
  });
47601
47611
  continue;
47602
47612
  }
47603
- const manifest = sourceInfo.manifests.find((candidate) => candidate.type === PACKAGE_JSON) ?? sourceInfo.manifests[0];
47613
+ const manifest = manifestForPlugin(sourceInfo, plugin);
47604
47614
  if (!manifest) {
47605
47615
  moduleErrors.push({
47606
47616
  module_name: module.name,
47607
47617
  module_path: module.path,
47608
- error: `Module "${module.name}" has no supported manifest for extraction`
47618
+ error: plugin.manifestTypes === undefined && sourceInfo.manifests.length > 1 ? `Extraction plugin "${plugin.id}" must declare manifestTypes for mixed-manifest module "${module.name}"` : `Module "${module.name}" has no manifest supported by extraction plugin "${plugin.id}"`
47609
47619
  });
47610
47620
  continue;
47611
47621
  }
@@ -65763,6 +65773,7 @@ class TypeScriptPlugin {
65763
65773
  id = "c4a-extract-ts";
65764
65774
  languages = ["typescript", "tsx"];
65765
65775
  packageManagers = ["npm"];
65776
+ manifestTypes = ["package.json"];
65766
65777
  #lastDetection = null;
65767
65778
  canHandle(source2) {
65768
65779
  return source2.manifests.some((manifest) => manifest.type === "package.json");
@@ -85350,6 +85361,20 @@ async function deliverFromGit(input) {
85350
85361
  }
85351
85362
  };
85352
85363
  }
85364
+ async function packageAssetDeliveryFingerprintInput(input) {
85365
+ if (input.definition?.delivery !== "git-raw" || input.assets.length === 0)
85366
+ return null;
85367
+ const delivery = await deliverFromGit({
85368
+ projectRoot: input.projectRoot,
85369
+ assets: input.assets,
85370
+ definition: input.definition
85371
+ });
85372
+ return {
85373
+ state: "git-raw",
85374
+ ...delivery.summary.git === undefined ? {} : { git: delivery.summary.git },
85375
+ targets: [...delivery.targetByOriginal.entries()].sort(([left], [right]) => left.localeCompare(right))
85376
+ };
85377
+ }
85353
85378
  async function deliverPackageAssetFiles(input) {
85354
85379
  if (input.definition?.delivery === "git-raw") {
85355
85380
  return deliverFromGit({ projectRoot: input.projectRoot, assets: input.assets, definition: input.definition });
@@ -85781,7 +85806,7 @@ init_workspace();
85781
85806
  init_packageTemplateReview();
85782
85807
  var KNOWLEDGE_ROOT4 = "knowledge";
85783
85808
  var PACKAGE_FINGERPRINT_ROOT = join51(".tmp", "context-runtime", "packages");
85784
- var PACKAGE_BUILDER_PROTOCOL_VERSION = "v13-explicit-asset-delivery";
85809
+ var PACKAGE_BUILDER_PROTOCOL_VERSION = "v14-git-asset-identity";
85785
85810
  function packageAssetDeliverySummary(value) {
85786
85811
  if (value === null || typeof value !== "object" || Array.isArray(value))
85787
85812
  return;
@@ -85851,11 +85876,18 @@ async function packageInputFingerprint(input) {
85851
85876
  content: file.content
85852
85877
  })));
85853
85878
  const assets = new Map;
85879
+ const assetFiles = new Map;
85854
85880
  for (const projection of projectedAssets) {
85855
85881
  for (const asset of projection.assets) {
85856
85882
  assets.set(asset.packageRelPath, createHash20("sha256").update(asset.bytes).digest("hex"));
85883
+ assetFiles.set(asset.packageRelPath, asset);
85857
85884
  }
85858
85885
  }
85886
+ const assetDelivery = input.pkg.kind === "package.kb" ? await packageAssetDeliveryFingerprintInput({
85887
+ projectRoot: input.projectRoot,
85888
+ assets: [...assetFiles.values()],
85889
+ ...input.pkg.assets === undefined ? {} : { definition: input.pkg.assets }
85890
+ }) : null;
85859
85891
  return stableHash3({
85860
85892
  builder: PACKAGE_BUILDER_PROTOCOL_VERSION,
85861
85893
  package: {
@@ -85873,6 +85905,7 @@ async function packageInputFingerprint(input) {
85873
85905
  content: file.content
85874
85906
  })),
85875
85907
  assets: [...assets].sort(([left], [right]) => left.localeCompare(right)),
85908
+ assetDelivery,
85876
85909
  template: input.templateFiles.map((file) => ({
85877
85910
  path: file.relPath,
85878
85911
  content: file.content
@@ -87164,12 +87197,13 @@ function createContextWorkflowFacts(observation, authorities) {
87164
87197
  }
87165
87198
 
87166
87199
  // src/project/workflow/workflowHostPlans.ts
87167
- function command(value, effect, managedExecution = effect === "write" ? "automatic" : "agent-required") {
87200
+ function command(value, effect, managedExecution = effect === "write" ? "automatic" : "agent-required", execution) {
87168
87201
  return {
87169
87202
  command: value,
87170
87203
  effect,
87171
87204
  availability: "immediate",
87172
- managed_execution: managedExecution
87205
+ managed_execution: managedExecution,
87206
+ ...execution === undefined ? {} : { execution }
87173
87207
  };
87174
87208
  }
87175
87209
  function withJsonFormat(value) {
@@ -87257,8 +87291,10 @@ var HOST_PLAN_RESOLVERS = {
87257
87291
  }),
87258
87292
  "context.extract.next": (observation) => {
87259
87293
  const phase = observation.staleSourcePhases[0] ?? observation.pendingExtractPhases[0];
87294
+ const definition3 = observation.phases.find((candidate) => candidate.id === phase);
87295
+ const projectCode = definition3?.kind === "phase.extract.custom" || definition3?.kind === "phase.custom";
87260
87296
  return {
87261
- commands: phase === undefined ? [] : [command(`context run ${phase} --format json`, "write")]
87297
+ commands: phase === undefined ? [] : [command(`context run ${phase} --format json`, "write", "automatic", projectCode ? { target: "subprocess" } : undefined)]
87262
87298
  };
87263
87299
  },
87264
87300
  "context.document.inspect-classification": (observation) => ({
@@ -101629,7 +101665,8 @@ async function runWorkflowUntilBlockedOrComplete(input) {
101629
101665
  receipt = await input.execute({
101630
101666
  cwd: status.projectRoot,
101631
101667
  command: selected.command.command,
101632
- effect: selected.command.effect
101668
+ effect: selected.command.effect,
101669
+ ...selected.command.execution === undefined ? {} : { execution: selected.command.execution }
101633
101670
  });
101634
101671
  } catch (error) {
101635
101672
  steps.push(step);
@@ -101874,7 +101911,7 @@ class WorkspaceExecutionRuntime {
101874
101911
  throw new Error(`workspace execution runtime cannot cross roots: ${input.cwd}`);
101875
101912
  }
101876
101913
  const args = parseContextCommand(input.command);
101877
- if (input.effect !== "external" && this.inProcess.supports({ ...input, args })) {
101914
+ if (input.execution?.target !== "subprocess" && input.effect !== "external" && this.inProcess.supports({ ...input, args })) {
101878
101915
  return this.executeInProcess({ ...input, args });
101879
101916
  }
101880
101917
  return this.executeSubprocess(input);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4a/context-cli",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "type": "module",
5
5
  "description": "Local CLI for capturing, compiling, and governing knowledge workspaces",
6
6
  "license": "MIT",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@c4a/agent-graph": "0.2.5",
27
- "@c4a/context": "0.6.4",
27
+ "@c4a/context": "0.6.5",
28
28
  "commander": "^11.0.0",
29
29
  "fast-xml-parser": "^5.10.1",
30
30
  "handlebars": "^4.7.8",
package/plugins/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.4
1
+ 0.6.5
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "context",
3
3
  "description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
4
- "version": "0.6.4",
4
+ "version": "0.6.5",
5
5
  "author": {
6
6
  "name": "c4a"
7
7
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "context",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
5
5
  "author": {
6
6
  "name": "c4a"
@@ -18,7 +18,7 @@
18
18
  "skills": "./skills/",
19
19
  "interface": {
20
20
  "displayName": "C4A Context",
21
- "shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.4",
21
+ "shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.5",
22
22
  "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.",
23
23
  "developerName": "c4a",
24
24
  "category": "Productivity",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "context",
3
3
  "displayName": "C4A Context",
4
- "version": "0.6.4",
4
+ "version": "0.6.5",
5
5
  "description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
6
6
  "author": {
7
7
  "name": "Context4AI",
@@ -2,7 +2,7 @@
2
2
  "schema": "agent-graph.bundle.v1",
3
3
  "provider": {
4
4
  "id": "c4a/context",
5
- "version": "0.6.4"
5
+ "version": "0.6.5"
6
6
  },
7
7
  "providerManifest": "provider.yaml",
8
8
  "graphs": [
@@ -168,7 +168,7 @@
168
168
  {
169
169
  "id": "context.sdk.package-templates",
170
170
  "path": "resources/manuals/reference/package-templates.md",
171
- "digest": "sha256:125c867bfc33e953541f89f1fc4f9b779680e9d994071a47dd8d6c36201a2e7a"
171
+ "digest": "sha256:c42ea22df144db608ab5dc3718704b2e42c0e7a4fe51ca322dfbe705f0619549"
172
172
  },
173
173
  {
174
174
  "id": "context.sdk.project-api",
@@ -508,7 +508,7 @@
508
508
  },
509
509
  {
510
510
  "path": "provider.yaml",
511
- "digest": "sha256:f02c4060d0a30553de73be5ada2ea3086c5e91348fd920cbf282f60bebf270b5"
511
+ "digest": "sha256:bcf4649a83ca09e4562f83ab8919bdfcaa1134866706506876ce6172a393856c"
512
512
  },
513
513
  {
514
514
  "path": "resources/diagnostics/projection-stale.md",
@@ -576,7 +576,7 @@
576
576
  },
577
577
  {
578
578
  "path": "resources/manuals/reference/package-templates.md",
579
- "digest": "sha256:125c867bfc33e953541f89f1fc4f9b779680e9d994071a47dd8d6c36201a2e7a"
579
+ "digest": "sha256:c42ea22df144db608ab5dc3718704b2e42c0e7a4fe51ca322dfbe705f0619549"
580
580
  },
581
581
  {
582
582
  "path": "resources/manuals/reference/project-api.md",
@@ -714,5 +714,5 @@
714
714
  "graphDependencies": {
715
715
  "workspace": []
716
716
  },
717
- "digest": "sha256:c039063eb3d29dadd7b60279dfd97f809c007f8cbb39f1dafe47667a994cd3e7"
717
+ "digest": "sha256:b6e58683cf5ef86192337938b45e2bc4cbafb2512944786e9ab9e76a438dfa94"
718
718
  }
@@ -1,6 +1,6 @@
1
1
  schema: agent-graph.provider.v1
2
2
  id: c4a/context
3
- version: 0.6.4
3
+ version: 0.6.5
4
4
  name: Context workflow
5
5
  description: Internal work contract for Context knowledge workspaces.
6
6
  graphs:
@@ -67,14 +67,18 @@ llmsPackage({
67
67
 
68
68
  Use Git raw delivery when resources are published from a Git repository.
69
69
  Without `urlPrefix`, the Context workspace must be inside Git; GitHub remotes
70
- are derived automatically and pinned to the current commit. Other hosts and
71
- workspaces outside Git accept an explicit HTTPS prefix; Context appends the
72
- project-relative `knowledge/assets/...` path. Context does not check whether
73
- the resources are committed, pushed, or remotely readable; publishing them is
74
- the package author's responsibility.
75
- `{commit}` is replaced when present. A literal branch in the prefix is allowed
76
- but intentionally follows that mutable branch. The configured raw host must be
77
- reachable by the eventual package consumers.
70
+ are derived automatically and pinned to the current commit. Other hosts accept
71
+ an explicit HTTPS prefix. `{commit}` is replaced only when the workspace is
72
+ inside Git, because Context must resolve the current commit. A workspace outside
73
+ Git must use a literal, already-published prefix without `{commit}`. Context
74
+ appends the project-relative `knowledge/assets/...` path.
75
+
76
+ The resolved commit and raw URL participate in package freshness, so changing
77
+ Git HEAD or the selected remote makes an existing package stale. Context does
78
+ not check whether resources are committed, pushed, or remotely readable;
79
+ publishing them is the package author's responsibility. A literal branch in the
80
+ prefix is allowed but intentionally follows that mutable branch. The configured
81
+ raw host must be reachable by the eventual package consumers.
78
82
 
79
83
  ```ts
80
84
  assets: {
@@ -83,8 +87,15 @@ assets: {
83
87
  }
84
88
  ```
85
89
 
86
- When the workspace is not in Git and has no explicit raw prefix, choose bundled
87
- delivery or explicit omission:
90
+ Outside Git, use a literal published prefix or choose bundled delivery or
91
+ explicit omission:
92
+
93
+ ```ts
94
+ assets: {
95
+ delivery: "git-raw",
96
+ urlPrefix: "https://code.example.com/team/knowledge/raw/published-assets",
97
+ }
98
+ ```
88
99
 
89
100
  ```ts
90
101
  assets: { delivery: "bundle" }