@treeseed/sdk 0.13.0-rc.13 → 0.13.0-rc.14

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.
@@ -7,7 +7,7 @@ export type ControlPlaneConfirmationPolicy = 'never' | 'input_required';
7
7
  export type ControlPlaneOperationSurface = 'rest' | 'cli' | 'mcp_tool' | 'mcp_resource' | 'internal';
8
8
  export type ControlPlaneCacheScope = 'none' | 'principal' | 'team' | 'project' | 'public';
9
9
  export type ControlPlanePaginationKind = 'none' | 'cursor';
10
- export type ControlPlaneAuthenticationKind = 'anonymous' | 'oauth' | 'provider' | 'signed_request';
10
+ export type ControlPlaneAuthenticationKind = 'anonymous' | 'oauth' | 'oauth_or_provider' | 'provider' | 'signed_request';
11
11
  export interface ControlPlaneRestBinding {
12
12
  method: ControlPlaneHttpMethod;
13
13
  path: `/v1/${string}`;
@@ -44,10 +44,10 @@ function validateControlPlaneCatalog(catalog) {
44
44
  for (const scope of operation.oauthScopes) {
45
45
  if (!TREESEED_OAUTH_SCOPES.includes(scope)) diagnostics.push({ code: "oauth_scope_invalid", path: `${path}.oauthScopes`, message: `Unknown OAuth scope ${scope}.` });
46
46
  }
47
- if (operation.authentication === "oauth" && operation.oauthScopes.length === 0) {
47
+ if (["oauth", "oauth_or_provider"].includes(operation.authentication) && operation.oauthScopes.length === 0) {
48
48
  diagnostics.push({ code: "oauth_scope_required", path: `${path}.oauthScopes`, message: "OAuth-authenticated operations require at least one OAuth scope." });
49
49
  }
50
- if (operation.authentication !== "oauth" && operation.oauthScopes.length > 0) {
50
+ if (!["oauth", "oauth_or_provider"].includes(operation.authentication) && operation.oauthScopes.length > 0) {
51
51
  diagnostics.push({ code: "oauth_scope_forbidden", path: `${path}.oauthScopes`, message: "Only OAuth-authenticated operations may declare OAuth scopes." });
52
52
  }
53
53
  if (operation.authentication === "provider" && operation.capability !== "providers.execute") {
@@ -496,6 +496,53 @@ export declare const CONTROL_PLANE_OPERATIONS: {
496
496
  actionId: string;
497
497
  }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
498
498
  };
499
+ readonly treedx: {
500
+ readonly library: ControlPlaneOperationBinding<{
501
+ projectId: string;
502
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
503
+ readonly bindLibrary: ControlPlaneOperationBinding<{
504
+ projectId: string;
505
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
506
+ readonly createRepository: ControlPlaneOperationBinding<{
507
+ projectId: string;
508
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
509
+ readonly createWorkspace: ControlPlaneOperationBinding<{
510
+ projectId: string;
511
+ repoId: string;
512
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
513
+ readonly readWorkspaceFile: ControlPlaneOperationBinding<{
514
+ projectId: string;
515
+ workspaceId: string;
516
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
517
+ readonly applyChangeset: ControlPlaneOperationBinding<{
518
+ projectId: string;
519
+ workspaceId: string;
520
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
521
+ readonly searchWorkspace: ControlPlaneOperationBinding<{
522
+ projectId: string;
523
+ workspaceId: string;
524
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
525
+ readonly commitWorkspace: ControlPlaneOperationBinding<{
526
+ projectId: string;
527
+ workspaceId: string;
528
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
529
+ readonly closeWorkspace: ControlPlaneOperationBinding<{
530
+ projectId: string;
531
+ workspaceId: string;
532
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
533
+ readonly readRepositoryFiles: ControlPlaneOperationBinding<{
534
+ projectId: string;
535
+ repoId: string;
536
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
537
+ readonly listRepositoryPaths: ControlPlaneOperationBinding<{
538
+ projectId: string;
539
+ repoId: string;
540
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
541
+ readonly buildRepositoryContext: ControlPlaneOperationBinding<{
542
+ projectId: string;
543
+ repoId: string;
544
+ }, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
545
+ };
499
546
  readonly providers: {
500
547
  readonly register: ControlPlaneOperationBinding<{}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
501
548
  readonly registration: ControlPlaneOperationBinding<{
@@ -314,6 +314,20 @@ const CONTROL_PLANE_OPERATIONS = {
314
314
  actions: resource("realtime.actions.list", "GET", "/v1/client-sessions/{sessionId}/actions", { sessionId: z.string().min(1) }, { capability: "realtime.read", pagination: "cursor" }),
315
315
  actionResult: resource("realtime.actions.result", "POST", "/v1/client-sessions/{sessionId}/actions/{actionId}/result", { sessionId: z.string().min(1), actionId: z.string().min(1) }, { capability: "realtime.write" })
316
316
  },
317
+ treedx: {
318
+ library: resource("treedx.library.show", "GET", "/v1/projects/{projectId}/treedx-library", { projectId: z.string().min(1) }, { capability: "treedx.read" }),
319
+ bindLibrary: resource("treedx.library.bind", "POST", "/v1/projects/{projectId}/treedx-library", { projectId: z.string().min(1) }, { capability: "treedx.write" }),
320
+ createRepository: resource("treedx.repositories.create", "POST", "/v1/dx/projects/{projectId}/repos", { projectId: z.string().min(1) }, { capability: "treedx.write", authentication: "oauth_or_provider" }),
321
+ createWorkspace: resource("treedx.workspaces.create", "POST", "/v1/dx/projects/{projectId}/repos/{repoId}/workspaces", { projectId: z.string().min(1), repoId: z.string().min(1) }, { capability: "treedx.write", authentication: "oauth_or_provider" }),
322
+ readWorkspaceFile: resource("treedx.workspaces.files.read", "GET", "/v1/dx/projects/{projectId}/workspaces/{workspaceId}/files", { projectId: z.string().min(1), workspaceId: z.string().min(1) }, { capability: "treedx.read", authentication: "oauth_or_provider" }),
323
+ applyChangeset: resource("treedx.workspaces.changesets.apply", "POST", "/v1/dx/projects/{projectId}/workspaces/{workspaceId}/changesets", { projectId: z.string().min(1), workspaceId: z.string().min(1) }, { capability: "treedx.write", authentication: "oauth_or_provider" }),
324
+ searchWorkspace: resource("treedx.workspaces.search", "POST", "/v1/dx/projects/{projectId}/workspaces/{workspaceId}/search", { projectId: z.string().min(1), workspaceId: z.string().min(1) }, { capability: "treedx.read", authentication: "oauth_or_provider", scopes: ["treeseed:read"] }),
325
+ commitWorkspace: resource("treedx.workspaces.commit", "POST", "/v1/dx/projects/{projectId}/workspaces/{workspaceId}/commit", { projectId: z.string().min(1), workspaceId: z.string().min(1) }, { capability: "treedx.write", authentication: "oauth_or_provider" }),
326
+ closeWorkspace: resource("treedx.workspaces.close", "POST", "/v1/dx/projects/{projectId}/workspaces/{workspaceId}/close", { projectId: z.string().min(1), workspaceId: z.string().min(1) }, { capability: "treedx.write", authentication: "oauth_or_provider" }),
327
+ readRepositoryFiles: resource("treedx.repositories.files.read", "POST", "/v1/dx/projects/{projectId}/repos/{repoId}/files/read", { projectId: z.string().min(1), repoId: z.string().min(1) }, { capability: "treedx.read", authentication: "oauth_or_provider", scopes: ["treeseed:read"] }),
328
+ listRepositoryPaths: resource("treedx.repositories.paths.list", "POST", "/v1/dx/projects/{projectId}/repos/{repoId}/paths/list", { projectId: z.string().min(1), repoId: z.string().min(1) }, { capability: "treedx.read", authentication: "oauth_or_provider", scopes: ["treeseed:read"] }),
329
+ buildRepositoryContext: resource("treedx.repositories.context.build", "POST", "/v1/dx/projects/{projectId}/repos/{repoId}/context/build", { projectId: z.string().min(1), repoId: z.string().min(1) }, { capability: "treedx.read", authentication: "oauth_or_provider", scopes: ["treeseed:read"] })
330
+ },
317
331
  providers: {
318
332
  register: noPathProvider("providers.register", "POST", "/v1/provider-registrations", { redactedPaths: ["body.registrationKey"] }),
319
333
  registration: providerPath("providers.registration.show", "GET", "/v1/provider-registrations/{requestId}", { requestId: z.string().min(1) }, { read: true }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeseed/sdk",
3
- "version": "0.13.0-rc.13",
3
+ "version": "0.13.0-rc.14",
4
4
  "description": "Portable TreeSeed contracts, standards, and typed remote control-plane clients.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {