vigthoria-cli 1.13.20 → 1.13.23

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 (187) hide show
  1. package/completions/_vigthoria +49 -0
  2. package/completions/vigthoria.bash +6 -0
  3. package/completions/vigthoria.fish +41 -0
  4. package/dist/commands/auth.d.ts +1 -0
  5. package/dist/commands/auth.js +63 -128
  6. package/dist/commands/background.d.ts +0 -2
  7. package/dist/commands/background.js +26 -34
  8. package/dist/commands/bridge.js +45 -41
  9. package/dist/commands/cancel.d.ts +1 -0
  10. package/dist/commands/cancel.js +22 -16
  11. package/dist/commands/chat.d.ts +3 -42
  12. package/dist/commands/chat.js +378 -1123
  13. package/dist/commands/coding-registration.d.ts +4 -0
  14. package/dist/commands/coding-registration.js +24 -0
  15. package/dist/commands/config.js +23 -29
  16. package/dist/commands/conversation-registration.d.ts +4 -0
  17. package/dist/commands/conversation-registration.js +122 -0
  18. package/dist/commands/deploy.d.ts +8 -2
  19. package/dist/commands/deploy.js +92 -90
  20. package/dist/commands/device.d.ts +1 -2
  21. package/dist/commands/device.js +37 -21
  22. package/dist/commands/doctor-registration.d.ts +4 -0
  23. package/dist/commands/doctor-registration.js +207 -0
  24. package/dist/commands/edit.js +22 -33
  25. package/dist/commands/explain.js +7 -10
  26. package/dist/commands/fork.d.ts +1 -2
  27. package/dist/commands/fork.js +72 -22
  28. package/dist/commands/game.d.ts +1 -1
  29. package/dist/commands/game.js +17 -6
  30. package/dist/commands/generate.js +7 -9
  31. package/dist/commands/history.js +11 -7
  32. package/dist/commands/hub.d.ts +2 -2
  33. package/dist/commands/hub.js +34 -35
  34. package/dist/commands/legion.d.ts +0 -1
  35. package/dist/commands/legion.js +62 -79
  36. package/dist/commands/music.d.ts +1 -2
  37. package/dist/commands/music.js +62 -27
  38. package/dist/commands/platform-registration.d.ts +4 -0
  39. package/dist/commands/platform-registration.js +45 -0
  40. package/dist/commands/preview.d.ts +0 -1
  41. package/dist/commands/preview.js +82 -35
  42. package/dist/commands/product-run-registration.d.ts +4 -0
  43. package/dist/commands/product-run-registration.js +490 -0
  44. package/dist/commands/replay.d.ts +1 -2
  45. package/dist/commands/replay.js +15 -11
  46. package/dist/commands/repo.d.ts +14 -7
  47. package/dist/commands/repo.js +244 -198
  48. package/dist/commands/review.js +9 -12
  49. package/dist/commands/security.d.ts +1 -2
  50. package/dist/commands/security.js +12 -6
  51. package/dist/commands/update-registration.d.ts +3 -0
  52. package/dist/commands/update-registration.js +368 -0
  53. package/dist/commands/v4-registration.d.ts +4 -0
  54. package/dist/commands/v4-registration.js +24 -0
  55. package/dist/commands/v4.d.ts +1 -1
  56. package/dist/commands/v4.js +46 -8
  57. package/dist/commands/wallet.d.ts +1 -3
  58. package/dist/commands/wallet.js +18 -45
  59. package/dist/commands/workflow.d.ts +2 -0
  60. package/dist/commands/workflow.js +52 -39
  61. package/dist/index.js +124 -1589
  62. package/dist/utils/agent-stream-state.d.ts +27 -0
  63. package/dist/utils/agent-stream-state.js +93 -0
  64. package/dist/utils/agentRoute.d.ts +2 -1
  65. package/dist/utils/agentRoute.js +22 -9
  66. package/dist/utils/agentRunOutcome.d.ts +16 -0
  67. package/dist/utils/agentRunOutcome.js +37 -2
  68. package/dist/utils/api-client-factory.d.ts +8 -0
  69. package/dist/utils/api-client-factory.js +8 -0
  70. package/dist/utils/api.d.ts +44 -266
  71. package/dist/utils/api.js +647 -3180
  72. package/dist/utils/auth-session.d.ts +41 -0
  73. package/dist/utils/auth-session.js +224 -0
  74. package/dist/utils/brain-hub-client.d.ts +0 -4
  75. package/dist/utils/brain-hub-client.js +6 -3
  76. package/dist/utils/bridge-client.js +2 -0
  77. package/dist/utils/capability-health-service.d.ts +48 -0
  78. package/dist/utils/capability-health-service.js +64 -0
  79. package/dist/utils/chat-prompt-policy.d.ts +18 -0
  80. package/dist/utils/chat-prompt-policy.js +61 -0
  81. package/dist/utils/chat-tool-call-parser.d.ts +11 -0
  82. package/dist/utils/chat-tool-call-parser.js +71 -0
  83. package/dist/utils/cli-state.d.ts +22 -4
  84. package/dist/utils/cli-state.js +105 -47
  85. package/dist/utils/code-operations-service.d.ts +104 -0
  86. package/dist/utils/code-operations-service.js +837 -0
  87. package/dist/utils/codebase-indexer.d.ts +1 -0
  88. package/dist/utils/codebase-indexer.js +28 -8
  89. package/dist/utils/command-contract.d.ts +61 -0
  90. package/dist/utils/command-contract.js +149 -0
  91. package/dist/utils/command-policy.d.ts +10 -0
  92. package/dist/utils/command-policy.js +54 -0
  93. package/dist/utils/config.d.ts +13 -5
  94. package/dist/utils/config.js +220 -94
  95. package/dist/utils/context-ranker.js +11 -2
  96. package/dist/utils/context-state.d.ts +39 -0
  97. package/dist/utils/context-state.js +52 -0
  98. package/dist/utils/deckEvents.d.ts +0 -5
  99. package/dist/utils/deckEvents.js +3 -2
  100. package/dist/utils/desktop-bridge-client.js +2 -0
  101. package/dist/utils/direct-output-policy.d.ts +3 -0
  102. package/dist/utils/direct-output-policy.js +76 -0
  103. package/dist/utils/durable-json.d.ts +57 -0
  104. package/dist/utils/durable-json.js +319 -0
  105. package/dist/utils/fastAgentRouter.d.ts +5 -6
  106. package/dist/utils/fastAgentRouter.js +17 -25
  107. package/dist/utils/files.js +21 -13
  108. package/dist/utils/frontend-preview-service.d.ts +76 -0
  109. package/dist/utils/frontend-preview-service.js +482 -0
  110. package/dist/utils/goaEvents.d.ts +0 -4
  111. package/dist/utils/goaEvents.js +5 -2
  112. package/dist/utils/logger.d.ts +2 -1
  113. package/dist/utils/logger.js +27 -20
  114. package/dist/utils/mcp-context-client.d.ts +24 -0
  115. package/dist/utils/mcp-context-client.js +58 -0
  116. package/dist/utils/model-governance.d.ts +18 -0
  117. package/dist/utils/model-governance.js +75 -0
  118. package/dist/utils/model-transport-service.d.ts +44 -0
  119. package/dist/utils/model-transport-service.js +111 -0
  120. package/dist/utils/mutation-journal.d.ts +42 -0
  121. package/dist/utils/mutation-journal.js +387 -0
  122. package/dist/utils/network-policy.d.ts +24 -0
  123. package/dist/utils/network-policy.js +202 -0
  124. package/dist/utils/operator-client.d.ts +45 -0
  125. package/dist/utils/operator-client.js +159 -0
  126. package/dist/utils/post-write-validator.js +7 -9
  127. package/dist/utils/preview-screenshot-adapter.d.ts +15 -0
  128. package/dist/utils/preview-screenshot-adapter.js +51 -0
  129. package/dist/utils/process-policy.d.ts +23 -0
  130. package/dist/utils/process-policy.js +284 -0
  131. package/dist/utils/project-memory.d.ts +13 -3
  132. package/dist/utils/project-memory.js +70 -17
  133. package/dist/utils/prompt-workspace-resolver.d.ts +14 -0
  134. package/dist/utils/prompt-workspace-resolver.js +64 -0
  135. package/dist/utils/release-install.d.ts +11 -0
  136. package/dist/utils/release-install.js +155 -0
  137. package/dist/utils/release-policy.d.ts +64 -0
  138. package/dist/utils/release-policy.js +293 -0
  139. package/dist/utils/requestIntent.js +22 -3
  140. package/dist/utils/runtime-capability.d.ts +8 -0
  141. package/dist/utils/runtime-capability.js +16 -0
  142. package/dist/utils/runtime-temp.d.ts +76 -0
  143. package/dist/utils/runtime-temp.js +492 -0
  144. package/dist/utils/secret-policy.d.ts +20 -0
  145. package/dist/utils/secret-policy.js +160 -0
  146. package/dist/utils/session.d.ts +17 -3
  147. package/dist/utils/session.js +354 -110
  148. package/dist/utils/tool-approval-service.d.ts +17 -0
  149. package/dist/utils/tool-approval-service.js +78 -0
  150. package/dist/utils/tool-capability-providers.d.ts +57 -0
  151. package/dist/utils/tool-capability-providers.js +57 -0
  152. package/dist/utils/tools.d.ts +2 -23
  153. package/dist/utils/tools.js +226 -512
  154. package/dist/utils/update-policy.d.ts +18 -0
  155. package/dist/utils/update-policy.js +137 -0
  156. package/dist/utils/v3-agent-client.d.ts +40 -0
  157. package/dist/utils/v3-agent-client.js +165 -0
  158. package/dist/utils/v3-workspace-service.d.ts +28 -0
  159. package/dist/utils/v3-workspace-service.js +279 -0
  160. package/dist/utils/vigflow-client.d.ts +95 -0
  161. package/dist/utils/vigflow-client.js +105 -0
  162. package/dist/utils/workspace-boundary.d.ts +45 -0
  163. package/dist/utils/workspace-boundary.js +377 -0
  164. package/dist/utils/workspace-brain-service.d.ts +2 -0
  165. package/dist/utils/workspace-brain-service.js +11 -1
  166. package/dist/utils/workspace-cache.js +37 -15
  167. package/dist/utils/workspace-stream.js +35 -10
  168. package/install.ps1 +115 -142
  169. package/install.sh +112 -81
  170. package/package.json +43 -9
  171. package/release-policy.json +43 -0
  172. package/scripts/release/LOCAL_MACHINE_USER_VERIFICATION.md +1 -1
  173. package/scripts/release/generate-completions.mjs +24 -0
  174. package/scripts/release/install-release.mjs +10 -0
  175. package/scripts/release/publish-cli-release.mjs +116 -0
  176. package/scripts/release/publish-cli-release.sh +2 -70
  177. package/scripts/release/resolve-release-manifest.mjs +26 -0
  178. package/scripts/release/test-balanced-model-live.sh +45 -0
  179. package/scripts/release/validate-live-service-gates.sh +93 -0
  180. package/scripts/release/validate-no-go-gates.sh +145 -174
  181. package/scripts/release/verify-runtime-consistency.mjs +4 -1
  182. package/dist/commands/index.d.ts +0 -12
  183. package/dist/commands/index.js +0 -194
  184. package/dist/commands/update.d.ts +0 -9
  185. package/dist/commands/update.js +0 -301
  186. package/dist/utils/templateInstantPath.d.ts +0 -18
  187. package/dist/utils/templateInstantPath.js +0 -228
@@ -0,0 +1,78 @@
1
+ import path from 'node:path';
2
+ import { DurableJsonStore } from './durable-json.js';
3
+ function normalizePermissionState(value) {
4
+ if (!value || typeof value !== 'object' || Array.isArray(value))
5
+ return {};
6
+ return Object.fromEntries(Object.entries(value).map(([workspace, entry]) => [workspace, {
7
+ operations: Array.isArray(entry?.operations) ? entry.operations : [],
8
+ updatedAt: String(entry?.updatedAt || ''),
9
+ }]));
10
+ }
11
+ export class ToolApprovalService {
12
+ workspace;
13
+ logger;
14
+ sessionOperations = new Set();
15
+ store;
16
+ constructor(workspace, logger, permissionsFile = path.join(process.env.HOME || process.env.USERPROFILE || '~', '.vigthoria', 'permissions.json')) {
17
+ this.workspace = workspace;
18
+ this.logger = logger;
19
+ this.store = new DurableJsonStore({
20
+ filePath: permissionsFile,
21
+ schemaVersion: 2,
22
+ defaultValue: () => ({}),
23
+ validate: (value) => Boolean(value && typeof value === 'object' && !Array.isArray(value)),
24
+ migrate: normalizePermissionState,
25
+ });
26
+ }
27
+ report(operation, error) {
28
+ const detail = error instanceof Error ? error.message : String(error);
29
+ const message = `Approval state ${operation} failed: ${detail}`;
30
+ this.logger.debug(message);
31
+ this.logger.warn(message);
32
+ }
33
+ read() {
34
+ try {
35
+ return normalizePermissionState(this.store.read());
36
+ }
37
+ catch (error) {
38
+ this.report('read', error);
39
+ return {};
40
+ }
41
+ }
42
+ hasPersistent(scope) {
43
+ return this.read()[this.workspace]?.operations?.some((operation) => (operation.key === scope.key
44
+ && operation.tool === scope.tool
45
+ && operation.workspace === scope.workspace
46
+ && operation.destination === scope.destination)) || false;
47
+ }
48
+ hasSession(scope) {
49
+ return this.sessionOperations.has(scope.key);
50
+ }
51
+ recordSession(scope) {
52
+ this.sessionOperations.add(scope.key);
53
+ }
54
+ recordPersistent(scope) {
55
+ this.recordSession(scope);
56
+ try {
57
+ this.store.update((current) => {
58
+ const existing = normalizePermissionState(current)[this.workspace]?.operations || [];
59
+ const operations = existing.some((operation) => operation.key === scope.key)
60
+ ? existing
61
+ : [...existing, scope];
62
+ return {
63
+ ...current,
64
+ [this.workspace]: { operations, updatedAt: new Date().toISOString() },
65
+ };
66
+ });
67
+ }
68
+ catch (error) {
69
+ this.report('write', error);
70
+ }
71
+ }
72
+ clearSession() {
73
+ this.sessionOperations.clear();
74
+ }
75
+ sessionKeys() {
76
+ return [...this.sessionOperations];
77
+ }
78
+ }
@@ -0,0 +1,57 @@
1
+ export interface CapabilityToolCall {
2
+ tool: string;
3
+ args: Record<string, string>;
4
+ }
5
+ export interface CapabilityToolResult {
6
+ success: boolean;
7
+ output?: string;
8
+ error?: string;
9
+ suggestion?: string;
10
+ canRetry?: boolean;
11
+ undoable?: boolean;
12
+ dryRun?: boolean;
13
+ message?: string;
14
+ metadata?: Record<string, any>;
15
+ }
16
+ export type CapabilityHandler = (args: Record<string, string>) => CapabilityToolResult | Promise<CapabilityToolResult>;
17
+ export interface ToolCapabilityProvider {
18
+ readonly name: string;
19
+ readonly tools: readonly string[];
20
+ execute(call: CapabilityToolCall): Promise<CapabilityToolResult>;
21
+ }
22
+ declare abstract class NamedToolProvider implements ToolCapabilityProvider {
23
+ readonly name: string;
24
+ private readonly handlers;
25
+ readonly tools: readonly string[];
26
+ constructor(name: string, handlers: Readonly<Record<string, CapabilityHandler>>);
27
+ execute(call: CapabilityToolCall): Promise<CapabilityToolResult>;
28
+ }
29
+ export declare class FilesystemToolProvider extends NamedToolProvider {
30
+ constructor(handlers: Readonly<Record<string, CapabilityHandler>>);
31
+ }
32
+ export declare class ProcessToolProvider extends NamedToolProvider {
33
+ constructor(handlers: Readonly<Record<string, CapabilityHandler>>);
34
+ }
35
+ export declare class SearchToolProvider extends NamedToolProvider {
36
+ constructor(handlers: Readonly<Record<string, CapabilityHandler>>);
37
+ }
38
+ export declare class RepositoryToolProvider extends NamedToolProvider {
39
+ constructor(handlers: Readonly<Record<string, CapabilityHandler>>);
40
+ }
41
+ export declare class NetworkBrowserToolProvider extends NamedToolProvider {
42
+ constructor(handlers: Readonly<Record<string, CapabilityHandler>>);
43
+ }
44
+ export declare class SshToolProvider extends NamedToolProvider {
45
+ constructor(handlers: Readonly<Record<string, CapabilityHandler>>);
46
+ }
47
+ export declare class DelegationToolProvider extends NamedToolProvider {
48
+ constructor(handlers: Readonly<Record<string, CapabilityHandler>>);
49
+ }
50
+ export declare class ToolCapabilityRegistry {
51
+ private readonly owners;
52
+ constructor(providers: ToolCapabilityProvider[]);
53
+ providerFor(tool: string): string | null;
54
+ toolNames(): string[];
55
+ execute(call: CapabilityToolCall): Promise<CapabilityToolResult>;
56
+ }
57
+ export {};
@@ -0,0 +1,57 @@
1
+ class NamedToolProvider {
2
+ name;
3
+ handlers;
4
+ tools;
5
+ constructor(name, handlers) {
6
+ this.name = name;
7
+ this.handlers = handlers;
8
+ this.tools = Object.freeze(Object.keys(handlers));
9
+ }
10
+ async execute(call) {
11
+ const handler = this.handlers[call.tool];
12
+ if (!handler)
13
+ return { success: false, error: `${this.name} provider does not implement ${call.tool}`, canRetry: false };
14
+ return handler(call.args);
15
+ }
16
+ }
17
+ export class FilesystemToolProvider extends NamedToolProvider {
18
+ constructor(handlers) { super('filesystem', handlers); }
19
+ }
20
+ export class ProcessToolProvider extends NamedToolProvider {
21
+ constructor(handlers) { super('process', handlers); }
22
+ }
23
+ export class SearchToolProvider extends NamedToolProvider {
24
+ constructor(handlers) { super('search', handlers); }
25
+ }
26
+ export class RepositoryToolProvider extends NamedToolProvider {
27
+ constructor(handlers) { super('repository', handlers); }
28
+ }
29
+ export class NetworkBrowserToolProvider extends NamedToolProvider {
30
+ constructor(handlers) { super('network-browser', handlers); }
31
+ }
32
+ export class SshToolProvider extends NamedToolProvider {
33
+ constructor(handlers) { super('ssh', handlers); }
34
+ }
35
+ export class DelegationToolProvider extends NamedToolProvider {
36
+ constructor(handlers) { super('delegation', handlers); }
37
+ }
38
+ export class ToolCapabilityRegistry {
39
+ owners = new Map();
40
+ constructor(providers) {
41
+ for (const provider of providers) {
42
+ for (const tool of provider.tools) {
43
+ if (this.owners.has(tool))
44
+ throw new Error(`Tool capability ${tool} has multiple providers.`);
45
+ this.owners.set(tool, provider);
46
+ }
47
+ }
48
+ }
49
+ providerFor(tool) { return this.owners.get(tool)?.name || null; }
50
+ toolNames() { return [...this.owners.keys()].sort(); }
51
+ async execute(call) {
52
+ const provider = this.owners.get(call.tool);
53
+ if (!provider)
54
+ return { success: false, error: `Tool not implemented: ${call.tool}`, canRetry: false };
55
+ return provider.execute(call);
56
+ }
57
+ }
@@ -82,37 +82,20 @@ export declare class AgenticTools {
82
82
  private cwd;
83
83
  private permissionCallback;
84
84
  private autoApprove;
85
+ private readonly approvals;
86
+ private readonly capabilityRegistry;
85
87
  private undoStack;
86
88
  private maxUndoStack;
87
89
  private retryConfig;
88
90
  private formatExternalToolError;
89
- private externalToolFailure;
90
91
  private cleanupAfterToolError;
91
- private runExternalCommand;
92
92
  private isNonEmptyString;
93
93
  private describeInvalidValue;
94
94
  private assertStringRecord;
95
- private requireNonEmptyString;
96
- private requireArgsObject;
97
- private sessionApprovedTools;
98
- private static permissionsFile;
99
95
  constructor(logger: Logger, cwd: string, permissionCallback: (action: string, options?: {
100
96
  batchApproval?: boolean;
101
97
  }) => Promise<boolean | 'batch' | 'persist'>, autoApprove?: boolean);
102
98
  private getErrorMessage;
103
- private assertToolCall;
104
- /**
105
- * Load persistent permissions for the current project
106
- */
107
- private loadPersistentPermissions;
108
- /**
109
- * Save a persistent permission for a tool in the current project
110
- */
111
- private savePersistentPermission;
112
- /**
113
- * Check if a tool has persistent permission for the current project
114
- */
115
- private hasPersistentPermission;
116
99
  /**
117
100
  * Clear session-approved tools (call this at the start of each new AI turn)
118
101
  */
@@ -217,10 +200,6 @@ export declare class AgenticTools {
217
200
  * Search using ripgrep (rg) — works on all platforms
218
201
  */
219
202
  private grepWithRg;
220
- /**
221
- * Search using PowerShell Select-String (Windows)
222
- */
223
- private grepWithSelectString;
224
203
  /**
225
204
  * Pure Node.js recursive file search — reliable on all platforms, no external deps
226
205
  */