@aibolabs/plugin-protocol 0.1.8
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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/agent-icon.d.ts +5 -0
- package/dist/agent-icon.js +10 -0
- package/dist/capability.d.ts +114 -0
- package/dist/capability.js +3 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +9 -0
- package/dist/presentation-capability.d.ts +37 -0
- package/dist/presentation-capability.js +1 -0
- package/dist/presentation-controls.d.ts +160 -0
- package/dist/presentation-controls.js +1 -0
- package/dist/presentation-conversation.d.ts +281 -0
- package/dist/presentation-conversation.js +1 -0
- package/dist/presentation-git.d.ts +148 -0
- package/dist/presentation-git.js +1 -0
- package/dist/presentation-inspector.d.ts +218 -0
- package/dist/presentation-inspector.js +1 -0
- package/dist/presentation-layout.d.ts +21 -0
- package/dist/presentation-layout.js +1 -0
- package/dist/presentation-navigation.d.ts +51 -0
- package/dist/presentation-navigation.js +1 -0
- package/dist/presentation-package.d.ts +28 -0
- package/dist/presentation-package.js +1 -0
- package/dist/presentation-runtime.d.ts +60 -0
- package/dist/presentation-runtime.js +1 -0
- package/dist/presentation.d.ts +17 -0
- package/dist/presentation.js +1 -0
- package/dist/renderer.d.ts +34 -0
- package/dist/renderer.js +4 -0
- package/dist/semantic.d.ts +85 -0
- package/dist/semantic.js +2 -0
- package/dist/session.d.ts +65 -0
- package/dist/session.js +2 -0
- package/dist/settings.d.ts +50 -0
- package/dist/settings.js +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/** Versioned wire contract. JSON only; local renderer interfaces live elsewhere. */
|
|
2
|
+
export declare const SEMANTIC_SCHEMA = "aibo.semantic-view/v1";
|
|
3
|
+
export type Context = {
|
|
4
|
+
workspaceId: string | null;
|
|
5
|
+
sessionId?: string;
|
|
6
|
+
contributionId: string;
|
|
7
|
+
generation: string;
|
|
8
|
+
revision: number;
|
|
9
|
+
};
|
|
10
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
11
|
+
[key: string]: JsonValue;
|
|
12
|
+
};
|
|
13
|
+
export type ReadAction = {
|
|
14
|
+
id: 'refresh' | 'inspect' | 'open-diff' | 'back' | 'next' | 'previous';
|
|
15
|
+
label: string;
|
|
16
|
+
intent: 'refresh' | 'inspect' | 'navigate';
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type Action = ReadAction | {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
intent: 'execute';
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
input: {
|
|
25
|
+
[key: string]: JsonValue;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type ActionMessage = {
|
|
29
|
+
context: Context;
|
|
30
|
+
actionId: Action['id'];
|
|
31
|
+
itemId: string | null;
|
|
32
|
+
};
|
|
33
|
+
/** Input sent by the host to a semantic contribution's read provider. */
|
|
34
|
+
export type SemanticQuery = {
|
|
35
|
+
actionId: ReadAction['id'];
|
|
36
|
+
itemId: string | null;
|
|
37
|
+
offset: number;
|
|
38
|
+
};
|
|
39
|
+
export type Property = {
|
|
40
|
+
key: string;
|
|
41
|
+
label: string;
|
|
42
|
+
type: 'text' | 'enum';
|
|
43
|
+
values: string[];
|
|
44
|
+
};
|
|
45
|
+
export type Item = {
|
|
46
|
+
id: string;
|
|
47
|
+
values: Record<string, string>;
|
|
48
|
+
};
|
|
49
|
+
export type Collection = {
|
|
50
|
+
kind: 'collection';
|
|
51
|
+
properties: Property[];
|
|
52
|
+
items: Item[];
|
|
53
|
+
selection: string | null;
|
|
54
|
+
page: {
|
|
55
|
+
offset: number;
|
|
56
|
+
size: number;
|
|
57
|
+
total: number;
|
|
58
|
+
truncated: boolean;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export type Detail = {
|
|
62
|
+
kind: 'detail' | 'inspector' | 'settings';
|
|
63
|
+
itemId: string;
|
|
64
|
+
properties: {
|
|
65
|
+
label: string;
|
|
66
|
+
value: string;
|
|
67
|
+
}[];
|
|
68
|
+
content: string;
|
|
69
|
+
truncated: boolean;
|
|
70
|
+
};
|
|
71
|
+
export type Snapshot = {
|
|
72
|
+
schema: typeof SEMANTIC_SCHEMA | 'aibo.semantic-view/v1.1' | 'aibo.semantic-view/experimental-v1';
|
|
73
|
+
context: Context;
|
|
74
|
+
contribution: {
|
|
75
|
+
id: string;
|
|
76
|
+
extensionPoint: 'workspace.tool' | 'session.context' | 'session.action' | 'settings.page' | 'command';
|
|
77
|
+
title: string;
|
|
78
|
+
};
|
|
79
|
+
state: {
|
|
80
|
+
status: 'ready' | 'loading' | 'empty' | 'error' | 'unavailable';
|
|
81
|
+
message: string;
|
|
82
|
+
};
|
|
83
|
+
view: Collection | Detail;
|
|
84
|
+
actions: Action[];
|
|
85
|
+
};
|
package/dist/semantic.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { JsonValue } from './semantic.js';
|
|
2
|
+
/** Session identity comes from CapabilityInvocation.scope, never plugin input. */
|
|
3
|
+
export declare const SESSION_CAPABILITY_VERSION = "1.0.0";
|
|
4
|
+
export type SessionOpenInput = {
|
|
5
|
+
mode: 'create' | 'resume';
|
|
6
|
+
executionProfile: {
|
|
7
|
+
schema?: string;
|
|
8
|
+
interactionMode?: 'ask' | 'plan' | 'edit';
|
|
9
|
+
approvalPolicy?: string;
|
|
10
|
+
approvalReviewer?: string;
|
|
11
|
+
filesystemPolicy?: string;
|
|
12
|
+
commandPolicy?: string;
|
|
13
|
+
networkPolicy?: string;
|
|
14
|
+
model?: string | null;
|
|
15
|
+
reasoningEffort?: string | null;
|
|
16
|
+
};
|
|
17
|
+
recovery?: Record<string, JsonValue> | null;
|
|
18
|
+
};
|
|
19
|
+
export type SessionOpenOutput = {
|
|
20
|
+
nativeSessionId: string;
|
|
21
|
+
recovery: Record<string, JsonValue>;
|
|
22
|
+
capabilities: string[];
|
|
23
|
+
};
|
|
24
|
+
export type SessionTurnInput = {
|
|
25
|
+
text: string;
|
|
26
|
+
attachments?: Record<string, JsonValue>[];
|
|
27
|
+
};
|
|
28
|
+
export type SessionTurnOutput = {
|
|
29
|
+
status: 'completed' | 'interrupted' | 'failed';
|
|
30
|
+
recovery: Record<string, JsonValue> | null;
|
|
31
|
+
};
|
|
32
|
+
export type SessionToolResponse = {
|
|
33
|
+
requestId: string;
|
|
34
|
+
result: JsonValue;
|
|
35
|
+
error?: never;
|
|
36
|
+
} | {
|
|
37
|
+
requestId: string;
|
|
38
|
+
error: string;
|
|
39
|
+
result?: never;
|
|
40
|
+
};
|
|
41
|
+
export type SessionDomainEvent = {
|
|
42
|
+
nativeSessionId: string;
|
|
43
|
+
turnId: string | null;
|
|
44
|
+
type: string;
|
|
45
|
+
correlation: Record<string, JsonValue> | null;
|
|
46
|
+
payload: Record<string, JsonValue>;
|
|
47
|
+
};
|
|
48
|
+
/** Declarative controls offered by a session contribution, never an authority grant. */
|
|
49
|
+
export interface SessionControl {
|
|
50
|
+
id: string;
|
|
51
|
+
kind: 'permission' | 'mode';
|
|
52
|
+
label: string;
|
|
53
|
+
description: string;
|
|
54
|
+
command?: string;
|
|
55
|
+
/** Controls an approval inside a turn may switch to; the host commits the switch. */
|
|
56
|
+
transitions?: string[];
|
|
57
|
+
profile: {
|
|
58
|
+
interactionMode?: 'ask' | 'plan' | 'edit';
|
|
59
|
+
approvalPolicy?: 'never' | 'untrusted' | 'on-request' | 'trusted';
|
|
60
|
+
approvalReviewer?: 'user' | 'auto-review' | 'none';
|
|
61
|
+
filesystemPolicy?: 'read-only' | 'workspace-write' | 'danger-full-access' | 'agent-managed';
|
|
62
|
+
commandPolicy?: 'disabled' | 'approved' | 'trusted' | 'agent-managed';
|
|
63
|
+
networkPolicy?: 'disabled' | 'agent-managed';
|
|
64
|
+
};
|
|
65
|
+
}
|
package/dist/session.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { CapabilityScope } from './capability.js';
|
|
2
|
+
/** Ordinary configuration only. Credentials must not be stored in this protocol. */
|
|
3
|
+
export type AgentSettingValue = string | number | boolean;
|
|
4
|
+
export type AgentSettingField = {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
type: 'text' | 'multiline' | 'boolean' | 'number' | 'select';
|
|
9
|
+
default: AgentSettingValue;
|
|
10
|
+
options?: {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
}[];
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
maxLength?: number;
|
|
17
|
+
};
|
|
18
|
+
export type AgentSettingsDescriptor = {
|
|
19
|
+
schema: 'aibo.agent-settings/v1';
|
|
20
|
+
version: number;
|
|
21
|
+
title: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
scopes: CapabilityScope['kind'][];
|
|
24
|
+
fields: AgentSettingField[];
|
|
25
|
+
};
|
|
26
|
+
export type AgentSettingsTarget = {
|
|
27
|
+
installationId: string;
|
|
28
|
+
contributionId: string;
|
|
29
|
+
scope: CapabilityScope;
|
|
30
|
+
};
|
|
31
|
+
export type AgentSettingsSnapshot = {
|
|
32
|
+
target: AgentSettingsTarget;
|
|
33
|
+
descriptor: AgentSettingsDescriptor;
|
|
34
|
+
revision: number;
|
|
35
|
+
values: Record<string, AgentSettingValue>;
|
|
36
|
+
effectiveValues: Record<string, AgentSettingValue>;
|
|
37
|
+
inheritedValues: Record<string, AgentSettingValue>;
|
|
38
|
+
};
|
|
39
|
+
/** Replace overrides at this scope. Omitted fields inherit; {} resets the scope. */
|
|
40
|
+
export type AgentSettingsSave = AgentSettingsTarget & {
|
|
41
|
+
version: number;
|
|
42
|
+
expectedRevision: number;
|
|
43
|
+
values: Record<string, AgentSettingValue>;
|
|
44
|
+
};
|
|
45
|
+
/** Host-resolved immutable snapshot for this invocation, never caller-supplied input. */
|
|
46
|
+
export type AgentSettingsContext = {
|
|
47
|
+
schema: 'aibo.agent-settings/v1';
|
|
48
|
+
version: number;
|
|
49
|
+
values: Record<string, AgentSettingValue>;
|
|
50
|
+
};
|
package/dist/settings.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aibolabs/plugin-protocol",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/chldu2000/aibo.git",
|
|
8
|
+
"directory": "packages/plugin-protocol"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"description": "Aibo JSON semantic and presentation contracts, independent of UI frameworks",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./semantic": {
|
|
22
|
+
"types": "./dist/semantic.d.ts",
|
|
23
|
+
"import": "./dist/semantic.js"
|
|
24
|
+
},
|
|
25
|
+
"./presentation": {
|
|
26
|
+
"types": "./dist/presentation.d.ts",
|
|
27
|
+
"import": "./dist/presentation.js"
|
|
28
|
+
},
|
|
29
|
+
"./renderer": {
|
|
30
|
+
"types": "./dist/renderer.d.ts",
|
|
31
|
+
"import": "./dist/renderer.js"
|
|
32
|
+
},
|
|
33
|
+
"./settings": {
|
|
34
|
+
"types": "./dist/settings.d.ts",
|
|
35
|
+
"import": "./dist/settings.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc -p tsconfig.json"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public",
|
|
43
|
+
"registry": "https://registry.npmjs.org/"
|
|
44
|
+
}
|
|
45
|
+
}
|