Skip to content

Commit e8d5fb2

Browse files
committed
Merge origin/main into chip/orchestration-demo
Brings the branch onto the same kernel packages as main, now that #1007 and #1009 have landed. Superseded local drafts resolved to main's reviewed versions; kept the demo-only interface schema variant.
2 parents 8e4b9bd + e4f7495 commit e8d5fb2

141 files changed

Lines changed: 10394 additions & 473 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/claude.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
actions: read # Required for Claude to read CI results on PRs
2727
steps:
2828
- name: Checkout repository
29-
uses: actions/checkout@v6
29+
uses: actions/checkout@v7
3030
with:
3131
fetch-depth: 1
3232

.github/workflows/coverage-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
pull-requests: write
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v6
14+
uses: actions/checkout@v7
1515

1616
- name: Download coverage artifact
1717
uses: actions/download-artifact@v8

.github/workflows/dependabot-dedupe.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
if: ${{ github.actor == 'dependabot[bot]' }}
1515
steps:
1616
- name: Check out repo
17-
uses: actions/checkout@v6
17+
uses: actions/checkout@v7
1818
with:
1919
ref: ${{ github.head_ref }}
2020
fetch-depth: 0
@@ -24,13 +24,13 @@ jobs:
2424
git config user.email "actions@github.com"
2525
2626
- name: Set up Node
27-
uses: actions/setup-node@v6
27+
uses: actions/setup-node@v7
2828
with:
2929
node-version: 24
3030
- name: Install Yarn
3131
run: corepack enable
3232
- name: Restore Yarn cache
33-
uses: actions/setup-node@v6
33+
uses: actions/setup-node@v7
3434
with:
3535
node-version: 24
3636
cache: yarn

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
skip-merge-queue: ${{ steps.check-skip-merge-queue.outputs.up-to-date }}
1919
steps:
2020
- name: Checkout repository
21-
uses: actions/checkout@v6
21+
uses: actions/checkout@v7
2222
if: github.event_name == 'merge_group'
2323

2424
- name: Check pull request merge queue status
@@ -34,7 +34,7 @@ jobs:
3434
has-ci: ${{ steps.changes.outputs.has-ci }}
3535
has-lint-targets: ${{ steps.changes.outputs.has-lint-targets }}
3636
steps:
37-
- uses: actions/checkout@v6
37+
- uses: actions/checkout@v7
3838
with:
3939
fetch-depth: 0
4040
- name: Detect change categories
@@ -121,7 +121,7 @@ jobs:
121121
(github.event_name != 'merge_group' || needs.check-skip-merge-queue.outputs.skip-merge-queue != 'true')
122122
&& (needs.detect-changes.outputs.has-ci == 'true' || needs.detect-changes.outputs.has-code == 'true')
123123
steps:
124-
- uses: actions/checkout@v6
124+
- uses: actions/checkout@v7
125125
- name: Download actionlint
126126
id: download-actionlint
127127
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash) 1.6.25
@@ -211,7 +211,7 @@ jobs:
211211
IS_RELEASE: ${{ steps.is-release.outputs.IS_RELEASE }}
212212
steps:
213213
- id: is-release
214-
uses: MetaMask/action-is-release@61ff8882da996cb68cdbc8583dc53956a1ffdd8b
214+
uses: MetaMask/action-is-release@v2
215215
with:
216216
commit-starts-with: 'Release [version],Release v[version],Release/[version],Release/v[version],Release `[version]`'
217217

.github/workflows/publish-preview.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
outputs:
1313
IS_FORK: ${{ steps.is-fork.outputs.IS_FORK }}
1414
steps:
15-
- uses: actions/checkout@v6
15+
- uses: actions/checkout@v7
1616
- name: Determine whether this PR is from a fork
1717
id: is-fork
1818
run: echo "IS_FORK=$(gh pr view --json isCrossRepository --jq '.isCrossRepository' "${PR_NUMBER}" )" >> "$GITHUB_OUTPUT"
@@ -29,7 +29,7 @@ jobs:
2929
if: ${{ needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
3030
runs-on: ubuntu-latest
3131
steps:
32-
- uses: actions/checkout@v6
32+
- uses: actions/checkout@v7
3333
- name: Check out pull request
3434
run: gh pr checkout "${PR_NUMBER}"
3535
env:

.github/workflows/publish-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
with:
4848
name: publish-release-artifacts-${{ github.sha }}
4949
- name: Dry run publish to NPM
50-
uses: MetaMask/action-npm-publish@v5
50+
uses: MetaMask/action-npm-publish@v6
5151
with:
5252
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
5353
subteam: S042S7RE4AE # @metamask-npm-publishers
@@ -68,6 +68,6 @@ jobs:
6868
with:
6969
name: publish-release-artifacts-${{ github.sha }}
7070
- name: Publish to NPM
71-
uses: MetaMask/action-npm-publish@v5
71+
uses: MetaMask/action-npm-publish@v6
7272
with:
7373
npm-token: ${{ secrets.NPM_TOKEN }}

packages/kernel-agents/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- The built-in capabilities (`math`, `end`, `examples`) are now pattern-guarded discoverable exos authored with the `described*()` combinators, so their argument shapes are enforced by the exo's interface guard at invocation rather than only described in the prompt ([#959](https://github.com/MetaMask/ocap-kernel/pull/959))
13+
14+
### Removed
15+
16+
- **BREAKING:** Remove the `capability()` authoring helper from `@ocap/kernel-agents/capabilities/capability`. Author capabilities as pattern-guarded discoverable exos (via the `described*()` combinators in `@metamask/kernel-utils`) and convert them with `discover`, so the exo's interface guard is the sole argument enforcer ([#960](https://github.com/MetaMask/ocap-kernel/pull/960))
17+
1018
[Unreleased]: https://github.com/MetaMask/ocap-kernel/

packages/kernel-agents/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@
196196
"@metamask/kernel-errors": "workspace:^",
197197
"@metamask/kernel-utils": "workspace:^",
198198
"@metamask/logger": "workspace:^",
199-
"@metamask/superstruct": "^3.2.1",
200199
"@ocap/kernel-language-model-service": "workspace:^",
201200
"partial-json": "^0.1.7",
202201
"ses": "^1.14.0"
Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
1+
import { S } from '@metamask/kernel-utils';
12
import { describe, it, expect } from 'vitest';
23

3-
import { capability } from './capability.ts';
4+
import { extractCapabilities, extractCapabilitySchemas } from './capability.ts';
5+
import { makeMethodCapability } from '../../test/make-method-capability.ts';
46

5-
describe('capability', () => {
6-
it('creates a capability with func and schema', () => {
7-
const testCapability = capability(async () => Promise.resolve('test'), {
8-
description: 'a test capability',
9-
args: {},
10-
});
11-
expect(testCapability.func).toBeInstanceOf(Function);
12-
expect(testCapability.schema).toStrictEqual({
13-
description: 'a test capability',
7+
describe('capability extraction', () => {
8+
const makeRecord = () => ({
9+
ping: makeMethodCapability(
10+
'Server',
11+
'ping',
12+
async () => 'pong',
13+
S.method('Ping', [], S.string()),
14+
),
15+
});
16+
17+
it('extractCapabilities returns the functions keyed by name', async () => {
18+
const funcs = extractCapabilities(makeRecord());
19+
expect(Object.keys(funcs)).toStrictEqual(['ping']);
20+
expect(await funcs.ping(undefined as never)).toBe('pong');
21+
});
22+
23+
it('extractCapabilitySchemas returns the schemas keyed by name', () => {
24+
const schemas = extractCapabilitySchemas(makeRecord());
25+
expect(schemas.ping).toStrictEqual({
26+
description: 'Ping',
1427
args: {},
28+
required: [],
29+
returns: { type: 'string' },
1530
});
1631
});
1732
});

packages/kernel-agents/src/capabilities/capability.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
1-
import type { ExtractRecordKeys } from '../types/capability.ts';
2-
import type {
3-
CapabilityRecord,
4-
CapabilitySpec,
5-
CapabilitySchema,
6-
Capability,
7-
} from '../types.ts';
1+
import type { MethodSchema } from '@metamask/kernel-utils';
82

9-
/**
10-
* Create a capability specification.
11-
*
12-
* @param func - The function to create a capability specification for
13-
* @param schema - The schema for the capability
14-
* @returns A capability specification
15-
*/
16-
export const capability = <Args extends Record<string, unknown>, Return = null>(
17-
func: Capability<Args, Return>,
18-
schema: CapabilitySchema<ExtractRecordKeys<Args>>,
19-
): CapabilitySpec<Args, Return> => ({ func, schema });
3+
import type { CapabilityRecord, CapabilitySpec } from '../types.ts';
204

21-
type SchemaEntry = [string, { schema: CapabilitySchema<string> }];
5+
type SchemaEntry = [string, { schema: MethodSchema }];
226
/**
237
* Extract only the serializable schemas from the capabilities
248
*

0 commit comments

Comments
 (0)