@asterism-app/builtin-api 0.29.0 → 1.0.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 +6 -0
- package/docs/agents.md +8 -0
- package/examples/README.md +29 -0
- package/examples/package.json +33 -0
- package/examples/tsconfig.json +25 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -14,6 +14,12 @@ Develop against compatible SDK and builtin API packages. Development dependencie
|
|
|
14
14
|
|
|
15
15
|
Import original contracts so extensions compose with the provider's operations rather than recreate them by convention. Validate the integration in an application with the intended provider enabled.
|
|
16
16
|
|
|
17
|
+
## Build an extension artifact
|
|
18
|
+
|
|
19
|
+
Declare `@asterism-app/builtin-api` as a peer dependency so the standalone builder keeps builtin public imports external throughout the graph. The enabled builtin provider supplies their native ESM modules; a private copy cannot replace its runtime identity.
|
|
20
|
+
|
|
21
|
+
Use `@asterism-app/plugin-build` and an explicit `asterism-plugin-build` build script. Build before adding the package directory to Asterism, then restart. The build writes loaded output into `dist`; source entries remain authoring inputs under `asterism.build`. Rebuild and restart after changes, and validate the delivered package against the intended application and provider rather than treating a successful build as integration acceptance.
|
|
22
|
+
|
|
17
23
|
## Explain integration choices
|
|
18
24
|
|
|
19
25
|
The package includes domain guides and source examples. Prose explains when to submit, prepare, observe, or present work and which participant owns each decision. Types and maintained examples express the concrete contracts and composition.
|
package/docs/agents.md
CHANGED
|
@@ -8,6 +8,14 @@ Use the public Agent boundary when the work belongs in an existing Agent convers
|
|
|
8
8
|
|
|
9
9
|
Import original contracts from the domain package. Shared declaration identity lets an extension participate in existing behavior; a copied schema or an implementation import is not an equivalent integration. Depending on the public API also means depending on its enabled implementation provider.
|
|
10
10
|
|
|
11
|
+
## Build against the enabled provider
|
|
12
|
+
|
|
13
|
+
Declare `@asterism-app/builtin-api` as a peer dependency. The builder then keeps builtin API imports external in the completed artifact, including contracts, runtime helpers, and renderer exports reached through other modules of the plugin. A development dependency supplies the authoring declarations; neither declaration activates builtin.
|
|
14
|
+
|
|
15
|
+
Build explicitly with `asterism-plugin-build` before adding the package directory to Asterism, then restart. The build writes loaded output into `dist`; source entries belong in `asterism.build`. A source checkout and a distributed package use the same loading contract. Rebuilding does not replace a graph already running in the application.
|
|
16
|
+
|
|
17
|
+
Binding to the provider's native ESM exports preserves the original operation declarations and renderer services. A consumer-local copy is not a fallback when builtin is disabled or unavailable. Validate with the intended provider enabled; successful typechecking or artifact generation alone does not establish that integration.
|
|
18
|
+
|
|
11
19
|
## Make messages readable and attributable
|
|
12
20
|
|
|
13
21
|
Sender attribution explains where input came from independently of the Agent that receives it. It is not authority to access the source or a guarantee of a reply route. Preserve that distinction when bridging external systems or forwarding another Agent's message.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Build an Agent observation plugin
|
|
2
|
+
|
|
3
|
+
This directory is a complete backend-only plugin package. Its build entry is `agent-observation.ts`; the other source files illustrate separate integrations and are typechecked but are not activated by this package. The observer logs accepted input, turn endings, and committed Agent records without owning Agent execution.
|
|
4
|
+
|
|
5
|
+
## Prepare and register
|
|
6
|
+
|
|
7
|
+
The manifest pins the public packages for the target application. Run here:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install
|
|
11
|
+
npm run typecheck
|
|
12
|
+
npm run build
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Add this directory to Asterism and restart. The builtin implementation provider must be enabled. After source changes, build explicitly and restart; registering a source checkout does not enable startup compilation or live reload.
|
|
16
|
+
|
|
17
|
+
The build writes `dist/artifact.json` and the emitted files; the source entry belongs in `asterism.build`. A failed build leaves the previous `dist` in place.
|
|
18
|
+
|
|
19
|
+
## Declare the provider, not a private copy
|
|
20
|
+
|
|
21
|
+
`@asterism-app/builtin-api` is a peer dependency. The builder therefore keeps all imports from that package external, including subpaths reached through the plugin's helper modules, and the host binds them to builtin's actual exports.
|
|
22
|
+
|
|
23
|
+
Development dependencies provide declarations; they do not install or activate the running builtin implementation. A missing or unavailable provider is a loading failure, not a reason to use a consumer-local copy of its contracts. The builder also keeps SDK and other supported host imports external so shared values retain their identity.
|
|
24
|
+
|
|
25
|
+
When adapting the renderer fragment, select a renderer entry that assembles it into your plugin. Keep the builtin peer declaration: its renderer exports belong to the provider just as its backend contracts do. Private packages belong in normal `dependencies`; the backend loads them from the installed package.
|
|
26
|
+
|
|
27
|
+
## Check the delivered package
|
|
28
|
+
|
|
29
|
+
Build before packing, and inspect `npm pack --dry-run`. Include `dist`, not only these source files. Distribution must not depend on an installation script compiling the plugin. Loading in the intended application is a separate integration check from typechecking and artifact generation; it is not established merely by copying this example.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "asterism-example-agent-observation",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "asterism-plugin-build",
|
|
8
|
+
"typecheck": "tsc --noEmit"
|
|
9
|
+
},
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"@asterism-app/sdk": "*",
|
|
12
|
+
"@asterism-app/builtin-api": "*",
|
|
13
|
+
"react": "^19.3.0",
|
|
14
|
+
"zod": "^4.6.5",
|
|
15
|
+
"react-intl": "^12.1.4"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@asterism-app/sdk": "2.0.0",
|
|
19
|
+
"@asterism-app/builtin-api": "1.0.0",
|
|
20
|
+
"@asterism-app/plugin-build": "1.0.0",
|
|
21
|
+
"typescript": "^7.0.2",
|
|
22
|
+
"@types/node": "^26.6.1",
|
|
23
|
+
"@types/react": "^19.3.0",
|
|
24
|
+
"nanoid": "^6.0.2"
|
|
25
|
+
},
|
|
26
|
+
"asterism": {
|
|
27
|
+
"id": "example.agent-observation",
|
|
28
|
+
"displayName": "Example Agent observation",
|
|
29
|
+
"build": {
|
|
30
|
+
"runtime": "agent-observation.ts"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2023",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"lib": [
|
|
7
|
+
"ES2023",
|
|
8
|
+
"DOM",
|
|
9
|
+
"ESNext.Disposable"
|
|
10
|
+
],
|
|
11
|
+
"types": [
|
|
12
|
+
"node"
|
|
13
|
+
],
|
|
14
|
+
"jsx": "react-jsx",
|
|
15
|
+
"strict": true,
|
|
16
|
+
"allowImportingTsExtensions": true,
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"skipLibCheck": true,
|
|
19
|
+
"noEmit": true
|
|
20
|
+
},
|
|
21
|
+
"include": [
|
|
22
|
+
"*.ts",
|
|
23
|
+
"*.tsx"
|
|
24
|
+
]
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asterism-app/builtin-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Public domain contracts and extensions for Asterism built-in features",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Chien Zhang",
|
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
"!**/*.test.*",
|
|
42
42
|
"docs",
|
|
43
43
|
"examples",
|
|
44
|
-
"README.md"
|
|
44
|
+
"README.md",
|
|
45
|
+
"!examples/**/dist/**",
|
|
46
|
+
"!examples/dist/**"
|
|
45
47
|
]
|
|
46
48
|
}
|