@north-light/crouter-api 0.3.160 → 0.3.162

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/dist/client.d.ts CHANGED
@@ -10,7 +10,7 @@ import type { NodeConfigPatch } from './dto/config.js';
10
10
  import type { AttachEnsureRequest, AttachEnsureResultDTO } from './dto/attach.js';
11
11
  import type { EnsureProfileRequest, ProfileDTO } from './dto/profiles.js';
12
12
  import type { FilePeekDTO } from './dto/files.js';
13
- import type { CredentialResultDTO, InstallCredentialRequest } from './dto/modelauth.js';
13
+ import type { CredentialRemovalResultDTO, CredentialResultDTO, InstallCredentialRequest, ModelAuthListDTO } from './dto/modelauth.js';
14
14
  import type { CreateHumanBridgeRequest, HumanBridgeResultDTO, HumanConsultResultDTO, HumanDeliverResultDTO, HumanVisualResultDTO } from './dto/human.js';
15
15
  import type { CancelInboxTicketRequest, CanceledTicketResultDTO, DeckTicketResultDTO, InboxDeckDTO, InboxListDTO, InboxTicketIdDTO, RespondInboxDeckRequest } from './dto/inbox.js';
16
16
  import type { AttentionCountsDTO, AttentionDTO, DashboardDTO, DashboardQuery, HistoryGrepQuery, HistoryGrepResultDTO, HistoryReadQuery, HistoryReadResultDTO, HistorySearchQuery, HistorySearchResultDTO, PruneRequest, PruneResultDTO, RebuildIndexResultDTO, RosterDTO, SnapshotDTO } from './dto/canvas.js';
@@ -139,7 +139,9 @@ export declare class CrtrClient {
139
139
  /** Delete one profile by exact id or unique name (`DELETE /v1/profiles/:name`,
140
140
  * idempotent — a miss is success). */
141
141
  deleteProfile(name: string): Promise<void>;
142
+ listModelAuth(): Promise<ModelAuthListDTO>;
142
143
  installCredential(provider: string, req: InstallCredentialRequest): Promise<CredentialResultDTO>;
144
+ removeCredential(provider: string): Promise<CredentialRemovalResultDTO>;
143
145
  /** Create a terminal `kind:'human'` bridge node with NO broker engine
144
146
  * (`spawnNode` server-side). Distinct from `createNode` (which launches a
145
147
  * broker) precisely because a human bridge must never have one. */
package/dist/client.js CHANGED
@@ -252,9 +252,15 @@ export class CrtrClient {
252
252
  await this.request('DELETE', routes.profile(name));
253
253
  }
254
254
  // ---- Model auth --------------------------------------------------------
255
+ listModelAuth() {
256
+ return this.request('GET', routes.modelAuths());
257
+ }
255
258
  installCredential(provider, req) {
256
259
  return this.request('PUT', routes.modelAuth(provider), req);
257
260
  }
261
+ removeCredential(provider) {
262
+ return this.request('DELETE', routes.modelAuth(provider));
263
+ }
258
264
  // ---- Human bridge + completion-handler forwarding (spec §6.5) ----------
259
265
  /** Create a terminal `kind:'human'` bridge node with NO broker engine
260
266
  * (`spawnNode` server-side). Distinct from `createNode` (which launches a
@@ -39,3 +39,35 @@ export interface CredentialResultDTO {
39
39
  managed: boolean;
40
40
  account_id?: string;
41
41
  }
42
+ /** One managed-pool account, projected without credential material. Timestamps are
43
+ * ISO strings so remote consumers do not need to understand pi's epoch-ms storage. */
44
+ export interface ManagedAccountStatusDTO {
45
+ label: string;
46
+ expires_at: string;
47
+ rate_limited_until: string;
48
+ auth_failure?: 'invalid_grant';
49
+ account_id?: string;
50
+ }
51
+ /** A provider's sanitized credential state. Managed providers are always listed
52
+ * (even with no accounts); non-managed providers appear only when auth.json has
53
+ * an API-key or OAuth credential for them. */
54
+ export type ModelAuthProviderStatusDTO = {
55
+ provider: string;
56
+ managed: true;
57
+ configured: boolean;
58
+ accounts: ManagedAccountStatusDTO[];
59
+ } | {
60
+ provider: string;
61
+ managed: false;
62
+ configured: true;
63
+ kind: 'api_key' | 'oauth';
64
+ };
65
+ /** `GET /v1/model-auth` — credential-presence projection for every known provider. */
66
+ export interface ModelAuthListDTO {
67
+ providers: ModelAuthProviderStatusDTO[];
68
+ }
69
+ /** `DELETE /v1/model-auth/{provider}` — all user credentials removed for one provider. */
70
+ export interface CredentialRemovalResultDTO {
71
+ provider: string;
72
+ removed_accounts: number;
73
+ }
@@ -1,3 +1,4 @@
1
1
  // Model-auth DTOs (spec §7.6). `PUT /v1/model-auth/{provider}` installs/rotates
2
- // already-obtained credential material; interactive collection stays client-side.
2
+ // already-obtained credential material; `GET /v1/model-auth` exposes only sanitized
3
+ // connection state; interactive collection stays client-side.
3
4
  export {};
package/dist/routes.d.ts CHANGED
@@ -59,6 +59,7 @@ export declare const routes: {
59
59
  readonly humanInboxCancel: (ticketId: string) => string;
60
60
  readonly profiles: () => string;
61
61
  readonly profile: (name: string) => string;
62
+ readonly modelAuths: () => string;
62
63
  readonly modelAuth: (provider: string) => string;
63
64
  readonly filePeek: () => string;
64
65
  };
package/dist/routes.js CHANGED
@@ -85,6 +85,7 @@ export const routes = {
85
85
  profiles: () => `${V}/profiles`,
86
86
  profile: (name) => `${V}/profiles/${name}`,
87
87
  // Model auth
88
+ modelAuths: () => `${V}/model-auth`,
88
89
  modelAuth: (provider) => `${V}/model-auth/${provider}`,
89
90
  // Host file read (browser file-peek panel). The absolute path rides as a
90
91
  // `path` query param, not a path segment — it is not a single safe segment.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/crouter-api",
3
- "version": "0.3.160",
3
+ "version": "0.3.162",
4
4
  "description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, and the CrtrClient. Zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",