@maiaos/sdk 0.1.0-canary.35 → 0.1.0-canary.36

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/index.d.ts CHANGED
@@ -12,7 +12,7 @@ export { type ChangedAggregate, type NodeChange, type NodeChangesSubscribe, redu
12
12
  export { makePortLeaseClient, MAX_PORT_LEASE_COUNT, MAX_PORT_LEASE_PAGE_SIZE, PORT_LEASE_ERROR_CODES, PORT_LEASE_SCHEMA_VERSION, type PortLease, type PortLeaseAcquireParameters, portLeaseAcquireParametersSchema, type PortLeaseAcquireResult, portLeaseAcquireResultSchema, type PortLeaseClient, type PortLeaseErrorCode, type PortLeaseListParameters, portLeaseListParametersSchema, type PortLeaseListResult, portLeaseListResultSchema, type PortLeaseOwner, type PortLeaseReleaseParameters, portLeaseReleaseParametersSchema, type PortLeaseReleaseResult, portLeaseReleaseResultSchema, type PortLeaseRenewParameters, portLeaseRenewParametersSchema, type PortLeaseRenewResult, portLeaseRenewResultSchema, portLeaseSchema, } from "./port-lease/index.js";
13
13
  export type { PresentationCatalogParameters, PresentationCatalogResult, PresentationClient, PresentationDirectoryParameters, PresentationDirectoryResult, PresentationProjectListParameters, PresentationProjectListResult, PresentationProjectSpec, PresentationSessionListParameters, PresentationSessionListResult, PresentationSessionSpec, PresentationSpec, } from "./presentation/index.js";
14
14
  export { PRESENTATION_CATALOG_DIGEST, PRESENTATION_CATALOG_VERSION, presentationCatalogParametersSchema, presentationCatalogResultSchema, presentationDirectoryParametersSchema, presentationDirectoryResultSchema, presentationProjectListParametersSchema, presentationProjectListResultSchema, presentationProjectSpecSchema, presentationSessionListParametersSchema, presentationSessionListResultSchema, presentationSessionSpecSchema, presentationSpecSchema, } from "./presentation/index.js";
15
- export { DEFAULT_SESSION_GUARD_LIMITS, makeProjectGuardClient, type ProjectGuard, type ProjectGuardClient, type ProjectGuardConfirmParameters, projectGuardConfirmParametersSchema, type ProjectGuardConfirmResult, projectGuardConfirmResultSchema, type ProjectGuardPreviewParameters, projectGuardPreviewParametersSchema, type ProjectGuardPreviewResult, projectGuardPreviewResultSchema, type ProjectGuardShowParameters, projectGuardShowParametersSchema, type ProjectGuardShowResult, projectGuardShowResultSchema, SESSION_GUARD_BOUNDS, SESSION_GUARD_ERROR_CODES, SESSION_ROLE_DENIED_ERROR_CODE, type SessionGuardLimits, type SessionRole, } from "./project-guard/index.js";
15
+ export { type ApprovalGrants, COORDINATOR_APPROVAL_GRANTS, DEFAULT_APPROVAL_GRANTS, DEFAULT_SESSION_GUARD_LIMITS, makeProjectGuardClient, type ProjectGuard, type ProjectGuardClient, type ProjectGuardConfirmParameters, projectGuardConfirmParametersSchema, type ProjectGuardConfirmResult, projectGuardConfirmResultSchema, type ProjectGuardPreviewParameters, projectGuardPreviewParametersSchema, type ProjectGuardPreviewResult, projectGuardPreviewResultSchema, type ProjectGuardShowParameters, projectGuardShowParametersSchema, type ProjectGuardShowResult, projectGuardShowResultSchema, SESSION_GUARD_BOUNDS, SESSION_GUARD_ERROR_CODES, SESSION_ROLE_DENIED_ERROR_CODE, type SessionGuardLimits, type SessionRole, } from "./project-guard/index.js";
16
16
  export { makeRemoteNodeClient, type RemoteNodeClient, type RemoteNodeExecutor, type RemoteNodeInstallConfirmParameters, remoteNodeInstallConfirmParametersSchema, type RemoteNodeInstallConfirmResult, type RemoteNodeInstallPlan, type RemoteNodeInstallPreviewParameters, remoteNodeInstallPreviewParametersSchema, type RemoteNodeInstallPreviewResult, type RemoteNodeListParameters, remoteNodeListParametersSchema, type RemoteNodeListResult, type RemoteNodeRecord, type RemoteNodeRegisterConfirmParameters, remoteNodeRegisterConfirmParametersSchema, type RemoteNodeRegisterConfirmResult, type RemoteNodeRegisterPlan, type RemoteNodeRegisterPreviewParameters, remoteNodeRegisterPreviewParametersSchema, type RemoteNodeRegisterPreviewResult, type RemoteNodeRemoveConfirmParameters, remoteNodeRemoveConfirmParametersSchema, type RemoteNodeRemoveConfirmResult, type RemoteNodeRemovePreviewParameters, remoteNodeRemovePreviewParametersSchema, type RemoteNodeRemovePreviewResult, } from "./remote-node/index.js";
17
17
  export { type CancellationSignal, classifyClientError, createMaiaClient, type LocalNodeRequestOptions, type MaiaClient, MaiaClientError, type MaiaClientErrorCode, type MaiaError, type MaiaErrorKind, type MaiaRequest, type MaiaTransport, type RuntimeSchema, type TransportRequestOptions, } from "./request/index.js";
18
18
  export { makeRoutineClient, MAX_LIVE_ROUTINES_PER_PROJECT, MAX_ROUTINE_PAGE_SIZE, MAX_ROUTINE_PREVIEW_FIRES, MAX_ROUTINE_SHOWN_FIRES, MIN_ROUTINE_INTERVAL_MINUTES, type Routine, ROUTINE_ERROR_CODES, ROUTINE_FIRE_REASONS, type RoutineClient, type RoutineCreateConfirmParameters, routineCreateConfirmParametersSchema, type RoutineCreateConfirmResult, type RoutineCreatePreviewParameters, routineCreatePreviewParametersSchema, type RoutineCreatePreviewResult, type RoutineDisableConfirmParameters, routineDisableConfirmParametersSchema, type RoutineDisableConfirmResult, type RoutineDisablePreviewParameters, routineDisablePreviewParametersSchema, type RoutineDisablePreviewResult, type RoutineFire, type RoutineListParameters, routineListParametersSchema, type RoutineListResult, type RoutinePauseResult, type RoutineResumeResult, type RoutineRunConfirmParameters, routineRunConfirmParametersSchema, type RoutineRunConfirmResult, type RoutineRunPreviewResult, type RoutineSchedule, routineSchema, type RoutineShowParameters, routineShowParametersSchema, type RoutineShowResult, type RoutineTemplate, type RoutineTransitionParameters, routineTransitionParametersSchema, } from "./routine/index.js";
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ export { INTERACTION_EXPIRED_ERROR_CODE, interactionAnswerSchema, interactionCan
11
11
  export { reduceNodeChanges, watchNodeChanges, } from "./node-changes/index.js";
12
12
  export { makePortLeaseClient, MAX_PORT_LEASE_COUNT, MAX_PORT_LEASE_PAGE_SIZE, PORT_LEASE_ERROR_CODES, PORT_LEASE_SCHEMA_VERSION, portLeaseAcquireParametersSchema, portLeaseAcquireResultSchema, portLeaseListParametersSchema, portLeaseListResultSchema, portLeaseReleaseParametersSchema, portLeaseReleaseResultSchema, portLeaseRenewParametersSchema, portLeaseRenewResultSchema, portLeaseSchema, } from "./port-lease/index.js";
13
13
  export { PRESENTATION_CATALOG_DIGEST, PRESENTATION_CATALOG_VERSION, presentationCatalogParametersSchema, presentationCatalogResultSchema, presentationDirectoryParametersSchema, presentationDirectoryResultSchema, presentationProjectListParametersSchema, presentationProjectListResultSchema, presentationProjectSpecSchema, presentationSessionListParametersSchema, presentationSessionListResultSchema, presentationSessionSpecSchema, presentationSpecSchema, } from "./presentation/index.js";
14
- export { DEFAULT_SESSION_GUARD_LIMITS, makeProjectGuardClient, projectGuardConfirmParametersSchema, projectGuardConfirmResultSchema, projectGuardPreviewParametersSchema, projectGuardPreviewResultSchema, projectGuardShowParametersSchema, projectGuardShowResultSchema, SESSION_GUARD_BOUNDS, SESSION_GUARD_ERROR_CODES, SESSION_ROLE_DENIED_ERROR_CODE, } from "./project-guard/index.js";
14
+ export { COORDINATOR_APPROVAL_GRANTS, DEFAULT_APPROVAL_GRANTS, DEFAULT_SESSION_GUARD_LIMITS, makeProjectGuardClient, projectGuardConfirmParametersSchema, projectGuardConfirmResultSchema, projectGuardPreviewParametersSchema, projectGuardPreviewResultSchema, projectGuardShowParametersSchema, projectGuardShowResultSchema, SESSION_GUARD_BOUNDS, SESSION_GUARD_ERROR_CODES, SESSION_ROLE_DENIED_ERROR_CODE, } from "./project-guard/index.js";
15
15
  export { makeRemoteNodeClient, remoteNodeInstallConfirmParametersSchema, remoteNodeInstallPreviewParametersSchema, remoteNodeListParametersSchema, remoteNodeRegisterConfirmParametersSchema, remoteNodeRegisterPreviewParametersSchema, remoteNodeRemoveConfirmParametersSchema, remoteNodeRemovePreviewParametersSchema, } from "./remote-node/index.js";
16
16
  export { classifyClientError, createMaiaClient, MaiaClientError, } from "./request/index.js";
17
17
  export { makeRoutineClient, MAX_LIVE_ROUTINES_PER_PROJECT, MAX_ROUTINE_PAGE_SIZE, MAX_ROUTINE_PREVIEW_FIRES, MAX_ROUTINE_SHOWN_FIRES, MIN_ROUTINE_INTERVAL_MINUTES, ROUTINE_ERROR_CODES, ROUTINE_FIRE_REASONS, routineCreateConfirmParametersSchema, routineCreatePreviewParametersSchema, routineDisableConfirmParametersSchema, routineDisablePreviewParametersSchema, routineListParametersSchema, routineRunConfirmParametersSchema, routineSchema, routineShowParametersSchema, routineTransitionParametersSchema, } from "./routine/index.js";
@@ -46,6 +46,10 @@ export declare const connectDiscoveredNodeApi: <TClient>(options: NodeApiDiscove
46
46
  readonly pid: number;
47
47
  readonly profile: string;
48
48
  readonly startedAt: string;
49
+ readonly admissionCaps?: {
50
+ readonly defaultAccountSessions: number;
51
+ readonly maximumActiveSessions: number;
52
+ } | undefined;
49
53
  readonly executorHost?: {
50
54
  readonly bubblewrap: "found" | "missing";
51
55
  readonly socat: "found" | "missing";
@@ -9,6 +9,7 @@ const sameLimits = (left, right) => left.maxDepth === right.maxDepth &&
9
9
  left.maxLeasesPerSession === right.maxLeasesPerSession &&
10
10
  left.maxLiveChildren === right.maxLiveChildren &&
11
11
  left.maxMessagesPerMinute === right.maxMessagesPerMinute;
12
+ const namedGrantsHold = (named, actual) => (named?.coordinator ?? actual.coordinator) === actual.coordinator;
12
13
  const parseShow = (value, input) => {
13
14
  const result = projectGuardShowResultSchema.parse(value);
14
15
  requireMatch(result.guard.projectId === input.projectId);
@@ -19,7 +20,8 @@ const parsePreview = (value, input) => {
19
20
  requireMatch(result.commandId === input.commandId &&
20
21
  result.expectedRevision === input.expectedRevision &&
21
22
  result.projectId === input.projectId &&
22
- sameLimits(result.limits, input.limits));
23
+ sameLimits(result.limits, input.limits) &&
24
+ namedGrantsHold(input.approvalGrants, result.approvalGrants));
23
25
  return result;
24
26
  };
25
27
  const parseConfirm = (value, input) => {
@@ -28,7 +30,8 @@ const parseConfirm = (value, input) => {
28
30
  result.expectedRevision === input.expectedRevision &&
29
31
  result.inputDigest === input.inputDigest &&
30
32
  result.guard.projectId === input.projectId &&
31
- sameLimits(result.guard.limits, input.limits));
33
+ sameLimits(result.guard.limits, input.limits) &&
34
+ namedGrantsHold(input.approvalGrants, result.guard.approvalGrants));
32
35
  return result;
33
36
  };
34
37
  export const makeProjectGuardOperations = (request) => ({
@@ -1,2 +1,2 @@
1
- export { DEFAULT_SESSION_GUARD_LIMITS, makeProjectGuardClient, type ProjectGuard, type ProjectGuardClient, type ProjectGuardConfirmParameters, projectGuardConfirmParametersSchema, type ProjectGuardConfirmResult, projectGuardConfirmResultSchema, type ProjectGuardPreviewParameters, projectGuardPreviewParametersSchema, type ProjectGuardPreviewResult, projectGuardPreviewResultSchema, type ProjectGuardShowParameters, projectGuardShowParametersSchema, type ProjectGuardShowResult, projectGuardShowResultSchema, SESSION_GUARD_BOUNDS, SESSION_GUARD_ERROR_CODES, SESSION_ROLE_DENIED_ERROR_CODE, type SessionGuardLimits, type SessionRole, } from "./project-guard.js";
1
+ export { type ApprovalGrants, COORDINATOR_APPROVAL_GRANTS, DEFAULT_APPROVAL_GRANTS, DEFAULT_SESSION_GUARD_LIMITS, makeProjectGuardClient, type ProjectGuard, type ProjectGuardClient, type ProjectGuardConfirmParameters, projectGuardConfirmParametersSchema, type ProjectGuardConfirmResult, projectGuardConfirmResultSchema, type ProjectGuardPreviewParameters, projectGuardPreviewParametersSchema, type ProjectGuardPreviewResult, projectGuardPreviewResultSchema, type ProjectGuardShowParameters, projectGuardShowParametersSchema, type ProjectGuardShowResult, projectGuardShowResultSchema, SESSION_GUARD_BOUNDS, SESSION_GUARD_ERROR_CODES, SESSION_ROLE_DENIED_ERROR_CODE, type SessionGuardLimits, type SessionRole, } from "./project-guard.js";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- export { DEFAULT_SESSION_GUARD_LIMITS, makeProjectGuardClient, projectGuardConfirmParametersSchema, projectGuardConfirmResultSchema, projectGuardPreviewParametersSchema, projectGuardPreviewResultSchema, projectGuardShowParametersSchema, projectGuardShowResultSchema, SESSION_GUARD_BOUNDS, SESSION_GUARD_ERROR_CODES, SESSION_ROLE_DENIED_ERROR_CODE, } from "./project-guard.js";
1
+ export { COORDINATOR_APPROVAL_GRANTS, DEFAULT_APPROVAL_GRANTS, DEFAULT_SESSION_GUARD_LIMITS, makeProjectGuardClient, projectGuardConfirmParametersSchema, projectGuardConfirmResultSchema, projectGuardPreviewParametersSchema, projectGuardPreviewResultSchema, projectGuardShowParametersSchema, projectGuardShowResultSchema, SESSION_GUARD_BOUNDS, SESSION_GUARD_ERROR_CODES, SESSION_ROLE_DENIED_ERROR_CODE, } from "./project-guard.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -6,5 +6,5 @@ export type ProjectGuardClient = {
6
6
  readonly showProjectGuard: (parameters: ProjectGuardShowParameters, options: LocalNodeRequestOptions) => Promise<ProjectGuardShowResult>;
7
7
  };
8
8
  export declare const makeProjectGuardClient: (request: LocalNodeRequester) => ProjectGuardClient;
9
- export { DEFAULT_SESSION_GUARD_LIMITS, type ProjectGuard, type ProjectGuardConfirmParameters, projectGuardConfirmParametersSchema, type ProjectGuardConfirmResult, projectGuardConfirmResultSchema, type ProjectGuardPreviewParameters, projectGuardPreviewParametersSchema, type ProjectGuardPreviewResult, projectGuardPreviewResultSchema, type ProjectGuardShowParameters, projectGuardShowParametersSchema, type ProjectGuardShowResult, projectGuardShowResultSchema, SESSION_GUARD_BOUNDS, SESSION_GUARD_ERROR_CODES, SESSION_ROLE_DENIED_ERROR_CODE, type SessionGuardLimits, type SessionRole, } from "@maiaos/protocol";
9
+ export { type ApprovalGrants, COORDINATOR_APPROVAL_GRANTS, DEFAULT_APPROVAL_GRANTS, DEFAULT_SESSION_GUARD_LIMITS, type ProjectGuard, type ProjectGuardConfirmParameters, projectGuardConfirmParametersSchema, type ProjectGuardConfirmResult, projectGuardConfirmResultSchema, type ProjectGuardPreviewParameters, projectGuardPreviewParametersSchema, type ProjectGuardPreviewResult, projectGuardPreviewResultSchema, type ProjectGuardShowParameters, projectGuardShowParametersSchema, type ProjectGuardShowResult, projectGuardShowResultSchema, SESSION_GUARD_BOUNDS, SESSION_GUARD_ERROR_CODES, SESSION_ROLE_DENIED_ERROR_CODE, type SessionGuardLimits, type SessionRole, } from "@maiaos/protocol";
10
10
  //# sourceMappingURL=project-guard.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { fromPromiseRequester, toPromiseClient } from "../request/effect.js";
2
2
  import { makeProjectGuardOperations } from "./effect.js";
3
3
  export const makeProjectGuardClient = (request) => toPromiseClient(makeProjectGuardOperations(fromPromiseRequester(request)));
4
- export { DEFAULT_SESSION_GUARD_LIMITS, projectGuardConfirmParametersSchema, projectGuardConfirmResultSchema, projectGuardPreviewParametersSchema, projectGuardPreviewResultSchema, projectGuardShowParametersSchema, projectGuardShowResultSchema, SESSION_GUARD_BOUNDS, SESSION_GUARD_ERROR_CODES, SESSION_ROLE_DENIED_ERROR_CODE, } from "@maiaos/protocol";
4
+ export { COORDINATOR_APPROVAL_GRANTS, DEFAULT_APPROVAL_GRANTS, DEFAULT_SESSION_GUARD_LIMITS, projectGuardConfirmParametersSchema, projectGuardConfirmResultSchema, projectGuardPreviewParametersSchema, projectGuardPreviewResultSchema, projectGuardShowParametersSchema, projectGuardShowResultSchema, SESSION_GUARD_BOUNDS, SESSION_GUARD_ERROR_CODES, SESSION_ROLE_DENIED_ERROR_CODE, } from "@maiaos/protocol";
5
5
  //# sourceMappingURL=project-guard.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maiaos/sdk",
3
- "version": "0.1.0-canary.35",
3
+ "version": "0.1.0-canary.36",
4
4
  "description": "TypeScript SDK for Maia Node: typed, validated calls to create and drive AI coding agent Sessions (Claude Code, Codex), wait for turns and read receipts.",
5
5
  "keywords": [
6
6
  "maia",
@@ -72,7 +72,7 @@
72
72
  "typescript": "npm:@typescript/typescript6@6.0.2"
73
73
  },
74
74
  "dependencies": {
75
- "@maiaos/protocol": "0.1.0-canary.35",
75
+ "@maiaos/protocol": "0.1.0-canary.36",
76
76
  "effect": "4.0.0"
77
77
  },
78
78
  "scripts": {