@chore-o-matic/catalog 0.1.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 +65 -0
- package/dist/entries/channels/whatsapp.d.ts +2 -0
- package/dist/entries/channels/whatsapp.js +25 -0
- package/dist/entries/index.d.ts +2 -0
- package/dist/entries/index.js +18 -0
- package/dist/entries/templates/index.d.ts +1 -0
- package/dist/entries/templates/index.js +5 -0
- package/dist/entries/tools/google-calendar.d.ts +3 -0
- package/dist/entries/tools/google-calendar.js +54 -0
- package/dist/entries/tools/google-sheets.d.ts +2 -0
- package/dist/entries/tools/google-sheets.js +29 -0
- package/dist/entries/tools/sendgrid.d.ts +2 -0
- package/dist/entries/tools/sendgrid.js +27 -0
- package/dist/entries/tools/webhook.d.ts +2 -0
- package/dist/entries/tools/webhook.js +28 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/resolver.d.ts +11 -0
- package/dist/resolver.js +17 -0
- package/dist/types.d.ts +48 -0
- package/dist/types.js +4 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @chore-o-matic/catalog
|
|
2
|
+
|
|
3
|
+
The capability catalog for [Chore-o-matic](https://chore-o-matic.sh). Entry manifests
|
|
4
|
+
describing tools, channels, and (future) agent templates that a chore-agent can be given.
|
|
5
|
+
|
|
6
|
+
Distributed as an npm package. Downstream components (the interview meta-agent, the
|
|
7
|
+
generator, the specification validator) depend on this package for tool discovery and
|
|
8
|
+
`use:` reference resolution.
|
|
9
|
+
|
|
10
|
+
Tool and channel implementations live in [`eve-contrib`](../../../eve-contrib/) as generic
|
|
11
|
+
`@chore-o-matic/eve-*` eve packages. This catalog adds chore-o-matic-specific metadata:
|
|
12
|
+
house-voice descriptions, approval defaults, connection slot definitions, and config
|
|
13
|
+
schemas.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @chore-o-matic/catalog
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Use
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { resolveUse, entriesByKind, allEntries } from "@chore-o-matic/catalog";
|
|
25
|
+
|
|
26
|
+
// Resolve a spec's `use:` reference to a catalog entry.
|
|
27
|
+
const entry = resolveUse("google-calendar.read");
|
|
28
|
+
|
|
29
|
+
// Get all tool entries (grounds the interview meta-agent).
|
|
30
|
+
const tools = entriesByKind("tool");
|
|
31
|
+
|
|
32
|
+
// Get all entries (tools + channels + future templates).
|
|
33
|
+
const everything = allEntries();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Entry ids
|
|
37
|
+
|
|
38
|
+
Ids are dotted, human-readable, and stable across package renames:
|
|
39
|
+
|
|
40
|
+
- `google-calendar.read`
|
|
41
|
+
- `google-calendar.create-event`
|
|
42
|
+
- `sendgrid.send-email`
|
|
43
|
+
- `google-sheets.append-row`
|
|
44
|
+
- `webhook.send`
|
|
45
|
+
- `whatsapp`
|
|
46
|
+
|
|
47
|
+
The spec's `use:` field holds the id. The resolver maps it to the implementation package
|
|
48
|
+
and member.
|
|
49
|
+
|
|
50
|
+
## Adding a capability
|
|
51
|
+
|
|
52
|
+
1. Publish an `@chore-o-matic/eve-*` package in `eve-contrib` with the tool/channel factory.
|
|
53
|
+
2. Add an entry manifest in `src/entries/`.
|
|
54
|
+
3. Publish a new version of this package.
|
|
55
|
+
|
|
56
|
+
No downstream component changes required — the interview and generator read entries
|
|
57
|
+
dynamically.
|
|
58
|
+
|
|
59
|
+
## Develop
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npm run build # tsc -> dist/
|
|
63
|
+
npm run typecheck
|
|
64
|
+
npm test # hermetic unit tests
|
|
65
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const whatsapp = {
|
|
2
|
+
id: "whatsapp",
|
|
3
|
+
kind: "channel",
|
|
4
|
+
description: "Talk to the agent over WhatsApp. Clients message in, the agent replies back.",
|
|
5
|
+
visibility: "public",
|
|
6
|
+
approvalDefault: false,
|
|
7
|
+
source: {
|
|
8
|
+
type: "package",
|
|
9
|
+
package: "@chore-o-matic/eve-whatsapp",
|
|
10
|
+
member: "whatsappChannel",
|
|
11
|
+
},
|
|
12
|
+
connectionSlots: [
|
|
13
|
+
{
|
|
14
|
+
slot: "whatsapp",
|
|
15
|
+
provider: "meta",
|
|
16
|
+
authMethod: "static-token",
|
|
17
|
+
envVars: [
|
|
18
|
+
{ name: "WHATSAPP_ACCESS_TOKEN", description: "Permanent system-user token (outbound sends)" },
|
|
19
|
+
{ name: "WHATSAPP_PHONE_NUMBER_ID", description: "Business phone number id (outbound endpoint)" },
|
|
20
|
+
{ name: "WHATSAPP_APP_SECRET", description: "Meta app secret for webhook signature verification" },
|
|
21
|
+
{ name: "WHATSAPP_VERIFY_TOKEN", description: "Webhook subscription handshake token" },
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { googleCalendarRead, googleCalendarCreateEvent } from "./tools/google-calendar.js";
|
|
2
|
+
import { googleSheetsAppendRow } from "./tools/google-sheets.js";
|
|
3
|
+
import { sendgridSendEmail } from "./tools/sendgrid.js";
|
|
4
|
+
import { webhookSend } from "./tools/webhook.js";
|
|
5
|
+
import { whatsapp } from "./channels/whatsapp.js";
|
|
6
|
+
import { templates } from "./templates/index.js";
|
|
7
|
+
export const entries = [
|
|
8
|
+
// Tools
|
|
9
|
+
googleCalendarRead,
|
|
10
|
+
googleCalendarCreateEvent,
|
|
11
|
+
googleSheetsAppendRow,
|
|
12
|
+
sendgridSendEmail,
|
|
13
|
+
webhookSend,
|
|
14
|
+
// Channels
|
|
15
|
+
whatsapp,
|
|
16
|
+
// Agent templates (future)
|
|
17
|
+
...templates,
|
|
18
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const templates: never[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Agent template entries — placeholder for future use.
|
|
2
|
+
// Agent templates will describe reusable agent configurations that the generator
|
|
3
|
+
// can use as starting points. The entry type will be "agent-template" with its own
|
|
4
|
+
// source shape. Empty array for now; exported to keep the barrel stable.
|
|
5
|
+
export const templates = [];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export const googleCalendarRead = {
|
|
2
|
+
id: "google-calendar.read",
|
|
3
|
+
kind: "tool",
|
|
4
|
+
description: "Read upcoming events from a Google Calendar. Shows what's on the schedule.",
|
|
5
|
+
visibility: "public",
|
|
6
|
+
approvalDefault: false,
|
|
7
|
+
source: {
|
|
8
|
+
type: "package",
|
|
9
|
+
package: "@chore-o-matic/eve-gcal",
|
|
10
|
+
member: "readCalendar",
|
|
11
|
+
},
|
|
12
|
+
connectionSlots: [
|
|
13
|
+
{
|
|
14
|
+
slot: "google",
|
|
15
|
+
provider: "google",
|
|
16
|
+
authMethod: "oauth",
|
|
17
|
+
scopes: ["calendar.events.readonly"],
|
|
18
|
+
envVars: [{ name: "GOOGLE_ACCESS_TOKEN", description: "Google OAuth access token" }],
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
configSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
calendar: { type: "string", description: "Calendar ID. Defaults to 'primary'." },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
export const googleCalendarCreateEvent = {
|
|
29
|
+
id: "google-calendar.create-event",
|
|
30
|
+
kind: "tool",
|
|
31
|
+
description: "Create a new event on a Google Calendar. Adds to the schedule.",
|
|
32
|
+
visibility: "public",
|
|
33
|
+
approvalDefault: true,
|
|
34
|
+
source: {
|
|
35
|
+
type: "package",
|
|
36
|
+
package: "@chore-o-matic/eve-gcal",
|
|
37
|
+
member: "createEvent",
|
|
38
|
+
},
|
|
39
|
+
connectionSlots: [
|
|
40
|
+
{
|
|
41
|
+
slot: "google",
|
|
42
|
+
provider: "google",
|
|
43
|
+
authMethod: "oauth",
|
|
44
|
+
scopes: ["calendar.events"],
|
|
45
|
+
envVars: [{ name: "GOOGLE_ACCESS_TOKEN", description: "Google OAuth access token" }],
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
configSchema: {
|
|
49
|
+
type: "object",
|
|
50
|
+
properties: {
|
|
51
|
+
calendar: { type: "string", description: "Calendar ID. Defaults to 'primary'." },
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const googleSheetsAppendRow = {
|
|
2
|
+
id: "google-sheets.append-row",
|
|
3
|
+
kind: "tool",
|
|
4
|
+
description: "Append a row to a Google Sheets spreadsheet. Records data at the bottom of a sheet.",
|
|
5
|
+
visibility: "public",
|
|
6
|
+
approvalDefault: false,
|
|
7
|
+
source: {
|
|
8
|
+
type: "package",
|
|
9
|
+
package: "@chore-o-matic/eve-sheets",
|
|
10
|
+
member: "appendRow",
|
|
11
|
+
},
|
|
12
|
+
connectionSlots: [
|
|
13
|
+
{
|
|
14
|
+
slot: "google",
|
|
15
|
+
provider: "google",
|
|
16
|
+
authMethod: "oauth",
|
|
17
|
+
scopes: ["spreadsheets"],
|
|
18
|
+
envVars: [{ name: "GOOGLE_ACCESS_TOKEN", description: "Google OAuth access token" }],
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
configSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
spreadsheetId: { type: "string", description: "The spreadsheet ID." },
|
|
25
|
+
sheetName: { type: "string", description: "The sheet/tab name. Defaults to 'Sheet1'." },
|
|
26
|
+
},
|
|
27
|
+
required: ["spreadsheetId"],
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const sendgridSendEmail = {
|
|
2
|
+
id: "sendgrid.send-email",
|
|
3
|
+
kind: "tool",
|
|
4
|
+
description: "Send an email through SendGrid. Delivers a message to a recipient.",
|
|
5
|
+
visibility: "public",
|
|
6
|
+
approvalDefault: true,
|
|
7
|
+
source: {
|
|
8
|
+
type: "package",
|
|
9
|
+
package: "@chore-o-matic/eve-sendgrid",
|
|
10
|
+
member: "sendEmail",
|
|
11
|
+
},
|
|
12
|
+
connectionSlots: [
|
|
13
|
+
{
|
|
14
|
+
slot: "sendgrid",
|
|
15
|
+
provider: "sendgrid",
|
|
16
|
+
authMethod: "api-key",
|
|
17
|
+
envVars: [{ name: "SENDGRID_API_KEY", description: "SendGrid API key" }],
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
configSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
fromEmail: { type: "string", description: "Sender email address." },
|
|
24
|
+
fromName: { type: "string", description: "Sender display name." },
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const webhookSend = {
|
|
2
|
+
id: "webhook.send",
|
|
3
|
+
kind: "tool",
|
|
4
|
+
description: "Send an HTTP POST to a webhook URL. Notifies an external service.",
|
|
5
|
+
visibility: "public",
|
|
6
|
+
approvalDefault: false,
|
|
7
|
+
source: {
|
|
8
|
+
type: "package",
|
|
9
|
+
package: "@chore-o-matic/eve-webhook",
|
|
10
|
+
member: "sendWebhook",
|
|
11
|
+
},
|
|
12
|
+
connectionSlots: [
|
|
13
|
+
{
|
|
14
|
+
slot: "webhook",
|
|
15
|
+
provider: "webhook",
|
|
16
|
+
authMethod: "webhook-secret",
|
|
17
|
+
envVars: [
|
|
18
|
+
{ name: "WEBHOOK_URL", description: "The webhook endpoint URL (contains the secret)." },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
configSchema: {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {
|
|
25
|
+
headers: { type: "object", description: "Additional HTTP headers." },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { resolveUse, entriesByKind, allEntries } from "./resolver.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CatalogEntry, EntryKind } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a spec's `use:` reference to a catalog entry.
|
|
4
|
+
* Returns `undefined` when the id is not in the catalog (a dangling reference
|
|
5
|
+
* downstream means a spec goes serviceable, not a crash — §7 Validity).
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveUse(id: string): CatalogEntry | undefined;
|
|
8
|
+
/** All entries of a given kind. Used by the interview meta-agent to ground capability honesty. */
|
|
9
|
+
export declare function entriesByKind(kind: EntryKind): CatalogEntry[];
|
|
10
|
+
/** All catalog entries (tools + channels + future templates). */
|
|
11
|
+
export declare function allEntries(): readonly CatalogEntry[];
|
package/dist/resolver.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { entries } from "./entries/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a spec's `use:` reference to a catalog entry.
|
|
4
|
+
* Returns `undefined` when the id is not in the catalog (a dangling reference
|
|
5
|
+
* downstream means a spec goes serviceable, not a crash — §7 Validity).
|
|
6
|
+
*/
|
|
7
|
+
export function resolveUse(id) {
|
|
8
|
+
return entries.find((e) => e.id === id);
|
|
9
|
+
}
|
|
10
|
+
/** All entries of a given kind. Used by the interview meta-agent to ground capability honesty. */
|
|
11
|
+
export function entriesByKind(kind) {
|
|
12
|
+
return entries.filter((e) => e.kind === kind);
|
|
13
|
+
}
|
|
14
|
+
/** All catalog entries (tools + channels + future templates). */
|
|
15
|
+
export function allEntries() {
|
|
16
|
+
return entries;
|
|
17
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type CatalogEntry = ToolEntry | ChannelEntry;
|
|
2
|
+
export type EntryKind = "tool" | "channel";
|
|
3
|
+
export interface BaseEntry {
|
|
4
|
+
/** Dotted, human-readable, stable across package renames. e.g. "google-calendar.read". */
|
|
5
|
+
id: string;
|
|
6
|
+
kind: EntryKind;
|
|
7
|
+
/** House-voice description. Appears in the catalog-first opening and in the meta-agent's mouth. */
|
|
8
|
+
description: string;
|
|
9
|
+
/** "public" for catalog entries, "account" for studio-private entries (FR-23/24). */
|
|
10
|
+
visibility: "public" | "account";
|
|
11
|
+
/** Whether the tool/channel requires approval by default (NFR-6: least privilege). */
|
|
12
|
+
approvalDefault: boolean;
|
|
13
|
+
/** Credential requirements. The spec names slots; this context defines what each slot needs. */
|
|
14
|
+
connectionSlots: ConnectionSlot[];
|
|
15
|
+
/** Optional config schema (JSON Schema) for tool/channel configuration in the spec. */
|
|
16
|
+
configSchema?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface ToolEntry extends BaseEntry {
|
|
19
|
+
kind: "tool";
|
|
20
|
+
source: PackageSource;
|
|
21
|
+
}
|
|
22
|
+
export interface ChannelEntry extends BaseEntry {
|
|
23
|
+
kind: "channel";
|
|
24
|
+
source: PackageSource;
|
|
25
|
+
}
|
|
26
|
+
export interface PackageSource {
|
|
27
|
+
type: "package";
|
|
28
|
+
/** npm package name, e.g. "@chore-o-matic/eve-gcal". */
|
|
29
|
+
package: string;
|
|
30
|
+
/** Exported member name, e.g. "readCalendar", "whatsappChannel". */
|
|
31
|
+
member: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ConnectionSlot {
|
|
34
|
+
/** Slot name, e.g. "google", "sendgrid", "whatsapp". */
|
|
35
|
+
slot: string;
|
|
36
|
+
/** Provider identifier, e.g. "google", "meta", "sendgrid". */
|
|
37
|
+
provider: string;
|
|
38
|
+
authMethod: AuthMethod;
|
|
39
|
+
/** OAuth scopes when authMethod is "oauth". */
|
|
40
|
+
scopes?: string[];
|
|
41
|
+
/** Environment variables the deployment needs for this slot. */
|
|
42
|
+
envVars: EnvVar[];
|
|
43
|
+
}
|
|
44
|
+
export type AuthMethod = "oauth" | "api-key" | "static-token" | "webhook-secret" | "none";
|
|
45
|
+
export interface EnvVar {
|
|
46
|
+
name: string;
|
|
47
|
+
description: string;
|
|
48
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Catalog entry types. Each entry describes a capability a chore-agent can be given.
|
|
2
|
+
// Implementations live in eve-contrib as @chore-o-matic/eve-* packages; this package
|
|
3
|
+
// adds chore-o-matic-specific metadata (house voice, approval defaults, connection slots).
|
|
4
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chore-o-matic/catalog",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Capability catalog for Chore-o-matic — tool, channel, and agent template entries.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"chore-o-matic",
|
|
9
|
+
"catalog",
|
|
10
|
+
"eve",
|
|
11
|
+
"agent"
|
|
12
|
+
],
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc -p tsconfig.json",
|
|
26
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
27
|
+
"test": "node --test",
|
|
28
|
+
"prepare": "npm run build"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=20"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^26.1.0",
|
|
38
|
+
"typescript": "^6.0.3"
|
|
39
|
+
}
|
|
40
|
+
}
|