@ankhorage/zora 23.3.0 → 23.4.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 23.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - c91d5d9: Update dependencies: `@ankhorage/surface`.
8
+
9
+ ## 23.4.0
10
+
11
+ ### Minor Changes
12
+
13
+ - f75cdf5: Publish canonical ZORA capability descriptors for the Ankh provider commands.
14
+
3
15
  ## 23.3.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/zora
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v23.3.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v23.4.1](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![paradox: warnings](././paradox/badges/docs.svg)
7
7
 
8
8
  Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.
9
9
 
@@ -0,0 +1,75 @@
1
+ export declare const CAPABILITIES: readonly [{
2
+ readonly id: "zora.create";
3
+ readonly owner: "@ankhorage/zora";
4
+ readonly access: readonly ["invoke"];
5
+ readonly binding: {
6
+ readonly kind: "action";
7
+ readonly bindableAs: readonly ["target"];
8
+ };
9
+ readonly label: "Materialize ZORA web component";
10
+ readonly description: "Materialize a declared ZORA component and reconcile its web runtime.";
11
+ readonly input: {
12
+ readonly schema: {
13
+ readonly type: "object";
14
+ readonly required: readonly ["component", "platform"];
15
+ readonly properties: {
16
+ readonly component: {
17
+ readonly type: "string";
18
+ };
19
+ readonly platform: {
20
+ readonly type: "string";
21
+ readonly const: "web";
22
+ };
23
+ };
24
+ readonly additionalProperties: false;
25
+ };
26
+ };
27
+ readonly output: {
28
+ readonly schema: {
29
+ readonly type: "object";
30
+ readonly required: readonly ["exitCode"];
31
+ readonly properties: {
32
+ readonly exitCode: {
33
+ readonly type: "integer";
34
+ };
35
+ };
36
+ readonly additionalProperties: false;
37
+ };
38
+ };
39
+ }, {
40
+ readonly id: "zora.sync";
41
+ readonly owner: "@ankhorage/zora";
42
+ readonly access: readonly ["invoke"];
43
+ readonly binding: {
44
+ readonly kind: "action";
45
+ readonly bindableAs: readonly ["target"];
46
+ };
47
+ readonly label: "Synchronize ZORA web components";
48
+ readonly description: "Reconcile the web runtime from the declared ZORA component set.";
49
+ readonly input: {
50
+ readonly schema: {
51
+ readonly type: "object";
52
+ readonly required: readonly ["platform"];
53
+ readonly properties: {
54
+ readonly platform: {
55
+ readonly type: "string";
56
+ readonly const: "web";
57
+ };
58
+ };
59
+ readonly additionalProperties: false;
60
+ };
61
+ };
62
+ readonly output: {
63
+ readonly schema: {
64
+ readonly type: "object";
65
+ readonly required: readonly ["exitCode"];
66
+ readonly properties: {
67
+ readonly exitCode: {
68
+ readonly type: "integer";
69
+ };
70
+ };
71
+ readonly additionalProperties: false;
72
+ };
73
+ };
74
+ }];
75
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DiB,CAAC"}
@@ -0,0 +1,62 @@
1
+ export const CAPABILITIES = [
2
+ {
3
+ id: 'zora.create',
4
+ owner: '@ankhorage/zora',
5
+ access: ['invoke'],
6
+ binding: {
7
+ kind: 'action',
8
+ bindableAs: ['target'],
9
+ },
10
+ label: 'Materialize ZORA web component',
11
+ description: 'Materialize a declared ZORA component and reconcile its web runtime.',
12
+ input: {
13
+ schema: {
14
+ type: 'object',
15
+ required: ['component', 'platform'],
16
+ properties: {
17
+ component: { type: 'string' },
18
+ platform: { type: 'string', const: 'web' },
19
+ },
20
+ additionalProperties: false,
21
+ },
22
+ },
23
+ output: {
24
+ schema: {
25
+ type: 'object',
26
+ required: ['exitCode'],
27
+ properties: { exitCode: { type: 'integer' } },
28
+ additionalProperties: false,
29
+ },
30
+ },
31
+ },
32
+ {
33
+ id: 'zora.sync',
34
+ owner: '@ankhorage/zora',
35
+ access: ['invoke'],
36
+ binding: {
37
+ kind: 'action',
38
+ bindableAs: ['target'],
39
+ },
40
+ label: 'Synchronize ZORA web components',
41
+ description: 'Reconcile the web runtime from the declared ZORA component set.',
42
+ input: {
43
+ schema: {
44
+ type: 'object',
45
+ required: ['platform'],
46
+ properties: {
47
+ platform: { type: 'string', const: 'web' },
48
+ },
49
+ additionalProperties: false,
50
+ },
51
+ },
52
+ output: {
53
+ schema: {
54
+ type: 'object',
55
+ required: ['exitCode'],
56
+ properties: { exitCode: { type: 'integer' } },
57
+ additionalProperties: false,
58
+ },
59
+ },
60
+ },
61
+ ];
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B;QACE,EAAE,EAAE,aAAa;QACjB,KAAK,EAAE,iBAAiB;QACxB,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,CAAC,QAA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BAAoB,EAAE,KAAK;aAC5B;SACF;KACF;CACuC,CAAC","sourcesContent":["import type { Capability } from '@ankhorage/contracts/capabilities';\n\nexport const CAPABILITIES = [\n {\n id: 'zora.create',\n owner: '@ankhorage/zora',\n access: ['invoke'],\n binding: {\n kind: 'action',\n bindableAs: ['target'],\n },\n label: 'Materialize ZORA web component',\n description: 'Materialize a declared ZORA component and reconcile its web runtime.',\n input: {\n schema: {\n type: 'object',\n required: ['component', 'platform'],\n properties: {\n component: { type: 'string' },\n platform: { type: 'string', const: 'web' },\n },\n additionalProperties: false,\n },\n },\n output: {\n schema: {\n type: 'object',\n required: ['exitCode'],\n properties: { exitCode: { type: 'integer' } },\n additionalProperties: false,\n },\n },\n },\n {\n id: 'zora.sync',\n owner: '@ankhorage/zora',\n access: ['invoke'],\n binding: {\n kind: 'action',\n bindableAs: ['target'],\n },\n label: 'Synchronize ZORA web components',\n description: 'Reconcile the web runtime from the declared ZORA component set.',\n input: {\n schema: {\n type: 'object',\n required: ['platform'],\n properties: {\n platform: { type: 'string', const: 'web' },\n },\n additionalProperties: false,\n },\n },\n output: {\n schema: {\n type: 'object',\n required: ['exitCode'],\n properties: { exitCode: { type: 'integer' } },\n additionalProperties: false,\n },\n },\n },\n] as const satisfies readonly Capability[];\n"]}
@@ -4,7 +4,80 @@ declare const provider: {
4
4
  id: string;
5
5
  category: string;
6
6
  version: string;
7
- capabilities: ("zora.create" | "zora.sync")[];
7
+ capabilities: readonly [{
8
+ readonly id: "zora.create";
9
+ readonly owner: "@ankhorage/zora";
10
+ readonly access: readonly ["invoke"];
11
+ readonly binding: {
12
+ readonly kind: "action";
13
+ readonly bindableAs: readonly ["target"];
14
+ };
15
+ readonly label: "Materialize ZORA web component";
16
+ readonly description: "Materialize a declared ZORA component and reconcile its web runtime.";
17
+ readonly input: {
18
+ readonly schema: {
19
+ readonly type: "object";
20
+ readonly required: readonly ["component", "platform"];
21
+ readonly properties: {
22
+ readonly component: {
23
+ readonly type: "string";
24
+ };
25
+ readonly platform: {
26
+ readonly type: "string";
27
+ readonly const: "web";
28
+ };
29
+ };
30
+ readonly additionalProperties: false;
31
+ };
32
+ };
33
+ readonly output: {
34
+ readonly schema: {
35
+ readonly type: "object";
36
+ readonly required: readonly ["exitCode"];
37
+ readonly properties: {
38
+ readonly exitCode: {
39
+ readonly type: "integer";
40
+ };
41
+ };
42
+ readonly additionalProperties: false;
43
+ };
44
+ };
45
+ }, {
46
+ readonly id: "zora.sync";
47
+ readonly owner: "@ankhorage/zora";
48
+ readonly access: readonly ["invoke"];
49
+ readonly binding: {
50
+ readonly kind: "action";
51
+ readonly bindableAs: readonly ["target"];
52
+ };
53
+ readonly label: "Synchronize ZORA web components";
54
+ readonly description: "Reconcile the web runtime from the declared ZORA component set.";
55
+ readonly input: {
56
+ readonly schema: {
57
+ readonly type: "object";
58
+ readonly required: readonly ["platform"];
59
+ readonly properties: {
60
+ readonly platform: {
61
+ readonly type: "string";
62
+ readonly const: "web";
63
+ };
64
+ };
65
+ readonly additionalProperties: false;
66
+ };
67
+ };
68
+ readonly output: {
69
+ readonly schema: {
70
+ readonly type: "object";
71
+ readonly required: readonly ["exitCode"];
72
+ readonly properties: {
73
+ readonly exitCode: {
74
+ readonly type: "integer";
75
+ };
76
+ };
77
+ readonly additionalProperties: false;
78
+ };
79
+ };
80
+ }];
8
81
  commands: ({
9
82
  readonly path: readonly ["create"];
10
83
  readonly capability: "zora.create";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAsBvC,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;CAgBiB,CAAC;AAEhC,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAavC,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBwB,CAAC;AAEvC,eAAe,QAAQ,CAAC"}
package/dist/cli/index.js CHANGED
@@ -1,25 +1,24 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { dirname, resolve } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
+ import { CAPABILITIES } from '../capabilities';
4
5
  import { create } from './commands/create';
5
6
  import { sync } from './commands/sync';
6
- const CREATE_CAPABILITY = 'zora.create';
7
- const SYNC_CAPABILITY = 'zora.sync';
8
7
  const CREATE_COMMAND = {
9
8
  path: ['create'],
10
- capability: CREATE_CAPABILITY,
9
+ capability: 'zora.create',
11
10
  summary: 'Materialize a canonical ZORA component for a target platform.',
12
11
  };
13
12
  const SYNC_COMMAND = {
14
13
  path: ['sync'],
15
- capability: SYNC_CAPABILITY,
14
+ capability: 'zora.sync',
16
15
  summary: 'Regenerate the declared ZORA web materialization.',
17
16
  };
18
17
  const provider = {
19
18
  id: '@ankhorage/zora',
20
19
  category: 'zora',
21
20
  version: readPackageVersion(),
22
- capabilities: [CREATE_CAPABILITY, SYNC_CAPABILITY],
21
+ capabilities: CAPABILITIES,
23
22
  commands: [CREATE_COMMAND, SYNC_COMMAND],
24
23
  handlers: [
25
24
  {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,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E,CAAC;IAED,OAAO,WAAW,CAAC,OAAO,CAAC;AAC7B,CAAC","sourcesContent":["import { readFileSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport type { AnkhCapabilityId, AnkhCommandProviderManifest } from '@ankhorage/contracts/cli';\n\nimport { create } from './commands/create';\nimport { sync } from './commands/sync';\n\nconst CREATE_CAPABILITY = 'zora.create' satisfies AnkhCapabilityId;\nconst SYNC_CAPABILITY = 'zora.sync' satisfies AnkhCapabilityId;\nconst CREATE_COMMAND = {\n path: ['create'],\n capability: CREATE_CAPABILITY,\n summary: 'Materialize a canonical ZORA component for a target platform.',\n} as const;\nconst SYNC_COMMAND = {\n path: ['sync'],\n capability: SYNC_CAPABILITY,\n summary: 'Regenerate the declared ZORA web materialization.',\n} as const;\n\ninterface ZoraRuntimeProvider extends AnkhCommandProviderManifest {\n readonly handlers: readonly {\n readonly path: readonly string[];\n readonly handler: typeof create | typeof sync;\n }[];\n}\n\nconst provider = {\n id: '@ankhorage/zora',\n category: 'zora',\n version: readPackageVersion(),\n capabilities: [CREATE_CAPABILITY, SYNC_CAPABILITY],\n commands: [CREATE_COMMAND, SYNC_COMMAND],\n handlers: [\n {\n path: CREATE_COMMAND.path,\n handler: create,\n },\n {\n path: SYNC_COMMAND.path,\n handler: sync,\n },\n ],\n} satisfies ZoraRuntimeProvider;\n\nexport default provider;\n\n/*** Read the installed ZORA version for the Ankh provider manifest. */\nfunction readPackageVersion(): string {\n const packageJson = JSON.parse(\n readFileSync(resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json'), 'utf8'),\n ) as { readonly version?: unknown };\n\n if (typeof packageJson.version !== 'string' || packageJson.version.trim() === '') {\n throw new Error('ZORA package.json must define a non-empty version.');\n }\n\n return packageJson.version;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CA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EAAE,CAAC;QACjF,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,WAAW,CAAC,OAAO,CAAC;AAC7B,CAAC","sourcesContent":["import { readFileSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport type { AnkhRuntimeCommandProvider } from '@ankhorage/ankh';\nimport type { Capability } from '@ankhorage/contracts/capabilities';\n\nimport { CAPABILITIES } from '../capabilities';\nimport { create } from './commands/create';\nimport { sync } from './commands/sync';\n\nconst CREATE_COMMAND = {\n path: ['create'],\n capability: 'zora.create' satisfies Capability['id'],\n summary: 'Materialize a canonical ZORA component for a target platform.',\n} as const;\nconst SYNC_COMMAND = {\n path: ['sync'],\n capability: 'zora.sync' satisfies Capability['id'],\n summary: 'Regenerate the declared ZORA web materialization.',\n} as const;\n\nconst provider = {\n id: '@ankhorage/zora',\n category: 'zora',\n version: readPackageVersion(),\n capabilities: CAPABILITIES,\n commands: [CREATE_COMMAND, SYNC_COMMAND],\n handlers: [\n {\n path: CREATE_COMMAND.path,\n handler: create,\n },\n {\n path: SYNC_COMMAND.path,\n handler: sync,\n },\n ],\n} satisfies AnkhRuntimeCommandProvider;\n\nexport default provider;\n\n/*** Read the installed ZORA version for the Ankh provider manifest. */\nfunction readPackageVersion(): string {\n const packageJson = JSON.parse(\n readFileSync(resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json'), 'utf8'),\n ) as { readonly version?: unknown };\n\n if (typeof packageJson.version !== 'string' || packageJson.version.trim() === '') {\n throw new Error('ZORA package.json must define a non-empty version.');\n }\n\n return packageJson.version;\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/zora",
3
3
  "type": "module",
4
- "version": "23.3.0",
4
+ "version": "23.4.1",
5
5
  "description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
6
6
  "homepage": "https://github.com/ankhorage/zora#readme",
7
7
  "bugs": {
@@ -40,11 +40,12 @@
40
40
  "react-native-worklets": "0.10.1"
41
41
  },
42
42
  "dependencies": {
43
+ "@ankhorage/ankh": "^0.12.0",
43
44
  "@ankhorage/color-theory": "^0.3.1",
44
- "@ankhorage/contracts": "^22.8.103",
45
+ "@ankhorage/contracts": "^24.1.0",
45
46
  "@ankhorage/game": "^0.1.2",
46
47
  "@ankhorage/runtime": "^3.0.59",
47
- "@ankhorage/surface": "^9.2.0",
48
+ "@ankhorage/surface": "^9.3.3",
48
49
  "@ankhorage/utility": "^1.9.85",
49
50
  "chess.js": "^1.4.0",
50
51
  "expo-document-picker": "~57.0.3",
@@ -88,6 +89,11 @@
88
89
  "import": "./dist/features/registry/index.js",
89
90
  "default": "./dist/features/registry/index.js"
90
91
  },
92
+ "./capabilities": {
93
+ "types": "./dist/capabilities/index.d.ts",
94
+ "import": "./dist/capabilities/index.js",
95
+ "default": "./dist/capabilities/index.js"
96
+ },
91
97
  "./theme": {
92
98
  "bun": "./src/features/theme/public.ts",
93
99
  "react-native": "./src/features/theme/public.ts",
@@ -124,7 +130,7 @@
124
130
  "version-packages": "ankhorage-changeset version"
125
131
  },
126
132
  "devDependencies": {
127
- "@ankhorage/devtools": "^2.1.13",
133
+ "@ankhorage/devtools": "^2.1.19",
128
134
  "@ankhorage/paradox": "^0.2.28",
129
135
  "@react-native-vector-icons/fontawesome": "^13.1.4",
130
136
  "@react-native-vector-icons/fontawesome5": "^13.1.4",
@@ -154,8 +160,98 @@
154
160
  "category": "zora",
155
161
  "provider": "./dist/cli/index.js",
156
162
  "capabilities": [
157
- "zora.create",
158
- "zora.sync"
163
+ {
164
+ "id": "zora.create",
165
+ "owner": "@ankhorage/zora",
166
+ "access": [
167
+ "invoke"
168
+ ],
169
+ "binding": {
170
+ "kind": "action",
171
+ "bindableAs": [
172
+ "target"
173
+ ]
174
+ },
175
+ "label": "Materialize ZORA web component",
176
+ "description": "Materialize a declared ZORA component and reconcile its web runtime.",
177
+ "input": {
178
+ "schema": {
179
+ "type": "object",
180
+ "required": [
181
+ "component",
182
+ "platform"
183
+ ],
184
+ "properties": {
185
+ "component": {
186
+ "type": "string"
187
+ },
188
+ "platform": {
189
+ "type": "string",
190
+ "const": "web"
191
+ }
192
+ },
193
+ "additionalProperties": false
194
+ }
195
+ },
196
+ "output": {
197
+ "schema": {
198
+ "type": "object",
199
+ "required": [
200
+ "exitCode"
201
+ ],
202
+ "properties": {
203
+ "exitCode": {
204
+ "type": "integer"
205
+ }
206
+ },
207
+ "additionalProperties": false
208
+ }
209
+ }
210
+ },
211
+ {
212
+ "id": "zora.sync",
213
+ "owner": "@ankhorage/zora",
214
+ "access": [
215
+ "invoke"
216
+ ],
217
+ "binding": {
218
+ "kind": "action",
219
+ "bindableAs": [
220
+ "target"
221
+ ]
222
+ },
223
+ "label": "Synchronize ZORA web components",
224
+ "description": "Reconcile the web runtime from the declared ZORA component set.",
225
+ "input": {
226
+ "schema": {
227
+ "type": "object",
228
+ "required": [
229
+ "platform"
230
+ ],
231
+ "properties": {
232
+ "platform": {
233
+ "type": "string",
234
+ "const": "web"
235
+ }
236
+ },
237
+ "additionalProperties": false
238
+ }
239
+ },
240
+ "output": {
241
+ "schema": {
242
+ "type": "object",
243
+ "required": [
244
+ "exitCode"
245
+ ],
246
+ "properties": {
247
+ "exitCode": {
248
+ "type": "integer"
249
+ }
250
+ },
251
+ "additionalProperties": false
252
+ }
253
+ }
254
+ }
159
255
  ]
160
256
  }
161
257
  }
@@ -0,0 +1,50 @@
1
+ import { readFileSync } from 'node:fs';
2
+
3
+ import { isCapability } from '@ankhorage/contracts/capabilities';
4
+ import { expect, test } from 'bun:test';
5
+
6
+ import { CAPABILITIES } from './index';
7
+
8
+ const packageCapabilities = (
9
+ JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8')) as {
10
+ readonly ankh?: { readonly capabilities?: unknown };
11
+ }
12
+ ).ankh?.capabilities;
13
+
14
+ test('publishes valid, uniquely identified canonical ZORA capabilities', () => {
15
+ expect(CAPABILITIES).toHaveLength(2);
16
+ expect(CAPABILITIES.every(isCapability)).toBe(true);
17
+ expect(new Set(CAPABILITIES.map((capability) => capability.id)).size).toBe(CAPABILITIES.length);
18
+ });
19
+
20
+ test('keeps Ankh package metadata identical to the canonical catalog', () => {
21
+ expect(Array.isArray(packageCapabilities)).toBe(true);
22
+ if (!Array.isArray(packageCapabilities)) {
23
+ throw new Error('Expected package capability descriptors.');
24
+ }
25
+ expect(packageCapabilities.every(isCapability)).toBe(true);
26
+ expect(packageCapabilities).toEqual(CAPABILITIES);
27
+ });
28
+
29
+ test('exports the catalog from the public capabilities subpath', async () => {
30
+ const capabilities = await import('@ankhorage/zora/capabilities');
31
+
32
+ expect(capabilities.CAPABILITIES).toEqual(CAPABILITIES);
33
+ });
34
+
35
+ test('preserves the executable action semantics of ZORA provider capabilities', () => {
36
+ expect(CAPABILITIES).toEqual([
37
+ expect.objectContaining({
38
+ id: 'zora.create',
39
+ owner: '@ankhorage/zora',
40
+ access: ['invoke'],
41
+ binding: { kind: 'action', bindableAs: ['target'] },
42
+ }),
43
+ expect.objectContaining({
44
+ id: 'zora.sync',
45
+ owner: '@ankhorage/zora',
46
+ access: ['invoke'],
47
+ binding: { kind: 'action', bindableAs: ['target'] },
48
+ }),
49
+ ]);
50
+ });
@@ -0,0 +1,63 @@
1
+ import type { Capability } from '@ankhorage/contracts/capabilities';
2
+
3
+ export const CAPABILITIES = [
4
+ {
5
+ id: 'zora.create',
6
+ owner: '@ankhorage/zora',
7
+ access: ['invoke'],
8
+ binding: {
9
+ kind: 'action',
10
+ bindableAs: ['target'],
11
+ },
12
+ label: 'Materialize ZORA web component',
13
+ description: 'Materialize a declared ZORA component and reconcile its web runtime.',
14
+ input: {
15
+ schema: {
16
+ type: 'object',
17
+ required: ['component', 'platform'],
18
+ properties: {
19
+ component: { type: 'string' },
20
+ platform: { type: 'string', const: 'web' },
21
+ },
22
+ additionalProperties: false,
23
+ },
24
+ },
25
+ output: {
26
+ schema: {
27
+ type: 'object',
28
+ required: ['exitCode'],
29
+ properties: { exitCode: { type: 'integer' } },
30
+ additionalProperties: false,
31
+ },
32
+ },
33
+ },
34
+ {
35
+ id: 'zora.sync',
36
+ owner: '@ankhorage/zora',
37
+ access: ['invoke'],
38
+ binding: {
39
+ kind: 'action',
40
+ bindableAs: ['target'],
41
+ },
42
+ label: 'Synchronize ZORA web components',
43
+ description: 'Reconcile the web runtime from the declared ZORA component set.',
44
+ input: {
45
+ schema: {
46
+ type: 'object',
47
+ required: ['platform'],
48
+ properties: {
49
+ platform: { type: 'string', const: 'web' },
50
+ },
51
+ additionalProperties: false,
52
+ },
53
+ },
54
+ output: {
55
+ schema: {
56
+ type: 'object',
57
+ required: ['exitCode'],
58
+ properties: { exitCode: { type: 'integer' } },
59
+ additionalProperties: false,
60
+ },
61
+ },
62
+ },
63
+ ] as const satisfies readonly Capability[];
@@ -1,11 +1,12 @@
1
1
  import { expect, test } from 'bun:test';
2
2
 
3
+ import { CAPABILITIES } from '../capabilities';
3
4
  import provider from './index';
4
5
 
5
6
  test('publishes ZORA create and sync through the Ankh provider', () => {
6
7
  expect(provider.id).toBe('@ankhorage/zora');
7
8
  expect(provider.category).toBe('zora');
8
- expect(provider.capabilities).toEqual(['zora.create', 'zora.sync']);
9
+ expect(provider.capabilities).toBe(CAPABILITIES);
9
10
  expect(provider.commands).toEqual([
10
11
  {
11
12
  path: ['create'],
@@ -22,3 +23,11 @@ test('publishes ZORA create and sync through the Ankh provider', () => {
22
23
  expect(provider.handlers[0]?.path).toEqual(['create']);
23
24
  expect(provider.handlers[1]?.path).toEqual(['sync']);
24
25
  });
26
+
27
+ test('maps every provider command to one canonical capability independent of catalog order', () => {
28
+ const commandCapabilityIds = provider.commands.map((command) => command.capability);
29
+ const capabilityIds = CAPABILITIES.map((capability) => capability.id);
30
+
31
+ expect(new Set(commandCapabilityIds).size).toBe(commandCapabilityIds.length);
32
+ expect(new Set(commandCapabilityIds)).toEqual(new Set(capabilityIds));
33
+ });
package/src/cli/index.ts CHANGED
@@ -2,36 +2,29 @@ import { readFileSync } from 'node:fs';
2
2
  import { dirname, resolve } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
 
5
- import type { AnkhCapabilityId, AnkhCommandProviderManifest } from '@ankhorage/contracts/cli';
5
+ import type { AnkhRuntimeCommandProvider } from '@ankhorage/ankh';
6
+ import type { Capability } from '@ankhorage/contracts/capabilities';
6
7
 
8
+ import { CAPABILITIES } from '../capabilities';
7
9
  import { create } from './commands/create';
8
10
  import { sync } from './commands/sync';
9
11
 
10
- const CREATE_CAPABILITY = 'zora.create' satisfies AnkhCapabilityId;
11
- const SYNC_CAPABILITY = 'zora.sync' satisfies AnkhCapabilityId;
12
12
  const CREATE_COMMAND = {
13
13
  path: ['create'],
14
- capability: CREATE_CAPABILITY,
14
+ capability: 'zora.create' satisfies Capability['id'],
15
15
  summary: 'Materialize a canonical ZORA component for a target platform.',
16
16
  } as const;
17
17
  const SYNC_COMMAND = {
18
18
  path: ['sync'],
19
- capability: SYNC_CAPABILITY,
19
+ capability: 'zora.sync' satisfies Capability['id'],
20
20
  summary: 'Regenerate the declared ZORA web materialization.',
21
21
  } as const;
22
22
 
23
- interface ZoraRuntimeProvider extends AnkhCommandProviderManifest {
24
- readonly handlers: readonly {
25
- readonly path: readonly string[];
26
- readonly handler: typeof create | typeof sync;
27
- }[];
28
- }
29
-
30
23
  const provider = {
31
24
  id: '@ankhorage/zora',
32
25
  category: 'zora',
33
26
  version: readPackageVersion(),
34
- capabilities: [CREATE_CAPABILITY, SYNC_CAPABILITY],
27
+ capabilities: CAPABILITIES,
35
28
  commands: [CREATE_COMMAND, SYNC_COMMAND],
36
29
  handlers: [
37
30
  {
@@ -43,7 +36,7 @@ const provider = {
43
36
  handler: sync,
44
37
  },
45
38
  ],
46
- } satisfies ZoraRuntimeProvider;
39
+ } satisfies AnkhRuntimeCommandProvider;
47
40
 
48
41
  export default provider;
49
42
 
@@ -9,7 +9,7 @@ describe('src ownership', () => {
9
9
  .map((entry) => entry.name)
10
10
  .sort();
11
11
 
12
- expect(directories).toEqual(['cli', 'constants', 'features', 'types']);
12
+ expect(directories).toEqual(['capabilities', 'cli', 'constants', 'features', 'types']);
13
13
  });
14
14
 
15
15
  test('does not reintroduce technical ownership roots', () => {
@@ -75,7 +75,7 @@ function Tab({
75
75
  trailing
76
76
  }) {
77
77
  const { theme } = useTheme();
78
- const { activeValue, getPanelId, getTabId, setActiveValue, setFocusedValue } = useTabsContext();
78
+ const { activeValue, getPanelId, getTabId, setActiveValue, setFocusedValue, variant } = useTabsContext();
79
79
  const pressableRef = useTabRegistration({ disabled, value });
80
80
  const selected = activeValue === value;
81
81
  const passive = interactionPolicy === "passive";
@@ -96,8 +96,12 @@ function Tab({
96
96
  px: "m",
97
97
  py: "s",
98
98
  style: resolveTabStyle({
99
+ activeBackground: theme.semantics.surface.subtle,
99
100
  borderColor: selected ? "transparent" : theme.semantics.border.default,
100
- disabled
101
+ disabled,
102
+ radius: theme.radii.s,
103
+ selected,
104
+ variant
101
105
  }),
102
106
  children: renderTabContent(children, trailing, selected)
103
107
  })
@@ -123,9 +127,21 @@ function renderTabContent(children, trailing, selected) {
123
127
  });
124
128
  }
125
129
  function resolveTabStyle({
130
+ activeBackground,
126
131
  borderColor,
127
- disabled
132
+ disabled,
133
+ radius,
134
+ selected,
135
+ variant
128
136
  }) {
137
+ if (variant === "attached") {
138
+ return {
139
+ backgroundColor: selected ? activeBackground : "transparent",
140
+ borderTopLeftRadius: selected ? radius : 0,
141
+ borderTopRightRadius: selected ? radius : 0,
142
+ opacity: disabled ? 0.64 : 1
143
+ };
144
+ }
129
145
  return { borderBottomColor: borderColor, borderBottomWidth: 2, opacity: disabled ? 0.64 : 1 };
130
146
  }
131
147
 
@@ -240,8 +256,9 @@ function TabListInner({
240
256
  // node_modules/@ankhorage/surface/src/features/tabs/adapters/inbound/TabPanel.tsx
241
257
  import { jsx as jsx6 } from "react/jsx-runtime";
242
258
  var TAB_PANEL_ROLE = "tabpanel";
243
- function TabPanel({ value, children, testID, ...layoutProps }) {
244
- const { activeValue, getPanelId, getTabId } = useTabsContext();
259
+ function TabPanel({ value, children, testID, style, ...layoutProps }) {
260
+ const { theme } = useTheme();
261
+ const { activeValue, getPanelId, getTabId, variant } = useTabsContext();
245
262
  if (activeValue !== value)
246
263
  return null;
247
264
  return /* @__PURE__ */ jsx6(View3, {
@@ -249,6 +266,10 @@ function TabPanel({ value, children, testID, ...layoutProps }) {
249
266
  accessibilityLabelledBy: getTabId(value),
250
267
  accessibilityRole: TAB_PANEL_ROLE,
251
268
  nativeID: getPanelId(value),
269
+ style: [
270
+ style,
271
+ variant === "attached" ? { backgroundColor: theme.semantics.surface.subtle } : undefined
272
+ ],
252
273
  testID,
253
274
  children
254
275
  });
@@ -285,7 +306,8 @@ function useTabsController({
285
306
  defaultValue,
286
307
  onValueChange,
287
308
  testID,
288
- value
309
+ value,
310
+ variant = "line"
289
311
  }) {
290
312
  const [activeValue, setActiveValue] = useControllableState({
291
313
  defaultValue,
@@ -319,8 +341,9 @@ function useTabsController({
319
341
  setActiveValue: (nextValue) => setActiveValue(nextValue),
320
342
  setFocusedValue,
321
343
  tabs,
322
- unregisterTab
323
- }), [activeValue, focusedValue, registerTab, setActiveValue, tabs, testID, unregisterTab]);
344
+ unregisterTab,
345
+ variant
346
+ }), [activeValue, focusedValue, registerTab, setActiveValue, tabs, testID, unregisterTab, variant]);
324
347
  }
325
348
 
326
349
  // node_modules/@ankhorage/surface/src/features/tabs/adapters/inbound/Tabs.tsx
@@ -331,9 +354,10 @@ function Tabs({
331
354
  onValueChange,
332
355
  testID,
333
356
  value,
357
+ variant,
334
358
  ...layoutProps
335
359
  }) {
336
- const contextValue = useTabsController({ defaultValue, onValueChange, testID, value });
360
+ const contextValue = useTabsController({ defaultValue, onValueChange, testID, value, variant });
337
361
  return /* @__PURE__ */ jsx8(TabsContext, {
338
362
  value: contextValue,
339
363
  children: /* @__PURE__ */ jsx8(View3, {
@@ -8,7 +8,7 @@ import {
8
8
  TabList2,
9
9
  TabPanel2,
10
10
  Tabs2
11
- } from "../../chunks/Accordion-a61amgk4.js";
11
+ } from "../../chunks/Accordion-adc7k14q.js";
12
12
  import"../../chunks/Accordion-8z7naxj2.js";
13
13
  import"../../chunks/Accordion-6zb9d92y.js";
14
14
  import"../../chunks/Accordion-mnac2z83.js";
@@ -8,7 +8,7 @@ import {
8
8
  TabList2,
9
9
  TabPanel2,
10
10
  Tabs2
11
- } from "../../chunks/Accordion-a61amgk4.js";
11
+ } from "../../chunks/Accordion-adc7k14q.js";
12
12
  import"../../chunks/Accordion-8z7naxj2.js";
13
13
  import"../../chunks/Accordion-6zb9d92y.js";
14
14
  import"../../chunks/Accordion-mnac2z83.js";
@@ -8,7 +8,7 @@ import {
8
8
  TabList2,
9
9
  TabPanel2,
10
10
  Tabs2
11
- } from "../../chunks/Accordion-a61amgk4.js";
11
+ } from "../../chunks/Accordion-adc7k14q.js";
12
12
  import"../../chunks/Accordion-8z7naxj2.js";
13
13
  import"../../chunks/Accordion-6zb9d92y.js";
14
14
  import"../../chunks/Accordion-mnac2z83.js";
@@ -8,7 +8,7 @@ import {
8
8
  TabList2,
9
9
  TabPanel2,
10
10
  Tabs2
11
- } from "../../chunks/Accordion-a61amgk4.js";
11
+ } from "../../chunks/Accordion-adc7k14q.js";
12
12
  import"../../chunks/Accordion-8z7naxj2.js";
13
13
  import"../../chunks/Accordion-6zb9d92y.js";
14
14
  import"../../chunks/Accordion-mnac2z83.js";
@@ -3189,7 +3189,7 @@
3189
3189
  "chunks/Accordion-6zb9d92y.js",
3190
3190
  "chunks/Accordion-8z7naxj2.js",
3191
3191
  "chunks/Accordion-9qvmwkxe.js",
3192
- "chunks/Accordion-a61amgk4.js",
3192
+ "chunks/Accordion-adc7k14q.js",
3193
3193
  "chunks/Accordion-fre84yaq.js",
3194
3194
  "chunks/Accordion-gkx1kszz.js",
3195
3195
  "chunks/Accordion-mnac2z83.js",
@@ -3216,7 +3216,7 @@
3216
3216
  "chunks/Accordion-6zb9d92y.js",
3217
3217
  "chunks/Accordion-8z7naxj2.js",
3218
3218
  "chunks/Accordion-9qvmwkxe.js",
3219
- "chunks/Accordion-a61amgk4.js",
3219
+ "chunks/Accordion-adc7k14q.js",
3220
3220
  "chunks/Accordion-fre84yaq.js",
3221
3221
  "chunks/Accordion-gkx1kszz.js",
3222
3222
  "chunks/Accordion-mnac2z83.js",
@@ -3243,7 +3243,7 @@
3243
3243
  "chunks/Accordion-6zb9d92y.js",
3244
3244
  "chunks/Accordion-8z7naxj2.js",
3245
3245
  "chunks/Accordion-9qvmwkxe.js",
3246
- "chunks/Accordion-a61amgk4.js",
3246
+ "chunks/Accordion-adc7k14q.js",
3247
3247
  "chunks/Accordion-fre84yaq.js",
3248
3248
  "chunks/Accordion-gkx1kszz.js",
3249
3249
  "chunks/Accordion-mnac2z83.js",
@@ -3288,7 +3288,7 @@
3288
3288
  "chunks/Accordion-6zb9d92y.js",
3289
3289
  "chunks/Accordion-8z7naxj2.js",
3290
3290
  "chunks/Accordion-9qvmwkxe.js",
3291
- "chunks/Accordion-a61amgk4.js",
3291
+ "chunks/Accordion-adc7k14q.js",
3292
3292
  "chunks/Accordion-fre84yaq.js",
3293
3293
  "chunks/Accordion-gkx1kszz.js",
3294
3294
  "chunks/Accordion-mnac2z83.js",