codegate-ai 1.0.2 → 1.1.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/dist/cli.d.ts CHANGED
@@ -9,6 +9,7 @@ import { type ScanDiscoveryCandidate, type ScanDiscoveryContext } from "./scan.j
9
9
  import { type ResolvedScanTarget } from "./scan-target.js";
10
10
  import type { CodeGateReport } from "./types/report.js";
11
11
  import { type RemediationRunnerInput, type RemediationRunnerResult } from "./layer4-remediation/remediation-runner.js";
12
+ import { type ContentUpdaterDeps } from "./content/content-updater.js";
12
13
  import { type SkillsWrapperLaunchResult } from "./commands/skills-wrapper.js";
13
14
  import { type ClawhubWrapperLaunchResult } from "./commands/clawhub-wrapper.js";
14
15
  import { type DeepAgentOption, type MetaAgentCommandConsentContext, type MetaAgentCommandRunResult, type RemediationConsentContext, type ScanRunnerInput } from "./commands/scan-command.js";
@@ -59,6 +60,13 @@ export interface CliDeps {
59
60
  requestTrustConsent?: (directory: string) => Promise<boolean> | boolean;
60
61
  requestSkillSelection?: (options: string[]) => Promise<string | null> | string | null;
61
62
  executeDeepResource?: (resource: DeepScanResource, context?: DeepResourceExecutionContext) => Promise<ResourceFetchResult>;
63
+ /**
64
+ * Overrides for the content-updater (publisher key, fetch, filesystem).
65
+ * Lets tests exercise the update commands hermetically — e.g. inject
66
+ * `publisherKeyPem: null` to cover the fail-closed path regardless of the
67
+ * key pinned into this build.
68
+ */
69
+ contentUpdaterDeps?: ContentUpdaterDeps;
62
70
  launchSkills?: (args: string[], cwd: string) => SkillsWrapperLaunchResult;
63
71
  launchClawhub?: (args: string[], cwd: string) => ClawhubWrapperLaunchResult;
64
72
  runSkillsWrapper?: (input: {
package/dist/cli.js CHANGED
@@ -20,7 +20,7 @@ import { executeWrapperRun } from "./wrapper.js";
20
20
  import { runRemediation as runRemediationWorkflow, } from "./layer4-remediation/remediation-runner.js";
21
21
  import { undoLatestSession } from "./commands/undo.js";
22
22
  import { addTrustedDirectory, listTrustedDirectories, removeTrustedDirectory, } from "./commands/trust.js";
23
- import { checkContentUpdate, rollbackContent, updateContent } from "./content/content-updater.js";
23
+ import { checkContentUpdate, rollbackContent, updateContent, } from "./content/content-updater.js";
24
24
  import { runInventory } from "./commands/inventory-command.js";
25
25
  import { executeScanCommand } from "./commands/scan-command.js";
26
26
  import { executeScanContentCommand, SCAN_CONTENT_TYPES, } from "./commands/scan-content-command.js";
@@ -822,13 +822,15 @@ function addUpdateCommands(program, deps) {
822
822
  .action(async (options) => {
823
823
  try {
824
824
  if (options.rollback) {
825
- const rolledBack = rollbackContent();
825
+ const rolledBack = rollbackContent(deps.contentUpdaterDeps ?? {});
826
826
  deps.stdout(`Rolled back to content version ${rolledBack.version}.`);
827
827
  deps.setExitCode(0);
828
828
  return;
829
829
  }
830
830
  if (options.check) {
831
- const checked = await checkContentUpdate({}, { baseUrl: options.url });
831
+ const checked = await checkContentUpdate(deps.contentUpdaterDeps ?? {}, {
832
+ baseUrl: options.url,
833
+ });
832
834
  deps.stdout(`Installed content: ${checked.currentVersion ?? "bundled only"}`);
833
835
  deps.stdout(`Latest published: ${checked.remoteVersion}`);
834
836
  deps.stdout(checked.updateAvailable
@@ -837,7 +839,9 @@ function addUpdateCommands(program, deps) {
837
839
  deps.setExitCode(0);
838
840
  return;
839
841
  }
840
- const updated = await updateContent({}, { baseUrl: options.url });
842
+ const updated = await updateContent(deps.contentUpdaterDeps ?? {}, {
843
+ baseUrl: options.url,
844
+ });
841
845
  if (updated.changed) {
842
846
  deps.stdout(`Updated content: ${updated.previousVersion ?? "bundled only"} -> ${updated.version}`);
843
847
  if (updated.pruned.length > 0) {
@@ -1,10 +1,12 @@
1
1
  /**
2
2
  * Ed25519 public key of the CodeGate content publisher, PEM (SPKI) format.
3
3
  *
4
- * Deliberately null until the owner decides key custody and the content
5
- * repository location (see docs/content-feed.md). While null, the update
6
- * commands refuse to fetch and every loader uses only bundled content.
7
- * Generate a pair with scripts/content-feed/generate-keypair.mjs and paste
8
- * the public PEM here.
4
+ * Verifies bundles published by the content-feed repository
5
+ * (see docs/content-feed.md). The matching private key is held offline by
6
+ * the repository owner it exists in no repository and no CI secret.
7
+ * Rotation means pasting a new public PEM here and shipping a release;
8
+ * older builds reject bundles signed by the new key, which is the intended
9
+ * fail-closed behavior. If this is ever set to null, the update commands
10
+ * refuse to fetch and every loader uses only bundled content.
9
11
  */
10
12
  export declare const CONTENT_PUBLISHER_PUBLIC_KEY_PEM: string | null;
@@ -1,10 +1,15 @@
1
1
  /**
2
2
  * Ed25519 public key of the CodeGate content publisher, PEM (SPKI) format.
3
3
  *
4
- * Deliberately null until the owner decides key custody and the content
5
- * repository location (see docs/content-feed.md). While null, the update
6
- * commands refuse to fetch and every loader uses only bundled content.
7
- * Generate a pair with scripts/content-feed/generate-keypair.mjs and paste
8
- * the public PEM here.
4
+ * Verifies bundles published by the content-feed repository
5
+ * (see docs/content-feed.md). The matching private key is held offline by
6
+ * the repository owner it exists in no repository and no CI secret.
7
+ * Rotation means pasting a new public PEM here and shipping a release;
8
+ * older builds reject bundles signed by the new key, which is the intended
9
+ * fail-closed behavior. If this is ever set to null, the update commands
10
+ * refuse to fetch and every loader uses only bundled content.
9
11
  */
10
- export const CONTENT_PUBLISHER_PUBLIC_KEY_PEM = null;
12
+ export const CONTENT_PUBLISHER_PUBLIC_KEY_PEM = `-----BEGIN PUBLIC KEY-----
13
+ MCowBQYDK2VwAyEA9q23ANqtLZROQGIHu0+LU9m3Rav/ud4CsVB+7Iow27g=
14
+ -----END PUBLIC KEY-----
15
+ `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codegate-ai",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Pre-flight security scanner for AI coding tool configurations.",
5
5
  "license": "MIT",
6
6
  "type": "module",