@boxxy/contract 0.0.0-stage → 0.1.3
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/LICENSE +21 -0
- package/README.md +39 -2
- package/dist/access.d.ts +81 -0
- package/dist/boxxy-client.d.ts +3 -0
- package/dist/contract.d.ts +542 -0
- package/dist/index.d.ts +3 -0
- package/package.json +40 -4
- package/src/access.ts +98 -0
- package/src/boxxy-client.ts +5 -0
- package/src/contract.ts +518 -0
- package/src/index.ts +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 the boxxy authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>@boxxy/contract</h1>
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
<p>
|
|
5
|
+
<a href="https://www.npmjs.com/package/@boxxy/contract"><img src="https://img.shields.io/npm/v/@boxxy/contract" alt="npm version"></a>
|
|
6
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT license"></a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p>
|
|
10
|
+
<a href="../../docs/design/boxxy/README.md">Documentation</a>
|
|
11
|
+
</p>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
The oRPC contract of the boxxy API, and the table of who may call each procedure.
|
|
15
|
+
|
|
16
|
+
The server builds its router from the contract, and the CLI builds its typed client from it. The
|
|
17
|
+
package does no I/O: it holds only the procedures and their zod schemas.
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
Install the package from [npm](https://www.npmjs.com/package/@boxxy/contract) with Bun:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
bun add @boxxy/contract
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The package runs on [Bun](https://bun.sh) 1.3 or newer.
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- `contract`, the 26 procedures in the groups `item`, `relation`, `attempt`, `plan`, `runner`,
|
|
32
|
+
`outbox`, `rules` and `report`. A procedure that is an MCP tool carries its tool name and
|
|
33
|
+
description.
|
|
34
|
+
- `access`, one row for each procedure: who calls it, the actor its fact records, the MCP endpoint
|
|
35
|
+
that lists it, and the CLI command that calls it.
|
|
36
|
+
|
|
37
|
+
## Documentation
|
|
38
|
+
|
|
39
|
+
[API and auth in v1](../../docs/design/boxxy/v1-api-and-auth.md) describes the three doors, the
|
|
40
|
+
procedures and the scope of the worker token.
|
package/dist/access.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export type Caller = 'owner' | 'session' | 'hook';
|
|
2
|
+
export interface Access {
|
|
3
|
+
readonly caller: Caller;
|
|
4
|
+
readonly actor: 'boxxy:owner:local' | 'boxxy:attempt:<id>' | 'boxxy:hook:<id>' | 'none';
|
|
5
|
+
readonly tool: 'owner' | 'session' | 'none';
|
|
6
|
+
readonly cli: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const access: {
|
|
9
|
+
readonly 'item.file': Access;
|
|
10
|
+
readonly 'item.edit': Access;
|
|
11
|
+
readonly 'item.close': Access;
|
|
12
|
+
readonly 'item.retry': Access;
|
|
13
|
+
readonly 'item.wake': Access;
|
|
14
|
+
readonly 'item.note': Access;
|
|
15
|
+
readonly 'relation.add': Access;
|
|
16
|
+
readonly 'relation.remove': Access;
|
|
17
|
+
readonly 'plan.defer': Access;
|
|
18
|
+
readonly 'plan.undefer': Access;
|
|
19
|
+
readonly 'plan.expedite': Access;
|
|
20
|
+
readonly 'plan.unexpedite': Access;
|
|
21
|
+
readonly 'item.get': Access;
|
|
22
|
+
readonly 'item.list': Access;
|
|
23
|
+
readonly 'runner.status': Access;
|
|
24
|
+
readonly 'report.cost': Access;
|
|
25
|
+
readonly 'report.stageTimes': Access;
|
|
26
|
+
readonly 'attempt.current': {
|
|
27
|
+
readonly caller: 'session';
|
|
28
|
+
readonly actor: 'none';
|
|
29
|
+
readonly tool: 'session';
|
|
30
|
+
readonly cli: 'boxxy attempt current';
|
|
31
|
+
};
|
|
32
|
+
readonly 'attempt.evidence': {
|
|
33
|
+
readonly caller: 'session';
|
|
34
|
+
readonly actor: 'boxxy:attempt:<id>';
|
|
35
|
+
readonly tool: 'session';
|
|
36
|
+
readonly cli: 'boxxy attempt evidence --kind --ref [--observed]';
|
|
37
|
+
};
|
|
38
|
+
readonly 'attempt.closeOut': {
|
|
39
|
+
readonly caller: 'session';
|
|
40
|
+
readonly actor: 'boxxy:attempt:<id>';
|
|
41
|
+
readonly tool: 'session';
|
|
42
|
+
readonly cli: 'boxxy attempt close-out (JSON on stdin)';
|
|
43
|
+
};
|
|
44
|
+
readonly 'attempt.bindSession': {
|
|
45
|
+
readonly caller: 'hook';
|
|
46
|
+
readonly actor: 'boxxy:hook:<id>';
|
|
47
|
+
readonly tool: 'none';
|
|
48
|
+
readonly cli: 'boxxy hook session-start (hook payload on stdin)';
|
|
49
|
+
};
|
|
50
|
+
readonly 'attempt.recordPullRequest': {
|
|
51
|
+
readonly caller: 'hook';
|
|
52
|
+
readonly actor: 'boxxy:hook:<id>';
|
|
53
|
+
readonly tool: 'none';
|
|
54
|
+
readonly cli: 'boxxy hook post-tool-use (hook payload on stdin)';
|
|
55
|
+
};
|
|
56
|
+
readonly 'runner.pause': {
|
|
57
|
+
readonly caller: 'owner';
|
|
58
|
+
readonly actor: 'none';
|
|
59
|
+
readonly tool: 'none';
|
|
60
|
+
readonly cli: 'boxxy runner pause';
|
|
61
|
+
};
|
|
62
|
+
readonly 'runner.resume': {
|
|
63
|
+
readonly caller: 'owner';
|
|
64
|
+
readonly actor: 'none';
|
|
65
|
+
readonly tool: 'none';
|
|
66
|
+
readonly cli: 'boxxy runner resume';
|
|
67
|
+
};
|
|
68
|
+
readonly 'outbox.retry': {
|
|
69
|
+
readonly caller: 'owner';
|
|
70
|
+
readonly actor: 'none';
|
|
71
|
+
readonly tool: 'none';
|
|
72
|
+
readonly cli: 'boxxy outbox retry';
|
|
73
|
+
};
|
|
74
|
+
readonly 'rules.dryRun': {
|
|
75
|
+
readonly caller: 'owner';
|
|
76
|
+
readonly actor: 'none';
|
|
77
|
+
readonly tool: 'none';
|
|
78
|
+
readonly cli: 'boxxy rules dry-run <file>';
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export type ProcedureName = keyof typeof access;
|