@sealant/sdk-next 0.40.0-next.770 → 0.40.0-next.772

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.
@@ -527,12 +527,13 @@ declare const buildControlPlaneClient: (config: SealantInternalConfig) => Effect
527
527
  readonly resourceDomains: {
528
528
  readonly ensureResourceDomain: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"ensureResourceDomain", "POST", "/v1/resource-domains/", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
529
529
  readonly key: import("effect/Schema").String;
530
+ readonly budget: import("effect/Schema").optional<import("effect/Schema").Struct<Record<"cpuMillicores" | "memoryBytes" | "storageBytes", import("effect/Schema").Int>>>;
530
531
  }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
531
532
  readonly resourceDomainId: import("effect/Schema").String;
532
533
  readonly key: import("effect/Schema").String;
533
534
  readonly createdAt: import("effect/Schema").String;
534
535
  readonly created: import("effect/Schema").Boolean;
535
- }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError>, import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
536
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainBudgetDiffersError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError>, import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
536
537
  readonly getResourceDomain: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"getResourceDomain", "GET", "/v1/resource-domains/:resourceDomainId", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
537
538
  readonly resourceDomainId: import("effect/Schema").String;
538
539
  }>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
@@ -540,6 +541,31 @@ declare const buildControlPlaneClient: (config: SealantInternalConfig) => Effect
540
541
  readonly key: import("effect/Schema").String;
541
542
  readonly createdAt: import("effect/Schema").String;
542
543
  }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError>, import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
544
+ readonly getResourceDomainBudget: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"getResourceDomainBudget", "GET", "/v1/resource-domains/:resourceDomainId/budget", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
545
+ readonly resourceDomainId: import("effect/Schema").String;
546
+ }>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
547
+ readonly revision: import("effect/Schema").Int;
548
+ readonly storageBytes: import("effect/Schema").Struct<{
549
+ readonly limit: import("effect/Schema").Int;
550
+ readonly used: import("effect/Schema").Int;
551
+ readonly reserved: import("effect/Schema").Int;
552
+ readonly warning: import("effect/Schema").Literals<readonly ["none", "80-percent", "95-percent", "full"]>;
553
+ readonly archived: import("effect/Schema").Int;
554
+ readonly protection: import("effect/Schema").Int;
555
+ }>;
556
+ readonly cpuMillicores: import("effect/Schema").Struct<{
557
+ readonly limit: import("effect/Schema").Int;
558
+ readonly used: import("effect/Schema").Int;
559
+ readonly reserved: import("effect/Schema").Int;
560
+ readonly warning: import("effect/Schema").Literals<readonly ["none", "80-percent", "95-percent", "full"]>;
561
+ }>;
562
+ readonly memoryBytes: import("effect/Schema").Struct<{
563
+ readonly limit: import("effect/Schema").Int;
564
+ readonly used: import("effect/Schema").Int;
565
+ readonly reserved: import("effect/Schema").Int;
566
+ readonly warning: import("effect/Schema").Literals<readonly ["none", "80-percent", "95-percent", "full"]>;
567
+ }>;
568
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError>, import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
543
569
  readonly getResourceDomainMember: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"getResourceDomainMember", "GET", "/v1/resource-domains/:resourceDomainId/members/:userId", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
544
570
  readonly resourceDomainId: import("effect/Schema").String;
545
571
  readonly userId: import("effect/Schema").String;
@@ -585,6 +611,36 @@ declare const buildControlPlaneClient: (config: SealantInternalConfig) => Effect
585
611
  readonly version: import("effect/Schema").Int;
586
612
  readonly updatedAt: import("effect/Schema").String;
587
613
  }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainPersonNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainMemberVersionConflictError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError>, import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
614
+ readonly setResourceDomainBudget: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"setResourceDomainBudget", "PUT", "/v1/resource-domains/:resourceDomainId/budget", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
615
+ readonly resourceDomainId: import("effect/Schema").String;
616
+ }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
617
+ readonly revision: import("effect/Schema").Int;
618
+ readonly cpuMillicores: import("effect/Schema").Int;
619
+ readonly memoryBytes: import("effect/Schema").Int;
620
+ readonly storageBytes: import("effect/Schema").Int;
621
+ }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
622
+ readonly revision: import("effect/Schema").Int;
623
+ readonly storageBytes: import("effect/Schema").Struct<{
624
+ readonly limit: import("effect/Schema").Int;
625
+ readonly used: import("effect/Schema").Int;
626
+ readonly reserved: import("effect/Schema").Int;
627
+ readonly warning: import("effect/Schema").Literals<readonly ["none", "80-percent", "95-percent", "full"]>;
628
+ readonly archived: import("effect/Schema").Int;
629
+ readonly protection: import("effect/Schema").Int;
630
+ }>;
631
+ readonly cpuMillicores: import("effect/Schema").Struct<{
632
+ readonly limit: import("effect/Schema").Int;
633
+ readonly used: import("effect/Schema").Int;
634
+ readonly reserved: import("effect/Schema").Int;
635
+ readonly warning: import("effect/Schema").Literals<readonly ["none", "80-percent", "95-percent", "full"]>;
636
+ }>;
637
+ readonly memoryBytes: import("effect/Schema").Struct<{
638
+ readonly limit: import("effect/Schema").Int;
639
+ readonly used: import("effect/Schema").Int;
640
+ readonly reserved: import("effect/Schema").Int;
641
+ readonly warning: import("effect/Schema").Literals<readonly ["none", "80-percent", "95-percent", "full"]>;
642
+ }>;
643
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainBudgetRevisionConflictError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError>, import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
588
644
  };
589
645
  readonly runs: {
590
646
  readonly createRun: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"createRun", "POST", "/v1/runs/", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
@@ -2534,12 +2590,13 @@ declare const SealantApiClient_base: Context.ServiceClass<SealantApiClient, "@se
2534
2590
  readonly resourceDomains: {
2535
2591
  readonly ensureResourceDomain: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"ensureResourceDomain", "POST", "/v1/resource-domains/", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
2536
2592
  readonly key: import("effect/Schema").String;
2593
+ readonly budget: import("effect/Schema").optional<import("effect/Schema").Struct<Record<"cpuMillicores" | "memoryBytes" | "storageBytes", import("effect/Schema").Int>>>;
2537
2594
  }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
2538
2595
  readonly resourceDomainId: import("effect/Schema").String;
2539
2596
  readonly key: import("effect/Schema").String;
2540
2597
  readonly createdAt: import("effect/Schema").String;
2541
2598
  readonly created: import("effect/Schema").Boolean;
2542
- }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError>, import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
2599
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainBudgetDiffersError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError>, import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
2543
2600
  readonly getResourceDomain: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"getResourceDomain", "GET", "/v1/resource-domains/:resourceDomainId", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
2544
2601
  readonly resourceDomainId: import("effect/Schema").String;
2545
2602
  }>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
@@ -2547,6 +2604,31 @@ declare const SealantApiClient_base: Context.ServiceClass<SealantApiClient, "@se
2547
2604
  readonly key: import("effect/Schema").String;
2548
2605
  readonly createdAt: import("effect/Schema").String;
2549
2606
  }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError>, import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
2607
+ readonly getResourceDomainBudget: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"getResourceDomainBudget", "GET", "/v1/resource-domains/:resourceDomainId/budget", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
2608
+ readonly resourceDomainId: import("effect/Schema").String;
2609
+ }>>, never, never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
2610
+ readonly revision: import("effect/Schema").Int;
2611
+ readonly storageBytes: import("effect/Schema").Struct<{
2612
+ readonly limit: import("effect/Schema").Int;
2613
+ readonly used: import("effect/Schema").Int;
2614
+ readonly reserved: import("effect/Schema").Int;
2615
+ readonly warning: import("effect/Schema").Literals<readonly ["none", "80-percent", "95-percent", "full"]>;
2616
+ readonly archived: import("effect/Schema").Int;
2617
+ readonly protection: import("effect/Schema").Int;
2618
+ }>;
2619
+ readonly cpuMillicores: import("effect/Schema").Struct<{
2620
+ readonly limit: import("effect/Schema").Int;
2621
+ readonly used: import("effect/Schema").Int;
2622
+ readonly reserved: import("effect/Schema").Int;
2623
+ readonly warning: import("effect/Schema").Literals<readonly ["none", "80-percent", "95-percent", "full"]>;
2624
+ }>;
2625
+ readonly memoryBytes: import("effect/Schema").Struct<{
2626
+ readonly limit: import("effect/Schema").Int;
2627
+ readonly used: import("effect/Schema").Int;
2628
+ readonly reserved: import("effect/Schema").Int;
2629
+ readonly warning: import("effect/Schema").Literals<readonly ["none", "80-percent", "95-percent", "full"]>;
2630
+ }>;
2631
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError>, import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
2550
2632
  readonly getResourceDomainMember: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"getResourceDomainMember", "GET", "/v1/resource-domains/:resourceDomainId/members/:userId", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
2551
2633
  readonly resourceDomainId: import("effect/Schema").String;
2552
2634
  readonly userId: import("effect/Schema").String;
@@ -2592,6 +2674,36 @@ declare const SealantApiClient_base: Context.ServiceClass<SealantApiClient, "@se
2592
2674
  readonly version: import("effect/Schema").Int;
2593
2675
  readonly updatedAt: import("effect/Schema").String;
2594
2676
  }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainPersonNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainMemberVersionConflictError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError>, import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
2677
+ readonly setResourceDomainBudget: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"setResourceDomainBudget", "PUT", "/v1/resource-domains/:resourceDomainId/budget", import("effect/Schema").toCodecStringTree<import("effect/Schema").Struct<{
2678
+ readonly resourceDomainId: import("effect/Schema").String;
2679
+ }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
2680
+ readonly revision: import("effect/Schema").Int;
2681
+ readonly cpuMillicores: import("effect/Schema").Int;
2682
+ readonly memoryBytes: import("effect/Schema").Int;
2683
+ readonly storageBytes: import("effect/Schema").Int;
2684
+ }>>, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
2685
+ readonly revision: import("effect/Schema").Int;
2686
+ readonly storageBytes: import("effect/Schema").Struct<{
2687
+ readonly limit: import("effect/Schema").Int;
2688
+ readonly used: import("effect/Schema").Int;
2689
+ readonly reserved: import("effect/Schema").Int;
2690
+ readonly warning: import("effect/Schema").Literals<readonly ["none", "80-percent", "95-percent", "full"]>;
2691
+ readonly archived: import("effect/Schema").Int;
2692
+ readonly protection: import("effect/Schema").Int;
2693
+ }>;
2694
+ readonly cpuMillicores: import("effect/Schema").Struct<{
2695
+ readonly limit: import("effect/Schema").Int;
2696
+ readonly used: import("effect/Schema").Int;
2697
+ readonly reserved: import("effect/Schema").Int;
2698
+ readonly warning: import("effect/Schema").Literals<readonly ["none", "80-percent", "95-percent", "full"]>;
2699
+ }>;
2700
+ readonly memoryBytes: import("effect/Schema").Struct<{
2701
+ readonly limit: import("effect/Schema").Int;
2702
+ readonly used: import("effect/Schema").Int;
2703
+ readonly reserved: import("effect/Schema").Int;
2704
+ readonly warning: import("effect/Schema").Literals<readonly ["none", "80-percent", "95-percent", "full"]>;
2705
+ }>;
2706
+ }>>, import("effect/Schema").toCodecJson<typeof import("@sealant/api-contracts").ResourceDomainForbiddenError | typeof import("@sealant/api-contracts").ResourceDomainNotFoundError | typeof import("@sealant/api-contracts").ResourceDomainBudgetRevisionConflictError | typeof import("@sealant/api-contracts").ResourceDomainInternalServerError>, import("@sealant/api-contracts").RequestRefusal, never>, never, never>;
2595
2707
  };
2596
2708
  readonly runs: {
2597
2709
  readonly createRun: HttpApiClient.Client.Method<import("effect/http-api/HttpApiEndpoint").HttpApiEndpoint<"createRun", "POST", "/v1/runs/", never, never, import("effect/Schema").toCodecJson<import("effect/Schema").Struct<{
@@ -1434,12 +1434,16 @@ export declare const archiveSshKeyOp: (sshKeyId: string, ownerUserId: string) =>
1434
1434
  readonly fingerprint: string;
1435
1435
  readonly createdAt: string;
1436
1436
  }, import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | import("effect/Schema").SchemaError | import("@sealant/api-contracts").SshKeyInternalServerError | import("@sealant/api-contracts").SshKeyNotFoundError, SealantApiClient>;
1437
- export declare const ensureResourceDomainOp: (key: string) => Effect.Effect<{
1437
+ export declare const ensureResourceDomainOp: (key: string, budget?: {
1438
+ readonly cpuMillicores: number;
1439
+ readonly memoryBytes: number;
1440
+ readonly storageBytes: number;
1441
+ } | undefined) => Effect.Effect<{
1438
1442
  readonly resourceDomainId: string;
1439
1443
  readonly key: string;
1440
1444
  readonly createdAt: string;
1441
1445
  readonly created: boolean;
1442
- }, import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | import("@sealant/api-contracts").ResourceDomainForbiddenError | import("@sealant/api-contracts").ResourceDomainInternalServerError | import("effect/Schema").SchemaError, SealantApiClient>;
1446
+ }, import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | import("@sealant/api-contracts").ResourceDomainBudgetDiffersError | import("@sealant/api-contracts").ResourceDomainForbiddenError | import("@sealant/api-contracts").ResourceDomainInternalServerError | import("effect/Schema").SchemaError, SealantApiClient>;
1443
1447
  export declare const getResourceDomainOp: (resourceDomainId: string) => Effect.Effect<{
1444
1448
  readonly resourceDomainId: string;
1445
1449
  readonly key: string;
@@ -1479,3 +1483,54 @@ export declare const listResourceDomainMembersOp: (resourceDomainId: string, que
1479
1483
  }[];
1480
1484
  readonly nextCursor?: string | undefined;
1481
1485
  }, import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | import("@sealant/api-contracts").ResourceDomainForbiddenError | import("@sealant/api-contracts").ResourceDomainInternalServerError | import("@sealant/api-contracts").ResourceDomainNotFoundError | import("effect/Schema").SchemaError, SealantApiClient>;
1486
+ export declare const getResourceDomainBudgetOp: (resourceDomainId: string) => Effect.Effect<{
1487
+ readonly revision: number;
1488
+ readonly storageBytes: {
1489
+ readonly limit: number;
1490
+ readonly used: number;
1491
+ readonly reserved: number;
1492
+ readonly warning: "80-percent" | "95-percent" | "full" | "none";
1493
+ readonly archived: number;
1494
+ readonly protection: number;
1495
+ };
1496
+ readonly cpuMillicores: {
1497
+ readonly limit: number;
1498
+ readonly used: number;
1499
+ readonly reserved: number;
1500
+ readonly warning: "80-percent" | "95-percent" | "full" | "none";
1501
+ };
1502
+ readonly memoryBytes: {
1503
+ readonly limit: number;
1504
+ readonly used: number;
1505
+ readonly reserved: number;
1506
+ readonly warning: "80-percent" | "95-percent" | "full" | "none";
1507
+ };
1508
+ }, import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | import("@sealant/api-contracts").ResourceDomainForbiddenError | import("@sealant/api-contracts").ResourceDomainInternalServerError | import("@sealant/api-contracts").ResourceDomainNotFoundError | import("effect/Schema").SchemaError, SealantApiClient>;
1509
+ export declare const setResourceDomainBudgetOp: (resourceDomainId: string, payload: {
1510
+ readonly revision: number;
1511
+ readonly cpuMillicores: number;
1512
+ readonly memoryBytes: number;
1513
+ readonly storageBytes: number;
1514
+ }) => Effect.Effect<{
1515
+ readonly revision: number;
1516
+ readonly storageBytes: {
1517
+ readonly limit: number;
1518
+ readonly used: number;
1519
+ readonly reserved: number;
1520
+ readonly warning: "80-percent" | "95-percent" | "full" | "none";
1521
+ readonly archived: number;
1522
+ readonly protection: number;
1523
+ };
1524
+ readonly cpuMillicores: {
1525
+ readonly limit: number;
1526
+ readonly used: number;
1527
+ readonly reserved: number;
1528
+ readonly warning: "80-percent" | "95-percent" | "full" | "none";
1529
+ };
1530
+ readonly memoryBytes: {
1531
+ readonly limit: number;
1532
+ readonly used: number;
1533
+ readonly reserved: number;
1534
+ readonly warning: "80-percent" | "95-percent" | "full" | "none";
1535
+ };
1536
+ }, import("effect/http/HttpClientError").HttpClientError | import("@sealant/api-contracts").RequestRefusedError | import("@sealant/api-contracts").ResourceDomainBudgetRevisionConflictError | import("@sealant/api-contracts").ResourceDomainForbiddenError | import("@sealant/api-contracts").ResourceDomainInternalServerError | import("@sealant/api-contracts").ResourceDomainNotFoundError | import("effect/Schema").SchemaError, SealantApiClient>;
@@ -87,7 +87,9 @@ export const createSshKeyOp = (payload) => Effect.flatMap(SealantApiClient, (cli
87
87
  export const listSshKeysOp = (ownerUserId) => Effect.flatMap(SealantApiClient, (client) => client.sshKeys.listSshKeys({ query: { ownerUserId } }));
88
88
  export const archiveSshKeyOp = (sshKeyId, ownerUserId) => Effect.flatMap(SealantApiClient, (client) => client.sshKeys.archiveSshKey({ params: { sshKeyId }, query: { ownerUserId } }));
89
89
  // ---- resource domains (the SDK's scopes) ----
90
- export const ensureResourceDomainOp = (key) => Effect.flatMap(SealantApiClient, (client) => client.resourceDomains.ensureResourceDomain({ payload: { key } }));
90
+ export const ensureResourceDomainOp = (key, budget) => Effect.flatMap(SealantApiClient, (client) => client.resourceDomains.ensureResourceDomain({
91
+ payload: budget === undefined ? { key } : { key, budget },
92
+ }));
91
93
  export const getResourceDomainOp = (resourceDomainId) => Effect.flatMap(SealantApiClient, (client) => client.resourceDomains.getResourceDomain({ params: { resourceDomainId } }));
92
94
  export const grantResourceDomainMemberOp = (resourceDomainId, userId, payload) => Effect.flatMap(SealantApiClient, (client) => client.resourceDomains.grantResourceDomainMember({
93
95
  params: { resourceDomainId, userId },
@@ -99,3 +101,5 @@ export const revokeResourceDomainMemberOp = (resourceDomainId, userId, payload)
99
101
  }));
100
102
  export const getResourceDomainMemberOp = (resourceDomainId, userId) => Effect.flatMap(SealantApiClient, (client) => client.resourceDomains.getResourceDomainMember({ params: { resourceDomainId, userId } }));
101
103
  export const listResourceDomainMembersOp = (resourceDomainId, query) => Effect.flatMap(SealantApiClient, (client) => client.resourceDomains.listResourceDomainMembers({ params: { resourceDomainId }, query }));
104
+ export const getResourceDomainBudgetOp = (resourceDomainId) => Effect.flatMap(SealantApiClient, (client) => client.resourceDomains.getResourceDomainBudget({ params: { resourceDomainId } }));
105
+ export const setResourceDomainBudgetOp = (resourceDomainId, payload) => Effect.flatMap(SealantApiClient, (client) => client.resourceDomains.setResourceDomainBudget({ params: { resourceDomainId }, payload }));
package/dist/index.d.ts CHANGED
@@ -18,6 +18,6 @@ export { Sealant } from "./client.js";
18
18
  export { claudeCode, codex, customHarness, opencode, pi } from "./harness.js";
19
19
  export { ForwardDialError, type ForwardDialFailure, type ForwardDialReason, ForwardResetError, SealantApiError, SealantError, SealantNotImplementedError, SealantRuntimeError, } from "./errors.js";
20
20
  export type * from "./types.js";
21
- export type { EnsuredScope, ScopeClient, ScopeInfo, ScopeMember, ScopeMemberDecision, ScopeMemberPage, ScopeMembers, ScopesNamespace, } from "./scopes.js";
21
+ export type { EnsuredScope, ScopeBudget, ScopeBudgetDimension, ScopeBudgetLimits, ScopeBudgets, ScopeClient, ScopeInfo, ScopeMember, ScopeMemberDecision, ScopeMemberPage, ScopeMembers, ScopesNamespace, } from "./scopes.js";
22
22
  export { findWorkspaceEnvReservedRule, findWorkspaceSecretEnvReservedRule, formatWorkspaceEnvIssue, parseWorkspaceEnv, parseWorkspaceSecretEnv, WORKSPACE_ENV_MAX_ENTRIES, WORKSPACE_ENV_MAX_NAME_LENGTH, WORKSPACE_ENV_MAX_TOTAL_BYTES, WORKSPACE_ENV_MAX_VALUE_BYTES, WORKSPACE_ENV_NAME_PATTERN, WORKSPACE_ENV_SECRET_MARKERS, } from "@sealant/api-contracts/workspace-environment";
23
23
  export type { WorkspaceEnvIssue, WorkspaceEnvParseResult, WorkspaceEnvReservedRule, } from "@sealant/api-contracts/workspace-environment";
package/dist/scopes.d.ts CHANGED
@@ -1,3 +1,12 @@
1
+ /**
2
+ * `sealant.scopes`: owners that are projects, not people (the control plane's resource domains).
3
+ *
4
+ * An application ensures one scope per project, by a global `<application>:<name>` key, and names
5
+ * the people who may reach it. A scope never holds a login or a provider credential and never runs
6
+ * a harness, so the client that acts as one (`actAs`) has no workspace, run, inference or
7
+ * credential methods at all. These calls need a service key and never use `ownerUserId`.
8
+ */
9
+ import { type ResourceDomainBudgetDimension } from "@sealant/api-contracts";
1
10
  import type { SdkRuntime } from "./effect/runtime.js";
2
11
  export interface ScopeInfo {
3
12
  /** `rdm:<uuid>`. No person field of the API accepts it. */
@@ -53,16 +62,59 @@ export interface ScopeMembers {
53
62
  readonly cursor?: string;
54
63
  }): Promise<ScopeMemberPage>;
55
64
  }
65
+ /** Ceilings on what a scope's objects may hold (CPU millicores, memory and storage bytes). */
66
+ export type ScopeBudgetLimits = {
67
+ readonly [D in ResourceDomainBudgetDimension]: number;
68
+ };
69
+ /**
70
+ * `used` (confirmed to exist) and `reserved` (admitted, not yet confirmed) both count against
71
+ * `limit`; `warning` is the highest share of it they reach.
72
+ */
73
+ export interface ScopeBudgetDimension {
74
+ readonly limit: number;
75
+ readonly used: number;
76
+ readonly reserved: number;
77
+ readonly warning: "none" | "80-percent" | "95-percent" | "full";
78
+ }
79
+ /** Storage is one allowance, archived volumes and protection included; nothing is deleted to free it. */
80
+ export type ScopeBudget = {
81
+ /** Name it to change the budget: a change made since refuses yours. */
82
+ readonly revision: number;
83
+ } & {
84
+ readonly [D in ResourceDomainBudgetDimension]: ScopeBudgetDimension;
85
+ } & {
86
+ readonly storageBytes: {
87
+ readonly archived: number;
88
+ readonly protection: number;
89
+ };
90
+ };
91
+ export interface ScopeBudgets {
92
+ get(): Promise<ScopeBudget>;
93
+ /**
94
+ * Replace the budget at the `revision` you read. A change since rejects (409,
95
+ * `ResourceDomainBudgetRevisionConflictError`). It answers the budget it wrote, and changes
96
+ * nothing the scope holds.
97
+ */
98
+ set(change: ScopeBudgetLimits & {
99
+ readonly revision: number;
100
+ }): Promise<ScopeBudget>;
101
+ }
56
102
  /** A client acting as one scope. It has no method that could reach a credential or a harness. */
57
103
  export interface ScopeClient {
58
104
  readonly id: string;
59
105
  get(): Promise<ScopeInfo>;
60
106
  readonly members: ScopeMembers;
107
+ readonly budget: ScopeBudgets;
61
108
  }
62
109
  export interface ScopesNamespace {
63
- /** The scope with this key, created on the first call; later and concurrent calls answer it. */
110
+ /**
111
+ * The scope with this key, created on the first call (with `budget`, or zero); later and
112
+ * concurrent calls answer it. Naming another budget rejects (409,
113
+ * `ResourceDomainBudgetDiffersError`, carrying the scope's id and its budget's revision).
114
+ */
64
115
  ensure(options: {
65
116
  readonly key: string;
117
+ readonly budget?: ScopeBudgetLimits;
66
118
  }): Promise<EnsuredScope>;
67
119
  get(scopeId: string): Promise<ScopeInfo>;
68
120
  /** A client for this scope alone, and the only way to its members. Nothing is checked until its first call. */
package/dist/scopes.js CHANGED
@@ -1,4 +1,14 @@
1
- import { ensureResourceDomainOp, getResourceDomainMemberOp, getResourceDomainOp, grantResourceDomainMemberOp, listResourceDomainMembersOp, revokeResourceDomainMemberOp, } from "./effect/operations.js";
1
+ /**
2
+ * `sealant.scopes`: owners that are projects, not people (the control plane's resource domains).
3
+ *
4
+ * An application ensures one scope per project, by a global `<application>:<name>` key, and names
5
+ * the people who may reach it. A scope never holds a login or a provider credential and never runs
6
+ * a harness, so the client that acts as one (`actAs`) has no workspace, run, inference or
7
+ * credential methods at all. These calls need a service key and never use `ownerUserId`.
8
+ */
9
+ import { RESOURCE_DOMAIN_BUDGET_DIMENSIONS, } from "@sealant/api-contracts";
10
+ import * as Rec from "effect/Record";
11
+ import { ensureResourceDomainOp, getResourceDomainBudgetOp, getResourceDomainMemberOp, getResourceDomainOp, grantResourceDomainMemberOp, listResourceDomainMembersOp, revokeResourceDomainMemberOp, setResourceDomainBudgetOp, } from "./effect/operations.js";
2
12
  const toScope = (wire) => ({
3
13
  id: wire.resourceDomainId,
4
14
  key: wire.key,
@@ -7,8 +17,8 @@ const toScope = (wire) => ({
7
17
  export const makeScopes = (runtime) => {
8
18
  const get = async (scopeId) => toScope(await runtime.run(getResourceDomainOp(scopeId)));
9
19
  return {
10
- ensure: async ({ key }) => {
11
- const wire = await runtime.run(ensureResourceDomainOp(key));
20
+ ensure: async ({ key, budget }) => {
21
+ const wire = await runtime.run(ensureResourceDomainOp(key, budget));
12
22
  return { ...toScope(wire), created: wire.created };
13
23
  },
14
24
  get,
@@ -26,6 +36,13 @@ export const makeScopes = (runtime) => {
26
36
  : { items: page.items, nextCursor: page.nextCursor };
27
37
  },
28
38
  },
39
+ budget: {
40
+ get: () => runtime.run(getResourceDomainBudgetOp(scopeId)),
41
+ set: (change) => runtime.run(setResourceDomainBudgetOp(scopeId, {
42
+ ...Rec.map(RESOURCE_DOMAIN_BUDGET_DIMENSIONS, (_, dimension) => change[dimension]),
43
+ revision: change.revision,
44
+ })),
45
+ },
29
46
  }),
30
47
  };
31
48
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sealant/sdk-next",
3
- "version": "0.40.0-next.770",
3
+ "version": "0.40.0-next.772",
4
4
  "description": "The fluent public SDK for Sealant — create a workspace, run a harness, replay the record.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -26,12 +26,12 @@
26
26
  "node": ">=20"
27
27
  },
28
28
  "dependencies": {
29
- "@sealant/api-contracts": "npm:@sealant/api-contracts-next@0.40.0-next.770"
29
+ "@sealant/api-contracts": "npm:@sealant/api-contracts-next@0.40.0-next.772"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "effect": "^4.0.5"
33
33
  },
34
- "gitHead": "1e8b4f1153f5107504649c863c305cd31f424d58",
34
+ "gitHead": "722ef7c7d08581db5c9c4de770d5630329063a97",
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  }