@atcx/contract 7.5.0 → 7.6.0

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/README.md CHANGED
@@ -3,12 +3,12 @@
3
3
 
4
4
  <p>
5
5
  <a href="https://www.npmjs.com/package/@atcx/contract"><img src="https://img.shields.io/npm/v/@atcx/contract" alt="npm version"></a>
6
- <a href="https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.5.0/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT license"></a>
6
+ <a href="https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.6.0/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT license"></a>
7
7
  </p>
8
8
 
9
9
  <p>
10
- <a href="https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.5.0/docs/architecture/protocol/contract.md">The published contract</a> •
11
- <a href="https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.5.0/docs/architecture/protocol/protocol.md">The client protocol</a>
10
+ <a href="https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.6.0/docs/architecture/protocol/contract.md">The published contract</a> •
11
+ <a href="https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.6.0/docs/architecture/protocol/protocol.md">The client protocol</a>
12
12
  </p>
13
13
  </div>
14
14
 
@@ -52,9 +52,9 @@ bun add -d @opentelemetry/api
52
52
  ## Configuration
53
53
 
54
54
  `CONFIG_FILE_SCHEMA` parses the top-level keys of atc's `config.json`, and the
55
- [configuration guide](https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.5.0/docs/guides/configuration.md) describes each key.
55
+ [configuration guide](https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.6.0/docs/guides/configuration.md) describes each key.
56
56
 
57
57
  ## Documentation
58
58
 
59
- [The published contract](https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.5.0/docs/architecture/protocol/contract.md) covers what the package holds
59
+ [The published contract](https://github.com/zgeoff/atc/blob/%40zgeoff%2Fatc%407.6.0/docs/architecture/protocol/contract.md) covers what the package holds
60
60
  and how its version moves with atc's.
@@ -468,6 +468,12 @@ export declare const DAEMON_CONTRACT: {
468
468
  trustClonedWorkspace: z.ZodOptional<z.ZodBoolean>;
469
469
  scope: z.ZodOptional<z.ZodUnknown>;
470
470
  parent: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./session-id.js").SessionID, string>>>, unknown>;
471
+ atcAccess: z.ZodOptional<z.ZodArray<z.ZodEnum<{
472
+ kill: "kill";
473
+ message: "message";
474
+ read: "read";
475
+ spawn: "spawn";
476
+ }>>>;
471
477
  }, z.core.$strip>, z.ZodObject<{
472
478
  session: z.ZodObject<{
473
479
  id: z.ZodPipe<z.ZodString, z.ZodTransform<import("./session-id.js").SessionID, string>>;
@@ -0,0 +1,2 @@
1
+ export declare const GRANT_SCOPES: readonly ['read', 'message', 'spawn', 'kill'];
2
+ export type GrantScope = (typeof GRANT_SCOPES)[number];
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export * from './fleet-entry-view.js';
15
15
  export * from './fleet-event.js';
16
16
  export * from './git-probe-result.js';
17
17
  export * from './git-ref.js';
18
+ export * from './grant-scope.js';
18
19
  export * from './hello-result.js';
19
20
  export * from './light/index.js';
20
21
  export * from './menu-view.js';
package/dist/index.js CHANGED
@@ -110,7 +110,7 @@ var ANSWER_VIEW_SCHEMA = z4.object({
110
110
  complete: z4.boolean()
111
111
  });
112
112
  // packages/contract/src/contract-version.ts
113
- var CONTRACT_VERSION = "7.5.0";
113
+ var CONTRACT_VERSION = "7.6.0";
114
114
 
115
115
  // packages/contract/src/daemon-features.ts
116
116
  var DAEMON_FEATURES = ["events.read.from-start"];
@@ -644,6 +644,9 @@ var PUBLISHED_RECORD_SCHEMA = z29.object({
644
644
  // packages/contract/src/request-param-schemas.ts
645
645
  import { z as z31 } from "zod";
646
646
 
647
+ // packages/contract/src/grant-scope.ts
648
+ var GRANT_SCOPES = ["read", "message", "spawn", "kill"];
649
+
647
650
  // packages/contract/src/to-message-id.ts
648
651
  import { z as z30 } from "zod";
649
652
  var MESSAGE_ID_SCHEMA = z30.string().brand();
@@ -753,7 +756,12 @@ var REQUEST_PARAM_SCHEMAS = {
753
756
  workspace: WORKSPACE_SOURCE.optional(),
754
757
  trustClonedWorkspace: z31.boolean({ error: "session.spawn trustClonedWorkspace must be a boolean" }).optional(),
755
758
  scope: z31.unknown().optional(),
756
- parent: z31.preprocess((input) => typeof input === "string" && input !== "" ? input : undefined, z31.string().transform(toSessionID).optional())
759
+ parent: z31.preprocess((input) => typeof input === "string" && input !== "" ? input : undefined, z31.string().transform(toSessionID).optional()),
760
+ atcAccess: z31.array(z31.enum(GRANT_SCOPES, {
761
+ error: "session.spawn atcAccess takes read, message, spawn and kill"
762
+ }), {
763
+ error: "session.spawn atcAccess must be an array of scopes"
764
+ }).max(GRANT_SCOPES.length, "session.spawn atcAccess names each scope once").refine((scopes) => new Set(scopes).size === scopes.length, "session.spawn atcAccess names each scope once").optional()
757
765
  }),
758
766
  "session.kill": SESSION_DEFAULTED.extend({
759
767
  stopOnly: z31.boolean({ error: "session.kill stopOnly must be a boolean" }).optional()
@@ -1091,6 +1099,7 @@ export {
1091
1099
  FLEET_EVENT_SCHEMA,
1092
1100
  GIT_PROBE_RESULT_SCHEMA,
1093
1101
  GIT_REF_SCHEMA,
1102
+ GRANT_SCOPES,
1094
1103
  HELLO_RESULT_SCHEMA,
1095
1104
  MENU_VIEW_SCHEMA,
1096
1105
  MESSAGE_ANSWER_SCHEMA,
@@ -120,6 +120,12 @@ export declare const REQUEST_PARAM_SCHEMAS: {
120
120
  trustClonedWorkspace: z.ZodOptional<z.ZodBoolean>;
121
121
  scope: z.ZodOptional<z.ZodUnknown>;
122
122
  parent: z.ZodPreprocess<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("./session-id.js").SessionID, string>>>, unknown>;
123
+ atcAccess: z.ZodOptional<z.ZodArray<z.ZodEnum<{
124
+ kill: "kill";
125
+ message: "message";
126
+ read: "read";
127
+ spawn: "spawn";
128
+ }>>>;
123
129
  }, z.core.$strip>;
124
130
  readonly 'session.kill': z.ZodObject<{
125
131
  session: z.ZodPipe<z.ZodPreprocess<z.ZodDefault<z.ZodString>, unknown>, z.ZodTransform<import("./session-id.js").SessionID, string>>;
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "zod": "4.6.6"
19
19
  },
20
20
  "name": "@atcx/contract",
21
- "version": "7.5.0",
21
+ "version": "7.6.0",
22
22
  "description": "atc's public contract: the daemon's request contract, the event, session record, hello and config schemas, the error codes, the session env names, and the state paths",
23
23
  "homepage": "https://github.com/zgeoff/atc/tree/main/packages/contract#readme",
24
24
  "bugs": "https://github.com/zgeoff/atc/issues",