@cortexkit/anthropic-auth-core 2.5.5 → 2.5.7

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.
@@ -1,3 +1,9 @@
1
+ type LeaseCreationTestHooks = {
2
+ beforeWrite?: (path: string) => void | Promise<void>;
3
+ beforeLink?: (tempPath: string, lockPath: string) => void | Promise<void>;
4
+ };
5
+ /** Test-only creation faults; not re-exported from the public fs entry point. */
6
+ export declare function setLeaseCreationTestHooksForTest(hooks?: LeaseCreationTestHooks): void;
1
7
  export declare function isLostMarkerRaceError(error: unknown): boolean;
2
8
  /** Test-only fault injection between marker mkdir and owner.json write. */
3
9
  export interface EvictionMarkerTestHooks {
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Optional THALAMUS routing for vault mode and advisory turn notes for request
3
+ * shaping. Account ids are vault account ids, not local pool rows. Nothing is
4
+ * persisted here; plugins on routes the runner does not serve get no turn notes.
5
+ */
1
6
  /** An eligible vault route, not a local pool row. */
2
7
  export interface RoutingCandidate {
3
8
  /** Vault account id, not the plugin's route id. */
@@ -35,7 +40,7 @@ interface RoutingReportIdentity {
35
40
  accountId: string;
36
41
  credentialId?: string;
37
42
  }
38
- export type ReportRoutingInput = RoutingReportIdentity & ({
43
+ export type ReportRoutingInput = (RoutingReportIdentity & ({
39
44
  outcome: 'served';
40
45
  /**
41
46
  * Pass only rate-limit headers, never the whole response headers.
@@ -56,7 +61,26 @@ export type ReportRoutingInput = RoutingReportIdentity & ({
56
61
  pool?: string;
57
62
  /** Optional reset time in epoch milliseconds. */
58
63
  resetsAt?: number;
59
- });
64
+ })) | {
65
+ sessionId: string;
66
+ kind: 'turn_notes_supported';
67
+ model: string;
68
+ supported: boolean;
69
+ } | {
70
+ sessionId: string;
71
+ kind: 'turn_note_skipped';
72
+ after_tool_use_id: string;
73
+ reason: 'anchor_missing' | 'before_user_message' | 'unsupported_model' | 'not_oauth';
74
+ };
75
+ /**
76
+ * Read advisory input for request shaping, in landing order, without persisting
77
+ * it. If no routing handle is available or the runner does not serve the route,
78
+ * returns [].
79
+ */
80
+ export declare function turnNotes(sessionId: string): readonly {
81
+ afterToolUseId: string;
82
+ text: string;
83
+ }[];
60
84
  /**
61
85
  * Ask routing for an eligible vault route. Any failure or unfamiliar answer
62
86
  * yields undefined so the plugin can keep its own choice. This does not admit
@@ -64,9 +88,10 @@ export type ReportRoutingInput = RoutingReportIdentity & ({
64
88
  */
65
89
  export declare function askRouting<Candidate extends RoutingCandidate>(input: AskRoutingInput<Candidate>): Promise<RoutingSelection<Candidate> | undefined>;
66
90
  /**
67
- * Report a vault request without waiting for routing. Only contract fields are
68
- * sent, and all accessor failures are ignored. Headers must already be limited
69
- * to rate-limit headers by the caller; values are not filtered or redacted here.
91
+ * Report a vault request or turn-note event without waiting for routing. Only
92
+ * contract fields are sent, and all accessor failures are ignored. Headers must
93
+ * already be limited to rate-limit headers by the caller; values are not filtered
94
+ * or redacted here.
70
95
  */
71
96
  export declare function reportRouting(input: ReportRoutingInput): void;
72
97
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/anthropic-auth-core",
3
- "version": "2.5.5",
3
+ "version": "2.5.7",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  "prepublishOnly": "bun run build"
31
31
  },
32
32
  "devDependencies": {
33
- "@cortexkit/common-auth": "0.38.0"
33
+ "@cortexkit/common-auth": "0.39.1"
34
34
  },
35
35
  "dependencies": {
36
36
  "@cortexkit/claustrum-client": "0.13.0",