@cortexkit/opencode-anthropic-auth 2.0.3 → 2.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.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/dist/cli-failure.d.ts +32 -2
  3. package/dist/cli.js +46 -52
  4. package/dist/fable-fallback.d.ts +6 -2
  5. package/dist/{index-kd89hcr3.js → index-0kxy8k2c.js} +1 -1
  6. package/dist/index-1nwcnxp8.js +42 -0
  7. package/dist/index-53nnxq39.js +2 -0
  8. package/dist/{index-2arfb1y3.js → index-6chd6jnr.js} +1 -1
  9. package/dist/{index-5hyennzm.js → index-ah5s0bew.js} +1 -1
  10. package/dist/{index-jmjevtm1.js → index-b1dvkp15.js} +1 -1
  11. package/dist/{index-rftced5v.js → index-f2ne65w4.js} +1 -1
  12. package/dist/{index-rqync0pc.js → index-hazrk5c3.js} +1 -1
  13. package/dist/{index-1jkyhgyr.js → index-jexctf5w.js} +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/request-class.d.ts +10 -0
  16. package/dist/rpc/port-file.js +1 -1
  17. package/dist/rpc/protocol.js +1 -1
  18. package/dist/rpc/rpc-client.js +1 -1
  19. package/dist/rpc/rpc-dir.js +1 -1
  20. package/dist/setup/native-activation.d.ts +7 -2
  21. package/dist/setup/native-enrollment.d.ts +6 -0
  22. package/dist/setup/native-login.d.ts +12 -1
  23. package/dist/sidebar-state.js +1 -1
  24. package/dist/transform.d.ts +2 -8
  25. package/dist/tui-preferences.js +1 -1
  26. package/dist/v2/adapter.d.ts +6 -1
  27. package/dist/v2/server.js +4 -4
  28. package/dist/v2/tui.js +1 -1
  29. package/package.json +10 -6
  30. package/src/sidebar-state.ts +10 -71
  31. package/src/tui-compiled/sidebar-state.ts +10 -71
  32. package/src/tui-compiled/tui.tsx +119 -89
  33. package/src/tui.tsx +58 -18
  34. package/dist/index-fncp6r0j.js +0 -3
  35. package/dist/index-mdpyfkv3.js +0 -464
  36. package/dist/index-nfcp0m1t.js +0 -42
  37. package/dist/index-qttfa42y.js +0 -2
  38. package/dist/index-vjehtqnb.js +0 -1
package/README.md CHANGED
@@ -16,7 +16,7 @@ This project is not affiliated with or endorsed by Anthropic. Using Claude subsc
16
16
  ## Install
17
17
 
18
18
  ```bash
19
- bunx @cortexkit/opencode-anthropic-auth setup
19
+ npx @cortexkit/opencode-anthropic-auth setup
20
20
  ```
21
21
 
22
22
  After setup:
@@ -1,4 +1,5 @@
1
- import { type ProviderErrorRedactor } from '@cortexkit/anthropic-auth-core';
1
+ import { type OwnerOnlyOptions, type ProviderErrorRedactor } from '@cortexkit/anthropic-auth-core';
2
+ import type { SetupEnrollmentOutcome } from '@cortexkit/common-auth/setup';
2
3
  declare const STAGE_LABELS: {
3
4
  readonly 'setup-activation': 'Vault custody setup';
4
5
  readonly 'setup-opencode-config': 'OpenCode configuration';
@@ -14,6 +15,11 @@ declare const STAGE_LABELS: {
14
15
  readonly 'cli-command': 'Command';
15
16
  };
16
17
  export type CliFailureStage = keyof typeof STAGE_LABELS;
18
+ interface FailureReportOptions {
19
+ ownership?: OwnerOnlyOptions;
20
+ stderr?: (line: string) => void;
21
+ }
22
+ declare const SETUP_HOSTS: readonly ['opencode', 'pi'];
17
23
  /** UTF-8 bytes of redacted detail kept per diagnostics file. */
18
24
  export declare const CLI_FAILURE_DETAIL_MAX_BYTES: number;
19
25
  export declare const CLI_FAILURE_OMITTED = "[output beyond the diagnostic limit omitted]";
@@ -28,6 +34,19 @@ export declare const CLI_FAILURE_SECRETS_UNREADABLE = "[detail withheld: the kno
28
34
  * a running-host list rebuilt from validated own host names and PIDs.
29
35
  */
30
36
  export declare function knownFailureMessage(error: unknown): string | undefined;
37
+ /**
38
+ * The vault enrollment outcome runSetup recorded for each selected host when
39
+ * it failed after enrollment began, or undefined when it recorded none.
40
+ * runSetup keeps that record beside the thrown value rather than on it, and
41
+ * the setupEnrollment that Core re-exports looks it up; it is asked only for a
42
+ * real (non-proxy) object, and each entry is accepted only when its host and
43
+ * outcome are own data properties holding known values, so no getter or proxy
44
+ * trap runs.
45
+ */
46
+ export declare function setupEnrollmentOutcomes(error: unknown): {
47
+ host: (typeof SETUP_HOSTS)[number];
48
+ outcome: SetupEnrollmentOutcome;
49
+ }[] | undefined;
31
50
  /**
32
51
  * Exact credentials a failing command may echo: the strings in `submitted`
33
52
  * (the API key, OAuth code and tokens, or Cloudflare and relay tokens the CLI
@@ -54,14 +73,25 @@ export declare function boundRedactedDetail(text: string, redactor: Pick<Provide
54
73
  * reading the environment would invoke caller code.
55
74
  */
56
75
  export declare function cliDiagnosticsDirectory(env: unknown): string | undefined;
76
+ /**
77
+ * Write one failure detail to a new owner-only file and return its path, or
78
+ * undefined if that cannot be done safely. An existing non-private leaf
79
+ * directory is refused, never repaired. POSIX checks its uid/mode and creates
80
+ * missing directories with mode 0700; Windows uses native DACL checks and
81
+ * private directory creation. Files are exclusive mode 0600 on POSIX and
82
+ * protected owner-only DACL storage on Windows; a leaf symlink is never followed.
83
+ */
84
+ export declare function writeDiagnosticFile(env: unknown, stage: CliFailureStage, contents: string, ownership?: OwnerOnlyOptions): Promise<string | undefined>;
57
85
  /**
58
86
  * Screen text for a thrown failure. A known failure is returned word for word
59
87
  * and not recorded; anything else is recorded in a private diagnostics file
60
88
  * and replaced by a fixed line naming that file. `env` supplies both the
61
89
  * secret-named values to scrub and the diagnostics location; `submitted`
62
90
  * holds the credentials the failing command handled.
91
+ * When the private file cannot be saved, one allowlisted metadata line is
92
+ * also emitted to stderr without changing the fixed screen text.
63
93
  */
64
- export declare function reportThrownFailure(stage: CliFailureStage, error: unknown, env: unknown, submitted?: unknown): Promise<string>;
94
+ export declare function reportThrownFailure(stage: CliFailureStage, error: unknown, env: unknown, submitted?: unknown, options?: FailureReportOptions): Promise<string>;
65
95
  /** Screen text for a child process that exited unsuccessfully; its stderr tail goes to the diagnostics file. */
66
96
  export declare function reportInstallerFailure(stage: CliFailureStage, result: {
67
97
  exitCode: number;