@nick848/fet 1.0.4 → 1.0.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/README.md CHANGED
@@ -199,6 +199,17 @@ FET can detect an optional `gitnexus` executable during `fet init` and records t
199
199
 
200
200
  Generated Cursor and Codex instructions tell the IDE AI to prefer GitNexus graph context before broad repository scans when that context is available. FET does not install GitNexus, generate graphs, or require graph support for any command.
201
201
 
202
+ Phase-two graph commands are available under `fet graph`:
203
+
204
+ - `fet graph status` checks GitNexus, the configured graph path, and records the result.
205
+ - `fet graph setup` writes `.fet/graph-setup.md` with installation and IDE-assisted setup guidance.
206
+ - `fet graph init` runs `gitnexus analyze` to build the first graph.
207
+ - `fet graph refresh` runs `gitnexus analyze` again to refresh graph data.
208
+ - `fet graph doctor` reports graph integration warnings without blocking normal FET commands.
209
+ - `fet graph handoff` writes `.fet/graph-handoff.md` for Cursor, Codex, OpenCode, or other IDE AI tools.
210
+
211
+ By default FET looks for `gitnexus` on `PATH` and expects the graph directory at `.gitnexus`. Advanced users can override these with `FET_GITNEXUS_EXECUTABLE`, `FET_GITNEXUS_COMMAND`, and `FET_GITNEXUS_GRAPH_PATH`.
212
+
202
213
  ### Global Options
203
214
 
204
215
  | Option | Description | Example |
@@ -217,6 +228,12 @@ Generated Cursor and Codex instructions tell the IDE AI to prefer GitNexus graph
217
228
  | `fet init` | `fet init [--yes]` | Initialize FET and OpenSpec; generate context, state, Cursor rules and Skills, plus Codex workflow guides. |
218
229
  | `fet update-context` | `fet update-context [--yes]` | Rescan the project and update FET-managed regions in `AGENTS.md` and `openspec/config.yaml`. |
219
230
  | `fet fill-context` | `fet fill-context [--yes]` | Refresh IDE handoff commands that ask Cursor/Codex/OpenCode-style AI to replace `AGENTS.md` placeholders. |
231
+ | `fet graph status` | `fet graph status` | Check optional GitNexus installation and graph status. |
232
+ | `fet graph setup` | `fet graph setup` | Generate GitNexus installation and setup handoff instructions without installing anything. |
233
+ | `fet graph init` | `fet graph init [...args]` | Run `gitnexus analyze` to build the first graph. |
234
+ | `fet graph refresh` | `fet graph refresh [...args]` | Run `gitnexus analyze` again and update recorded graph state. |
235
+ | `fet graph doctor` | `fet graph doctor` | Diagnose optional graph integration health. |
236
+ | `fet graph handoff` | `fet graph handoff` | Generate IDE AI instructions for using graph context before broad scans. |
220
237
  | `fet doctor` | `fet doctor [--fix-lock]` | Diagnose OpenSpec, FET state, context files, Cursor and Codex integration, and lock files. |
221
238
  | `fet explore` | `fet explore [...args] [--change <id>]` | Run native OpenSpec explore through FET so clarification prompts stay interactive. |
222
239
  | `fet propose` | `fet propose <change-id>` | Create a new OpenSpec change through FET's proposal entry point. |
@@ -243,6 +260,8 @@ FET may create or update:
243
260
  - `openspec/changes/<change-id>/fet-state.json`
244
261
  - `openspec/changes/<change-id>/.fet/verify-instructions.md`
245
262
  - `CHANGELOG.md`
263
+ - `.fet/graph-setup.md`
264
+ - `.fet/graph-handoff.md`
246
265
  - `.cursor/skills/fet-*/SKILL.md`
247
266
  - `.cursor/rules/fet-context.mdc`
248
267
  - `.codex/fet/context.md`
@@ -8,6 +8,8 @@ var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
8
8
  ErrorCode2["OpenSpecUnsupportedVersion"] = "OPENSPEC_UNSUPPORTED_VERSION";
9
9
  ErrorCode2["OpenSpecCommandFailed"] = "OPENSPEC_COMMAND_FAILED";
10
10
  ErrorCode2["OpenSpecStructureUnknown"] = "OPENSPEC_STRUCTURE_UNKNOWN";
11
+ ErrorCode2["GraphProviderNotFound"] = "GRAPH_PROVIDER_NOT_FOUND";
12
+ ErrorCode2["GraphCommandFailed"] = "GRAPH_COMMAND_FAILED";
11
13
  ErrorCode2["StateSchemaUnsupported"] = "STATE_SCHEMA_UNSUPPORTED";
12
14
  ErrorCode2["StateCorrupted"] = "STATE_CORRUPTED";
13
15
  ErrorCode2["LockHeld"] = "LOCK_HELD";
@@ -25,8 +27,10 @@ function exitCodeForError(code) {
25
27
  return 2;
26
28
  case "OPENSPEC_NOT_FOUND" /* OpenSpecNotFound */:
27
29
  case "OPENSPEC_UNSUPPORTED_VERSION" /* OpenSpecUnsupportedVersion */:
30
+ case "GRAPH_PROVIDER_NOT_FOUND" /* GraphProviderNotFound */:
28
31
  return 3;
29
32
  case "OPENSPEC_COMMAND_FAILED" /* OpenSpecCommandFailed */:
33
+ case "GRAPH_COMMAND_FAILED" /* GraphCommandFailed */:
30
34
  return 4;
31
35
  case "OPENSPEC_STRUCTURE_UNKNOWN" /* OpenSpecStructureUnknown */:
32
36
  case "STATE_SCHEMA_UNSUPPORTED" /* StateSchemaUnsupported */:
@@ -101,4 +105,4 @@ export {
101
105
  FetError,
102
106
  toFetError
103
107
  };
104
- //# sourceMappingURL=chunk-FZOVNHE7.js.map
108
+ //# sourceMappingURL=chunk-V4ZRBF5L.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/errors/codes.ts","../src/errors/fet-error.ts"],"sourcesContent":["export enum ErrorCode {\n Unknown = \"UNKNOWN\",\n InvalidArguments = \"INVALID_ARGUMENTS\",\n OpenSpecNotFound = \"OPENSPEC_NOT_FOUND\",\n OpenSpecUnsupportedVersion = \"OPENSPEC_UNSUPPORTED_VERSION\",\n OpenSpecCommandFailed = \"OPENSPEC_COMMAND_FAILED\",\n OpenSpecStructureUnknown = \"OPENSPEC_STRUCTURE_UNKNOWN\",\n GraphProviderNotFound = \"GRAPH_PROVIDER_NOT_FOUND\",\n GraphCommandFailed = \"GRAPH_COMMAND_FAILED\",\n StateSchemaUnsupported = \"STATE_SCHEMA_UNSUPPORTED\",\n StateCorrupted = \"STATE_CORRUPTED\",\n LockHeld = \"LOCK_HELD\",\n UserCancelled = \"USER_CANCELLED\",\n UnsafeScriptApprovalRequired = \"UNSAFE_SCRIPT_APPROVAL_REQUIRED\",\n ToolAdapterConflict = \"TOOL_ADAPTER_CONFLICT\",\n ConfigInvalid = \"CONFIG_INVALID\",\n FileSystemError = \"FILE_SYSTEM_ERROR\"\n}\n\nexport function exitCodeForError(code: ErrorCode): number {\n switch (code) {\n case ErrorCode.InvalidArguments:\n case ErrorCode.ConfigInvalid:\n return 2;\n case ErrorCode.OpenSpecNotFound:\n case ErrorCode.OpenSpecUnsupportedVersion:\n case ErrorCode.GraphProviderNotFound:\n return 3;\n case ErrorCode.OpenSpecCommandFailed:\n case ErrorCode.GraphCommandFailed:\n return 4;\n case ErrorCode.OpenSpecStructureUnknown:\n case ErrorCode.StateSchemaUnsupported:\n case ErrorCode.StateCorrupted:\n case ErrorCode.ToolAdapterConflict:\n case ErrorCode.FileSystemError:\n return 5;\n case ErrorCode.LockHeld:\n return 6;\n case ErrorCode.UserCancelled:\n return 7;\n case ErrorCode.UnsafeScriptApprovalRequired:\n return 8;\n case ErrorCode.Unknown:\n default:\n return 1;\n }\n}\n","import { ErrorCode, exitCodeForError } from \"./codes.js\";\n\nexport interface FetErrorOptions {\n code: ErrorCode;\n message: string;\n details?: unknown;\n recoverable?: boolean;\n suggestedCommand?: string;\n cause?: unknown;\n}\n\nexport class FetError extends Error {\n readonly code: ErrorCode;\n readonly exitCode: number;\n readonly details?: unknown;\n readonly recoverable: boolean;\n readonly suggestedCommand?: string;\n override readonly cause?: unknown;\n\n constructor(options: FetErrorOptions) {\n super(options.message);\n this.name = \"FetError\";\n this.code = options.code;\n this.exitCode = exitCodeForError(options.code);\n this.details = options.details;\n this.recoverable = options.recoverable ?? true;\n this.suggestedCommand = options.suggestedCommand;\n this.cause = options.cause;\n }\n\n toJSON() {\n return {\n code: this.code,\n exitCode: this.exitCode,\n message: this.message,\n details: this.details,\n recoverable: this.recoverable,\n suggestedCommand: this.suggestedCommand\n };\n }\n}\n\nexport function toFetError(error: unknown): FetError {\n if (error instanceof FetError) {\n return error;\n }\n\n if (error instanceof Error) {\n return new FetError({\n code: ErrorCode.Unknown,\n message: error.message,\n recoverable: false,\n cause: error\n });\n }\n\n return new FetError({\n code: ErrorCode.Unknown,\n message: \"Unknown error\",\n details: error,\n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