@app-agents/core 0.0.0-stage → 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/dist/index.d.ts +75 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/package.json +34 -4
- package/README.md +0 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for app-agents.
|
|
3
|
+
*
|
|
4
|
+
* One app manifest describes one app, the expert agents inside it, and
|
|
5
|
+
* exactly what those agents are allowed to do. The manifest is the source of
|
|
6
|
+
* truth for the registry, the CLI, and the "what can you promise a customer"
|
|
7
|
+
* answer.
|
|
8
|
+
*/
|
|
9
|
+
export type CapabilityLevel = 'read' | 'write' | 'confirm';
|
|
10
|
+
export type ExpertStatus = 'stable' | 'beta' | 'gap';
|
|
11
|
+
export interface ExpertManifest {
|
|
12
|
+
/** Job name inside the app, e.g. `campaign_report`. */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Human label, e.g. "Campaign report". */
|
|
15
|
+
title: string;
|
|
16
|
+
/** One sentence: the decision this agent makes that a tool call cannot. */
|
|
17
|
+
job: string;
|
|
18
|
+
status: ExpertStatus;
|
|
19
|
+
/** Entry agent name exported by the package. Absent while status is `gap`. */
|
|
20
|
+
agent?: string;
|
|
21
|
+
/** action -> permission level. Nothing not listed here is reachable. */
|
|
22
|
+
capabilities: Record<string, CapabilityLevel>;
|
|
23
|
+
}
|
|
24
|
+
export interface CredentialRequirement {
|
|
25
|
+
/** Environment variable the tool reads through state.env(). */
|
|
26
|
+
env: string;
|
|
27
|
+
scopes?: string[];
|
|
28
|
+
/** What the operator has to do to produce this credential. */
|
|
29
|
+
how: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ConnectorManifest {
|
|
32
|
+
kind: 'mcp' | 'rest' | 'cli';
|
|
33
|
+
baseUrl?: string;
|
|
34
|
+
auth: 'oauth' | 'apikey' | 'none';
|
|
35
|
+
/** False means every tool in this app is read-only. */
|
|
36
|
+
writes: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface AppManifest {
|
|
39
|
+
/** URL-safe app slug. This is the registry key and the lookup handle. */
|
|
40
|
+
app: string;
|
|
41
|
+
title: string;
|
|
42
|
+
/** What people actually type: "snap", "insta", "gmail", "workspace mail". */
|
|
43
|
+
aliases: string[];
|
|
44
|
+
/** npm package name. */
|
|
45
|
+
package: string;
|
|
46
|
+
connector: ConnectorManifest;
|
|
47
|
+
credentials: CredentialRequirement[];
|
|
48
|
+
experts: ExpertManifest[];
|
|
49
|
+
/** Extra operator notes, e.g. platform review requirements. */
|
|
50
|
+
gate?: string;
|
|
51
|
+
/** Vendor terms that constrain what you may do with returned data. */
|
|
52
|
+
dataRetention?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface Registry {
|
|
55
|
+
schema: 1;
|
|
56
|
+
generatedAt: string;
|
|
57
|
+
apps: AppManifest[];
|
|
58
|
+
}
|
|
59
|
+
/** True when `query` names this app by slug, title, or alias. */
|
|
60
|
+
export declare function matchesApp(app: AppManifest, query: string): boolean;
|
|
61
|
+
/** Every app whose slug, title, alias, or expert text contains the query. */
|
|
62
|
+
export declare function searchApps(registry: Registry, query: string): AppManifest[];
|
|
63
|
+
/** Resolve an app by exact handle (slug, title, or alias). */
|
|
64
|
+
export declare function findApp(registry: Registry, query: string): AppManifest | undefined;
|
|
65
|
+
/** Flatten an app's capabilities into `expert:action = level` lines. */
|
|
66
|
+
export declare function describeCapabilities(app: AppManifest): string[];
|
|
67
|
+
/**
|
|
68
|
+
* True when nothing the app *ships* can change state.
|
|
69
|
+
*
|
|
70
|
+
* Experts with status `gap` are declarations of intent, not code, so they are
|
|
71
|
+
* excluded — otherwise an unimplemented write path would make a read-only app
|
|
72
|
+
* report itself as write-capable.
|
|
73
|
+
*/
|
|
74
|
+
export declare function isReadOnly(app: AppManifest): boolean;
|
|
75
|
+
//# sourceM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E,CAAC;IACrC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,CAAC,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,WAAW,EAAE,CAAC;CACrB;AAED,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAMnE;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,CAS3E;AAED,8DAA8D;AAC9D,wBAAgB,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAElF;AAED,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,EAAE,CAO/D;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAMpD"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for app-agents.
|
|
3
|
+
*
|
|
4
|
+
* One app manifest describes one app, the expert agents inside it, and
|
|
5
|
+
* exactly what those agents are allowed to do. The manifest is the source of
|
|
6
|
+
* truth for the registry, the CLI, and the "what can you promise a customer"
|
|
7
|
+
* answer.
|
|
8
|
+
*/
|
|
9
|
+
/** True when `query` names this app by slug, title, or alias. */
|
|
10
|
+
export function matchesApp(app, query) {
|
|
11
|
+
const q = normalize(query);
|
|
12
|
+
if (!q)
|
|
13
|
+
return false;
|
|
14
|
+
if (normalize(app.app) === q)
|
|
15
|
+
return true;
|
|
16
|
+
if (normalize(app.title) === q)
|
|
17
|
+
return true;
|
|
18
|
+
return app.aliases.some((alias) => normalize(alias) === q);
|
|
19
|
+
}
|
|
20
|
+
/** Every app whose slug, title, alias, or expert text contains the query. */
|
|
21
|
+
export function searchApps(registry, query) {
|
|
22
|
+
const q = normalize(query);
|
|
23
|
+
if (!q)
|
|
24
|
+
return registry.apps;
|
|
25
|
+
return registry.apps.filter((app) => {
|
|
26
|
+
const haystack = [app.app, app.title, ...app.aliases, ...app.experts.map((e) => `${e.id} ${e.title} ${e.job}`)]
|
|
27
|
+
.map(normalize)
|
|
28
|
+
.join(' ');
|
|
29
|
+
return haystack.includes(q);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/** Resolve an app by exact handle (slug, title, or alias). */
|
|
33
|
+
export function findApp(registry, query) {
|
|
34
|
+
return registry.apps.find((app) => matchesApp(app, query));
|
|
35
|
+
}
|
|
36
|
+
/** Flatten an app's capabilities into `expert:action = level` lines. */
|
|
37
|
+
export function describeCapabilities(app) {
|
|
38
|
+
return app.experts.flatMap((expert) => Object.entries(expert.capabilities).map(([action, level]) => `${expert.id}:${action} = ${level}${expert.status === 'gap' ? ' (planned)' : ''}`));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* True when nothing the app *ships* can change state.
|
|
42
|
+
*
|
|
43
|
+
* Experts with status `gap` are declarations of intent, not code, so they are
|
|
44
|
+
* excluded — otherwise an unimplemented write path would make a read-only app
|
|
45
|
+
* report itself as write-capable.
|
|
46
|
+
*/
|
|
47
|
+
export function isReadOnly(app) {
|
|
48
|
+
const shipped = app.experts.filter((expert) => expert.status !== 'gap');
|
|
49
|
+
if (shipped.length === 0)
|
|
50
|
+
return true;
|
|
51
|
+
return shipped.every((expert) => Object.values(expert.capabilities).every((level) => level === 'read'));
|
|
52
|
+
}
|
|
53
|
+
function normalize(value) {
|
|
54
|
+
return value.toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim();
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=index.js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AAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAChE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@app-agents/core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared manifest types and registry helpers for app agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig.json",
|
|
20
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
21
|
+
"prepublishOnly": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "^22.10.2",
|
|
25
|
+
"typescript": "^5.7.2"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/app-agents/agents.git",
|
|
30
|
+
"directory": "packages/core"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/app-agents/agents#readme",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/app-agents/agents/issues"
|
|
35
|
+
}
|
|
36
|
+
}
|
package/README.md
DELETED