@sealkeeper/schema 0.4.3 → 0.4.5
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/agent-name.d.ts +1 -1
- package/dist/agent-name.js +4 -4
- package/dist/api.d.ts +744 -27
- package/dist/api.js +232 -43
- package/dist/badge.d.ts +1 -0
- package/dist/badge.js +7 -0
- package/dist/credential.d.ts +186 -1
- package/dist/credential.js +55 -8
- package/dist/db/agents.d.ts +70 -0
- package/dist/db/agents.js +18 -0
- package/dist/db/client.d.ts +398 -0
- package/dist/db/client.js +2 -0
- package/dist/db/events.js +7 -0
- package/dist/db/index.d.ts +17 -1
- package/dist/db/index.js +5 -1
- package/dist/db/migrate.js +5 -1
- package/dist/db/migrator.d.ts +3 -1
- package/dist/db/migrator.js +8 -2
- package/dist/db/operator-identities.d.ts +211 -0
- package/dist/db/operator-identities.js +49 -0
- package/dist/db/operator-level-grants.d.ts +109 -0
- package/dist/db/operator-level-grants.js +30 -0
- package/dist/db/operator-slugs.d.ts +92 -0
- package/dist/db/operator-slugs.js +25 -0
- package/dist/db/operators.d.ts +119 -0
- package/dist/db/operators.js +30 -2
- package/dist/db/standing.d.ts +36 -0
- package/dist/db/standing.js +5 -0
- package/dist/db/task-claim-failures.d.ts +143 -0
- package/dist/db/task-claim-failures.js +37 -0
- package/dist/db/task-outcomes.d.ts +19 -0
- package/dist/db/task-outcomes.js +8 -1
- package/dist/db/tasks.d.ts +79 -0
- package/dist/db/tasks.js +19 -1
- package/dist/envelope.d.ts +3 -0
- package/dist/envelope.js +16 -11
- package/dist/goal.d.ts +149 -0
- package/dist/goal.js +171 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/moderation.d.ts +28 -0
- package/dist/moderation.js +450 -0
- package/dist/operator-domains.d.ts +104 -0
- package/dist/operator-domains.js +85 -0
- package/dist/policy.d.ts +4 -0
- package/dist/policy.js +10 -0
- package/dist/runtime.d.ts +17 -0
- package/dist/runtime.js +61 -0
- package/dist/seal-conformance.js +32 -1
- package/dist/standing.d.ts +68 -0
- package/dist/standing.js +132 -6
- package/dist/tasks.d.ts +23 -1
- package/dist/tasks.js +29 -5
- package/package.json +1 -1
package/dist/agent-name.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ export declare const AGENT_NAME_MAX = 39;
|
|
|
4
4
|
export declare const RESERVED_AGENT_NAMES: ReadonlySet<string>;
|
|
5
5
|
export declare const AgentName: z.ZodString;
|
|
6
6
|
export type AgentName = z.infer<typeof AgentName>;
|
|
7
|
-
export declare const agentHandle: (
|
|
7
|
+
export declare const agentHandle: (slug: string, name: string) => string;
|
|
8
8
|
export declare function toAgentName(text: string): string | null;
|
|
9
9
|
export declare function suggestAgentName(name: string, taken: (candidate: string) => boolean): string;
|
package/dist/agent-name.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
// An agent's name, unique per operator. Together with the operator's
|
|
3
|
-
//
|
|
2
|
+
// An agent's name, unique per operator. Together with the operator's slug
|
|
3
|
+
// it makes the handle, as in alice/claude-code. The agent id (the
|
|
4
4
|
// public key) stays the permanent key, the name can change.
|
|
5
5
|
//
|
|
6
6
|
// Lowercase letters, digits and hyphens, 2 to 39 characters, starting and
|
|
@@ -26,10 +26,10 @@ export const AgentName = z
|
|
|
26
26
|
.regex(AGENT_NAME, 'Use lowercase letters, digits and hyphens, starting and ending with a letter or digit')
|
|
27
27
|
.refine((name) => !name.includes('--'), 'No double hyphen')
|
|
28
28
|
.refine((name) => !RESERVED_AGENT_NAMES.has(name), 'This name is reserved');
|
|
29
|
-
// The handle of an agent,
|
|
29
|
+
// The handle of an agent, slug/name. The API builds it and sends it, so
|
|
30
30
|
// clients show it as they got it and never assemble it. The CLI uses this
|
|
31
31
|
// only for the handle of its own agent from its config.
|
|
32
|
-
export const agentHandle = (
|
|
32
|
+
export const agentHandle = (slug, name) => `${slug}/${name}`;
|
|
33
33
|
// A name made from free text, such as a directory name. Lowercased, every
|
|
34
34
|
// run of other characters becomes one hyphen, hyphens trimmed from the
|
|
35
35
|
// ends, cut to the maximum length. Null when nothing usable is left or the
|