@agentoryhq/runtime-contract 0.1.1

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.
@@ -0,0 +1,46 @@
1
+ import type { AlignPatch, DiscoveredAgent, MemoryIndexReportItem, SessionIndexReportItem, TranscriptSnapshot } from "@agentoryhq/shared";
2
+ /** Wire protocol version between Host and RuntimeAdapter implementations. */
3
+ export declare const ADAPTER_API_VERSION: 1;
4
+ export type AdapterCapability = "detect" | "discoverConfig" | "applyAlign" | "indexSessions" | "readTranscript" | "handoffExport";
5
+ export type AdapterManifest = {
6
+ /** Matches control-plane / shared RuntimeKind when known. */
7
+ runtime: string;
8
+ adapterApi: typeof ADAPTER_API_VERSION;
9
+ displayName: string;
10
+ capabilities: readonly AdapterCapability[];
11
+ };
12
+ export type AdapterContext = {
13
+ homeDir: string;
14
+ cwd: string;
15
+ };
16
+ export type ApplyAlignOpts = {
17
+ /** Project / install root for this runtime (Cursor: dir containing `.cursor/`). */
18
+ projectRoot: string;
19
+ patch: AlignPatch;
20
+ confirmed: boolean;
21
+ };
22
+ export type ApplyAlignResult = {
23
+ ok: boolean;
24
+ error?: string;
25
+ mcpPath: string;
26
+ skillsPath: string;
27
+ snapshotPath?: string;
28
+ };
29
+ export type AssetIndexResult = {
30
+ sessions: SessionIndexReportItem[];
31
+ memories: MemoryIndexReportItem[];
32
+ };
33
+ /**
34
+ * Per-runtime adapter. Host orchestrates; adapters own paths and formats.
35
+ * Optional methods must match declared `capabilities`.
36
+ */
37
+ export type RuntimeAdapter = {
38
+ manifest: AdapterManifest;
39
+ detect(ctx: AdapterContext): boolean;
40
+ discoverConfig?(ctx: AdapterContext): DiscoveredAgent | null;
41
+ applyAlign?(opts: ApplyAlignOpts): ApplyAlignResult;
42
+ indexSessions?(ctx: AdapterContext): AssetIndexResult;
43
+ transcriptFileForSourceKey?(sourceKey: string, homeDir?: string): string | undefined;
44
+ captureTranscriptSnapshot?(file: string, now?: Date): TranscriptSnapshot | undefined;
45
+ };
46
+ export declare function hasCapability(manifest: AdapterManifest, cap: AdapterCapability): boolean;
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ /** Wire protocol version between Host and RuntimeAdapter implementations. */
2
+ export const ADAPTER_API_VERSION = 1;
3
+ export function hasCapability(manifest, cap) {
4
+ return manifest.capabilities.includes(cap);
5
+ }
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@agentoryhq/runtime-contract",
3
+ "version": "0.1.1",
4
+ "description": "Agentory RuntimeAdapter contract (manifest + capabilities)",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "files": ["dist"],
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "build": "tsc -p tsconfig.json"
16
+ },
17
+ "dependencies": {
18
+ "@agentoryhq/shared": "*"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/tunsuy/agentory-node.git",
23
+ "directory": "packages/runtime-contract"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "engines": {
29
+ "node": ">=20"
30
+ }
31
+ }