fullcourtdefense-cli 1.35.10 → 1.36.2

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.
Files changed (74) hide show
  1. package/dist/actionPolicyEngine.d.ts +24 -0
  2. package/dist/actionPolicyEngine.js +79 -19
  3. package/dist/approvalPrompt.d.ts +15 -0
  4. package/dist/approvalPrompt.js +157 -20
  5. package/dist/askDialog.d.ts +2 -0
  6. package/dist/askDialog.js +15 -1
  7. package/dist/askHeader.d.ts +81 -0
  8. package/dist/askHeader.js +573 -0
  9. package/dist/blockExplanation.d.ts +9 -0
  10. package/dist/blockExplanation.js +14 -0
  11. package/dist/callerEnv.d.ts +1 -1
  12. package/dist/callerEnv.js +14 -0
  13. package/dist/cloudGrant.d.ts +46 -0
  14. package/dist/cloudGrant.js +420 -0
  15. package/dist/cloudGrantTools.d.ts +97 -0
  16. package/dist/cloudGrantTools.js +1112 -0
  17. package/dist/commandNarrative.d.ts +8 -0
  18. package/dist/commandNarrative.js +222 -49
  19. package/dist/commands/cmdGuard.js +3 -1
  20. package/dist/commands/daemon.js +56 -2
  21. package/dist/commands/deterministicGuard.d.ts +70 -4
  22. package/dist/commands/deterministicGuard.js +494 -63
  23. package/dist/commands/discover.js +50 -16
  24. package/dist/commands/discoverAgentFiles.d.ts +2 -0
  25. package/dist/commands/discoverAgentFiles.js +1 -0
  26. package/dist/commands/discoverPaths.d.ts +4 -0
  27. package/dist/commands/discoverPaths.js +19 -1
  28. package/dist/commands/discoverProjectRoots.d.ts +72 -0
  29. package/dist/commands/discoverProjectRoots.js +327 -0
  30. package/dist/commands/discoverProxy.d.ts +1 -1
  31. package/dist/commands/discoverProxy.js +1 -1
  32. package/dist/commands/discoverSecrets.d.ts +44 -0
  33. package/dist/commands/discoverSecrets.js +158 -14
  34. package/dist/commands/hook.js +25 -10
  35. package/dist/commands/knownMcpServers.d.ts +8 -2
  36. package/dist/commands/knownMcpServers.js +33 -2
  37. package/dist/commands/mcpGateway.js +9 -7
  38. package/dist/commands/posixShellGuard.js +1 -1
  39. package/dist/commands/shellGuard.js +86 -26
  40. package/dist/commands/uninstallAll.d.ts +1 -7
  41. package/dist/commands/uninstallAll.js +6 -45
  42. package/dist/commands/watchdog.js +17 -3
  43. package/dist/config.d.ts +1 -1
  44. package/dist/config.js +3 -3
  45. package/dist/credentialGrant.d.ts +48 -0
  46. package/dist/credentialGrant.js +29 -18
  47. package/dist/credentialStore.js +1 -1
  48. package/dist/devConfirm.d.ts +51 -3
  49. package/dist/devConfirm.js +226 -33
  50. package/dist/distress.d.ts +2 -0
  51. package/dist/distress.js +2 -0
  52. package/dist/grantTargets.d.ts +21 -0
  53. package/dist/grantTargets.js +235 -0
  54. package/dist/localSafetySnapshot.js +2 -0
  55. package/dist/msiProductCode.d.ts +10 -0
  56. package/dist/msiProductCode.js +124 -0
  57. package/dist/notify.js +1 -0
  58. package/dist/selfTest.d.ts +1 -1
  59. package/dist/selfTest.js +1 -1
  60. package/dist/selfUpdate.d.ts +108 -0
  61. package/dist/selfUpdate.js +353 -18
  62. package/dist/shellAst.d.ts +2 -0
  63. package/dist/shellAst.js +7 -1
  64. package/dist/shellAstLoader.js +14 -1
  65. package/dist/telemetry.d.ts +3 -0
  66. package/dist/telemetry.js +1 -0
  67. package/dist/version.json +1 -1
  68. package/installer/macos/guardian/ai.fullcourtdefense.guardian.plist +19 -0
  69. package/installer/macos/guardian/fcd-guardian.sh +590 -0
  70. package/installer/macos/guardian/install-guardian.sh +32 -0
  71. package/installer/macos/guardian/uninstall-guardian.sh +12 -0
  72. package/installer/windows/README.md +88 -0
  73. package/installer/windows/rescue/FullCourtDefense-Rescue.ps1 +229 -0
  74. package/package.json +11 -1
@@ -1,5 +1,5 @@
1
1
  export type DeterministicDirection = 'request' | 'response';
2
- export type DeterministicCategory = 'sensitive_file' | 'metadata_ssrf' | 'credential_command' | 'destructive_command' | 'destructive_sql' | 'infra_destroy' | 'reverse_shell' | 'secret_exfiltration' | 'honeypot' | 'agent_guard_tamper';
2
+ export type DeterministicCategory = 'sensitive_file' | 'metadata_ssrf' | 'credential_command' | 'destructive_command' | 'destructive_sql' | 'infra_destroy' | 'reverse_shell' | 'secret_exfiltration' | 'remote_control' | 'honeypot' | 'agent_guard_tamper';
3
3
  /**
4
4
  * Per-rule enforcement action (org-configured, shipped in the Local Safety
5
5
  * snapshot). Absent everywhere = 'block' — the only behavior older CLIs and
@@ -34,6 +34,8 @@ export interface DeterministicFinding {
34
34
  * findings — the seam 'mask' uses to redact tool responses. Never spooled.
35
35
  */
36
36
  matchedSecret?: string;
37
+ /** Catalog facts for remote_control findings (bridge id, mode, launcher) — no argument text. */
38
+ remoteControl?: RemoteControlFacts;
37
39
  }
38
40
  export interface LocalSafetyCustomBlock {
39
41
  id: string;
@@ -70,6 +72,12 @@ export interface LocalSafetyScanOptions {
70
72
  * attack fixtures (security tooling, guard regression tests).
71
73
  */
72
74
  trustedScriptPaths?: string[];
75
+ /**
76
+ * ProductCodes (`{GUID}`) of the installed FullCourtDefense MSI, recorded on
77
+ * this machine by the daemon from the uninstall registry key. The code changes
78
+ * with every build, so `msiexec /x {GUID}` is ours only when it is listed here.
79
+ */
80
+ fcdProductCodes?: string[];
73
81
  }
74
82
  /**
75
83
  * Built-ins that ship OFF until an org switches them on in the console. Shared
@@ -90,7 +98,7 @@ export declare const DEFAULT_DISABLED_BUILT_INS: ReadonlySet<string>;
90
98
  export interface SharedCommandRule {
91
99
  itemId: string;
92
100
  /** Catalog category id (local-safety-catalog.ts). */
93
- categoryId: 'credential_commands';
101
+ categoryId: 'credential_commands' | 'remote_control';
94
102
  severity: 'critical' | 'high' | 'medium' | 'low';
95
103
  pattern: string;
96
104
  reason: string;
@@ -102,10 +110,68 @@ export interface SharedCommandRule {
102
110
  * useless against them because the secret never comes from a watched file
103
111
  * ("gh auth token" emits the same token that lives in hosts.yml). Obvious,
104
112
  * rarely-legitimate-for-agents forms are on by default; cloud token printers
105
- * that legitimate deploy tooling uses constantly are strict (off by default,
106
- * see DEFAULT_DISABLED_BUILT_INS). Ids match local-safety-catalog.ts.
113
+ * that legitimate deploy tooling uses constantly are strict (warn by default,
114
+ * see DEFAULT_WARN_BUILT_INS). Ids match local-safety-catalog.ts.
107
115
  */
108
116
  export declare const CREDENTIAL_COMMAND_RULES: readonly SharedCommandRule[];
117
+ export declare const REMOTE_CONTROL_CATALOG_VERSION = "2026-09-26.1";
118
+ export interface RemoteControlFacts {
119
+ /** Catalog entry id. */
120
+ bridge: string;
121
+ /** Catalog mode label: 'remote' | 'serve' | 'connect'. */
122
+ mode: string;
123
+ /** How it was started: 'npx', 'npm exec', 'pnpm dlx', …, or 'direct' for an installed binary. */
124
+ launcher: string;
125
+ }
126
+ export interface RemoteControlBridge {
127
+ id: string;
128
+ title: string;
129
+ kind: 'remote_control' | 'remote_connector';
130
+ /** Registry package names (npm / PyPI), as typed after a launcher. */
131
+ packages: string[];
132
+ /** Executable names when installed globally or run from node_modules/.bin. */
133
+ bins: string[];
134
+ mode: 'remote' | 'serve' | 'connect';
135
+ /** Regex source applied right after the package token (JS + .NET, IgnoreCase). */
136
+ modePattern: string;
137
+ /** Short label for the console and evidence. */
138
+ label: string;
139
+ /** Decision Card sentence — what starting it means, in plain words. */
140
+ card: string;
141
+ }
142
+ export declare const REMOTE_CONTROL_BRIDGES: readonly RemoteControlBridge[];
143
+ /** The positional pattern for one catalog entry: program at a statement start, package, then its mode. */
144
+ export declare function remoteControlBridgePattern(bridge: RemoteControlBridge): string;
145
+ /** Shared command rules for the terminal guards: one per remote-control entry, same Local Safety item. */
146
+ export declare const REMOTE_CONTROL_COMMAND_RULES: readonly SharedCommandRule[];
147
+ export interface RemoteControlMatch {
148
+ bridge: RemoteControlBridge;
149
+ facts: RemoteControlFacts;
150
+ }
151
+ /** A shell line that starts a remote-control bridge (any statement, any de-obfuscated variant). */
152
+ export declare function remoteControlBridgeInCommand(command: string): RemoteControlMatch | undefined;
153
+ /**
154
+ * An MCP server launch (config `command` + `args`) that is a catalogued bridge:
155
+ * a remote-control bridge first, else a remote connector. Arguments with
156
+ * spaces are re-quoted so a `--stdio "npx server"` value stays one argument.
157
+ */
158
+ export declare function classifyRemoteMcpLaunch(command: string | undefined, args?: readonly string[]): RemoteControlMatch | undefined;
159
+ /** Wire-supplied facts constrained to the catalog vocabulary (backend ingest); anything else is dropped. */
160
+ export declare function sanitizeRemoteControlFacts(raw: unknown): RemoteControlFacts | undefined;
161
+ /** The engine fact provider: the catalog id of the remote-control bridge this line starts. */
162
+ export declare function remoteControlFactFor(command: string): string | undefined;
163
+ /** What an "Always allow" on a bridge is bound to: the package and its mode, never the launcher that ran it. */
164
+ export declare function remoteControlGrantKey(bridge: RemoteControlBridge): string;
165
+ /**
166
+ * Every distinct remote-control bridge a line starts (as grant keys), plus the
167
+ * line with each verbatim launch cut out — statement separators kept — so the
168
+ * caller can still read the OTHER programs on the line. A launch seen only in a
169
+ * de-obfuscated variant is not cut: the rest is over-counted, never under-counted.
170
+ */
171
+ export declare function remoteControlLaunches(command: string): {
172
+ bridges: string[];
173
+ rest: string;
174
+ };
109
175
  export type ShellAstMode = 'off' | 'shadow' | 'primary';
110
176
  /** Structural subset of shellAst.ts ShellFacts that the guard reads. */
111
177
  export interface ShellAstFactsLike {