@haaaiawd/second-nature 0.1.43 → 0.1.51
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/openclaw.plugin.json +29 -29
- package/package.json +55 -55
- package/runtime/cli/commands/index.js +325 -325
- package/runtime/cli/ops/heartbeat-surface.d.ts +84 -75
- package/runtime/cli/ops/heartbeat-surface.js +100 -97
- package/runtime/cli/ops/ops-router.js +1482 -1454
- package/runtime/cli/ops/workspace-heartbeat-runner.d.ts +85 -76
- package/runtime/cli/ops/workspace-heartbeat-runner.js +242 -236
- package/runtime/connectors/base/contract.d.ts +111 -111
- package/runtime/connectors/base/failure-taxonomy.d.ts +13 -13
- package/runtime/connectors/base/failure-taxonomy.js +186 -186
- package/runtime/connectors/base/map-life-evidence.js +137 -137
- package/runtime/connectors/base/policy-layer.js +202 -202
- package/runtime/connectors/manifest/manifest-schema.d.ts +152 -152
- package/runtime/connectors/manifest/manifest-schema.js +54 -54
- package/runtime/connectors/services/connector-executor-adapter.d.ts +20 -20
- package/runtime/connectors/services/connector-executor-adapter.js +645 -645
- package/runtime/core/second-nature/heartbeat/goal-lifecycle-policy.d.ts +24 -37
- package/runtime/core/second-nature/heartbeat/goal-lifecycle-policy.js +61 -61
- package/runtime/core/second-nature/heartbeat/heartbeat-loop.d.ts +97 -88
- package/runtime/core/second-nature/heartbeat/heartbeat-loop.js +397 -329
- package/runtime/core/second-nature/orchestrator/platform-capability-router.js +149 -131
|
@@ -1,152 +1,152 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const connectorRunnerKindSchema: z.ZodEnum<{
|
|
3
|
-
skill: "skill";
|
|
4
|
-
browser: "browser";
|
|
5
|
-
declarative_http: "declarative_http";
|
|
6
|
-
declarative_a2a: "declarative_a2a";
|
|
7
|
-
declarative_mcp: "declarative_mcp";
|
|
8
|
-
cli_descriptor: "cli_descriptor";
|
|
9
|
-
custom_adapter: "custom_adapter";
|
|
10
|
-
scriptable_node: "scriptable_node";
|
|
11
|
-
}>;
|
|
12
|
-
export type ConnectorRunnerKind = z.infer<typeof connectorRunnerKindSchema>;
|
|
13
|
-
export declare const connectorTrustStatusSchema: z.ZodEnum<{
|
|
14
|
-
blocked: "blocked";
|
|
15
|
-
declarative_trusted: "declarative_trusted";
|
|
16
|
-
custom_adapter_pending_trust: "custom_adapter_pending_trust";
|
|
17
|
-
trusted_custom_adapter: "trusted_custom_adapter";
|
|
18
|
-
}>;
|
|
19
|
-
export type ConnectorTrustStatus = z.infer<typeof connectorTrustStatusSchema>;
|
|
20
|
-
export declare const capabilityDeclarationSchema: z.ZodObject<{
|
|
21
|
-
id: z.ZodString;
|
|
22
|
-
channel: z.ZodOptional<z.ZodString>;
|
|
23
|
-
description: z.ZodOptional<z.ZodString>;
|
|
24
|
-
sourceRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
-
observedCount: z.ZodOptional<z.ZodNumber>;
|
|
26
|
-
}, z.core.$strip>;
|
|
27
|
-
export type ConnectorCapabilityDeclaration = z.infer<typeof capabilityDeclarationSchema>;
|
|
28
|
-
export declare const runnerDeclarationSchema: z.ZodObject<{
|
|
29
|
-
kind: z.ZodEnum<{
|
|
30
|
-
skill: "skill";
|
|
31
|
-
browser: "browser";
|
|
32
|
-
declarative_http: "declarative_http";
|
|
33
|
-
declarative_a2a: "declarative_a2a";
|
|
34
|
-
declarative_mcp: "declarative_mcp";
|
|
35
|
-
cli_descriptor: "cli_descriptor";
|
|
36
|
-
custom_adapter: "custom_adapter";
|
|
37
|
-
scriptable_node: "scriptable_node";
|
|
38
|
-
}>;
|
|
39
|
-
entrypoint: z.ZodOptional<z.ZodString>;
|
|
40
|
-
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
41
|
-
}, z.core.$strip>;
|
|
42
|
-
export type ConnectorRunnerDeclaration = z.infer<typeof runnerDeclarationSchema>;
|
|
43
|
-
export declare const credentialRequirementSchema: z.ZodObject<{
|
|
44
|
-
type: z.ZodString;
|
|
45
|
-
required: z.ZodDefault<z.ZodBoolean>;
|
|
46
|
-
description: z.ZodOptional<z.ZodString>;
|
|
47
|
-
}, z.core.$strip>;
|
|
48
|
-
export type CredentialRequirementDeclaration = z.infer<typeof credentialRequirementSchema>;
|
|
49
|
-
export declare const sourceRefPolicySchema: z.ZodObject<{
|
|
50
|
-
minSourceRefs: z.ZodDefault<z.ZodNumber>;
|
|
51
|
-
rejectInlineSensitivePayload: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
-
}, z.core.$strip>;
|
|
53
|
-
export type SourceRefPolicyDeclaration = z.infer<typeof sourceRefPolicySchema>;
|
|
54
|
-
export declare const trustDeclarationSchema: z.ZodObject<{
|
|
55
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
56
|
-
blocked: "blocked";
|
|
57
|
-
declarative_trusted: "declarative_trusted";
|
|
58
|
-
custom_adapter_pending_trust: "custom_adapter_pending_trust";
|
|
59
|
-
trusted_custom_adapter: "trusted_custom_adapter";
|
|
60
|
-
}>>;
|
|
61
|
-
override: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
63
|
-
}, z.core.$strip>;
|
|
64
|
-
export type ConnectorTrustDeclaration = z.infer<typeof trustDeclarationSchema>;
|
|
65
|
-
export declare const connectorManifestV6Schema: z.ZodObject<{
|
|
66
|
-
schemaVersion: z.ZodLiteral<"sn.connector.v1">;
|
|
67
|
-
platformId: z.ZodString;
|
|
68
|
-
displayName: z.ZodString;
|
|
69
|
-
family: z.ZodEnum<{
|
|
70
|
-
custom: "custom";
|
|
71
|
-
social_community: "social_community";
|
|
72
|
-
agent_network: "agent_network";
|
|
73
|
-
work_platform: "work_platform";
|
|
74
|
-
}>;
|
|
75
|
-
capabilities: z.ZodArray<z.ZodObject<{
|
|
76
|
-
id: z.ZodString;
|
|
77
|
-
channel: z.ZodOptional<z.ZodString>;
|
|
78
|
-
description: z.ZodOptional<z.ZodString>;
|
|
79
|
-
sourceRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
80
|
-
observedCount: z.ZodOptional<z.ZodNumber>;
|
|
81
|
-
}, z.core.$strip>>;
|
|
82
|
-
runner: z.ZodObject<{
|
|
83
|
-
kind: z.ZodEnum<{
|
|
84
|
-
skill: "skill";
|
|
85
|
-
browser: "browser";
|
|
86
|
-
declarative_http: "declarative_http";
|
|
87
|
-
declarative_a2a: "declarative_a2a";
|
|
88
|
-
declarative_mcp: "declarative_mcp";
|
|
89
|
-
cli_descriptor: "cli_descriptor";
|
|
90
|
-
custom_adapter: "custom_adapter";
|
|
91
|
-
scriptable_node: "scriptable_node";
|
|
92
|
-
}>;
|
|
93
|
-
entrypoint: z.ZodOptional<z.ZodString>;
|
|
94
|
-
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
95
|
-
}, z.core.$strip>;
|
|
96
|
-
credentials: z.ZodArray<z.ZodObject<{
|
|
97
|
-
type: z.ZodString;
|
|
98
|
-
required: z.ZodDefault<z.ZodBoolean>;
|
|
99
|
-
description: z.ZodOptional<z.ZodString>;
|
|
100
|
-
}, z.core.$strip>>;
|
|
101
|
-
sourceRefPolicy: z.ZodObject<{
|
|
102
|
-
minSourceRefs: z.ZodDefault<z.ZodNumber>;
|
|
103
|
-
rejectInlineSensitivePayload: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
-
}, z.core.$strip>;
|
|
105
|
-
trust: z.ZodOptional<z.ZodObject<{
|
|
106
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
107
|
-
blocked: "blocked";
|
|
108
|
-
declarative_trusted: "declarative_trusted";
|
|
109
|
-
custom_adapter_pending_trust: "custom_adapter_pending_trust";
|
|
110
|
-
trusted_custom_adapter: "trusted_custom_adapter";
|
|
111
|
-
}>>;
|
|
112
|
-
override: z.ZodOptional<z.ZodBoolean>;
|
|
113
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
114
|
-
}, z.core.$strip>>;
|
|
115
|
-
}, z.core.$strip>;
|
|
116
|
-
export type ConnectorManifestV6 = z.infer<typeof connectorManifestV6Schema>;
|
|
117
|
-
export interface ConnectorConflict {
|
|
118
|
-
platformId: string;
|
|
119
|
-
existingSource: "built_in" | "workspace";
|
|
120
|
-
attemptedSource: "built_in" | "workspace";
|
|
121
|
-
reason: string;
|
|
122
|
-
}
|
|
123
|
-
export interface ConnectorManifestValidationError {
|
|
124
|
-
platformId?: string;
|
|
125
|
-
path: string;
|
|
126
|
-
message: string;
|
|
127
|
-
}
|
|
128
|
-
export interface ConnectorInventoryEntry {
|
|
129
|
-
platformId: string;
|
|
130
|
-
source: "built_in" | "workspace";
|
|
131
|
-
manifestPath?: string;
|
|
132
|
-
trustStatus: ConnectorTrustStatus;
|
|
133
|
-
executable: boolean;
|
|
134
|
-
capabilities: string[];
|
|
135
|
-
validationErrors: string[];
|
|
136
|
-
conflict?: ConnectorConflict;
|
|
137
|
-
}
|
|
138
|
-
export interface ConnectorReloadResult {
|
|
139
|
-
scanned: number;
|
|
140
|
-
registered: number;
|
|
141
|
-
skipped: number;
|
|
142
|
-
conflicts: ConnectorConflict[];
|
|
143
|
-
validationErrors: ConnectorManifestValidationError[];
|
|
144
|
-
}
|
|
145
|
-
export interface ConnectorRegistrySnapshot {
|
|
146
|
-
readonly entries: ReadonlyMap<string, ConnectorInventoryEntry>;
|
|
147
|
-
readonly builtInEntries: ReadonlyMap<string, ConnectorInventoryEntry>;
|
|
148
|
-
readonly dynamicEntries: ReadonlyMap<string, ConnectorInventoryEntry>;
|
|
149
|
-
readonly conflicts: readonly ConnectorConflict[];
|
|
150
|
-
readonly validationErrors: readonly ConnectorManifestValidationError[];
|
|
151
|
-
readonly createdAt: string;
|
|
152
|
-
}
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const connectorRunnerKindSchema: z.ZodEnum<{
|
|
3
|
+
skill: "skill";
|
|
4
|
+
browser: "browser";
|
|
5
|
+
declarative_http: "declarative_http";
|
|
6
|
+
declarative_a2a: "declarative_a2a";
|
|
7
|
+
declarative_mcp: "declarative_mcp";
|
|
8
|
+
cli_descriptor: "cli_descriptor";
|
|
9
|
+
custom_adapter: "custom_adapter";
|
|
10
|
+
scriptable_node: "scriptable_node";
|
|
11
|
+
}>;
|
|
12
|
+
export type ConnectorRunnerKind = z.infer<typeof connectorRunnerKindSchema>;
|
|
13
|
+
export declare const connectorTrustStatusSchema: z.ZodEnum<{
|
|
14
|
+
blocked: "blocked";
|
|
15
|
+
declarative_trusted: "declarative_trusted";
|
|
16
|
+
custom_adapter_pending_trust: "custom_adapter_pending_trust";
|
|
17
|
+
trusted_custom_adapter: "trusted_custom_adapter";
|
|
18
|
+
}>;
|
|
19
|
+
export type ConnectorTrustStatus = z.infer<typeof connectorTrustStatusSchema>;
|
|
20
|
+
export declare const capabilityDeclarationSchema: z.ZodObject<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
23
|
+
description: z.ZodOptional<z.ZodString>;
|
|
24
|
+
sourceRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
+
observedCount: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type ConnectorCapabilityDeclaration = z.infer<typeof capabilityDeclarationSchema>;
|
|
28
|
+
export declare const runnerDeclarationSchema: z.ZodObject<{
|
|
29
|
+
kind: z.ZodEnum<{
|
|
30
|
+
skill: "skill";
|
|
31
|
+
browser: "browser";
|
|
32
|
+
declarative_http: "declarative_http";
|
|
33
|
+
declarative_a2a: "declarative_a2a";
|
|
34
|
+
declarative_mcp: "declarative_mcp";
|
|
35
|
+
cli_descriptor: "cli_descriptor";
|
|
36
|
+
custom_adapter: "custom_adapter";
|
|
37
|
+
scriptable_node: "scriptable_node";
|
|
38
|
+
}>;
|
|
39
|
+
entrypoint: z.ZodOptional<z.ZodString>;
|
|
40
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type ConnectorRunnerDeclaration = z.infer<typeof runnerDeclarationSchema>;
|
|
43
|
+
export declare const credentialRequirementSchema: z.ZodObject<{
|
|
44
|
+
type: z.ZodString;
|
|
45
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
46
|
+
description: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type CredentialRequirementDeclaration = z.infer<typeof credentialRequirementSchema>;
|
|
49
|
+
export declare const sourceRefPolicySchema: z.ZodObject<{
|
|
50
|
+
minSourceRefs: z.ZodDefault<z.ZodNumber>;
|
|
51
|
+
rejectInlineSensitivePayload: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export type SourceRefPolicyDeclaration = z.infer<typeof sourceRefPolicySchema>;
|
|
54
|
+
export declare const trustDeclarationSchema: z.ZodObject<{
|
|
55
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
56
|
+
blocked: "blocked";
|
|
57
|
+
declarative_trusted: "declarative_trusted";
|
|
58
|
+
custom_adapter_pending_trust: "custom_adapter_pending_trust";
|
|
59
|
+
trusted_custom_adapter: "trusted_custom_adapter";
|
|
60
|
+
}>>;
|
|
61
|
+
override: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export type ConnectorTrustDeclaration = z.infer<typeof trustDeclarationSchema>;
|
|
65
|
+
export declare const connectorManifestV6Schema: z.ZodObject<{
|
|
66
|
+
schemaVersion: z.ZodLiteral<"sn.connector.v1">;
|
|
67
|
+
platformId: z.ZodString;
|
|
68
|
+
displayName: z.ZodString;
|
|
69
|
+
family: z.ZodEnum<{
|
|
70
|
+
custom: "custom";
|
|
71
|
+
social_community: "social_community";
|
|
72
|
+
agent_network: "agent_network";
|
|
73
|
+
work_platform: "work_platform";
|
|
74
|
+
}>;
|
|
75
|
+
capabilities: z.ZodArray<z.ZodObject<{
|
|
76
|
+
id: z.ZodString;
|
|
77
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
78
|
+
description: z.ZodOptional<z.ZodString>;
|
|
79
|
+
sourceRefs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
80
|
+
observedCount: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
runner: z.ZodObject<{
|
|
83
|
+
kind: z.ZodEnum<{
|
|
84
|
+
skill: "skill";
|
|
85
|
+
browser: "browser";
|
|
86
|
+
declarative_http: "declarative_http";
|
|
87
|
+
declarative_a2a: "declarative_a2a";
|
|
88
|
+
declarative_mcp: "declarative_mcp";
|
|
89
|
+
cli_descriptor: "cli_descriptor";
|
|
90
|
+
custom_adapter: "custom_adapter";
|
|
91
|
+
scriptable_node: "scriptable_node";
|
|
92
|
+
}>;
|
|
93
|
+
entrypoint: z.ZodOptional<z.ZodString>;
|
|
94
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
credentials: z.ZodArray<z.ZodObject<{
|
|
97
|
+
type: z.ZodString;
|
|
98
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
99
|
+
description: z.ZodOptional<z.ZodString>;
|
|
100
|
+
}, z.core.$strip>>;
|
|
101
|
+
sourceRefPolicy: z.ZodObject<{
|
|
102
|
+
minSourceRefs: z.ZodDefault<z.ZodNumber>;
|
|
103
|
+
rejectInlineSensitivePayload: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
trust: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
107
|
+
blocked: "blocked";
|
|
108
|
+
declarative_trusted: "declarative_trusted";
|
|
109
|
+
custom_adapter_pending_trust: "custom_adapter_pending_trust";
|
|
110
|
+
trusted_custom_adapter: "trusted_custom_adapter";
|
|
111
|
+
}>>;
|
|
112
|
+
override: z.ZodOptional<z.ZodBoolean>;
|
|
113
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, z.core.$strip>>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
export type ConnectorManifestV6 = z.infer<typeof connectorManifestV6Schema>;
|
|
117
|
+
export interface ConnectorConflict {
|
|
118
|
+
platformId: string;
|
|
119
|
+
existingSource: "built_in" | "workspace";
|
|
120
|
+
attemptedSource: "built_in" | "workspace";
|
|
121
|
+
reason: string;
|
|
122
|
+
}
|
|
123
|
+
export interface ConnectorManifestValidationError {
|
|
124
|
+
platformId?: string;
|
|
125
|
+
path: string;
|
|
126
|
+
message: string;
|
|
127
|
+
}
|
|
128
|
+
export interface ConnectorInventoryEntry {
|
|
129
|
+
platformId: string;
|
|
130
|
+
source: "built_in" | "workspace";
|
|
131
|
+
manifestPath?: string;
|
|
132
|
+
trustStatus: ConnectorTrustStatus;
|
|
133
|
+
executable: boolean;
|
|
134
|
+
capabilities: string[];
|
|
135
|
+
validationErrors: string[];
|
|
136
|
+
conflict?: ConnectorConflict;
|
|
137
|
+
}
|
|
138
|
+
export interface ConnectorReloadResult {
|
|
139
|
+
scanned: number;
|
|
140
|
+
registered: number;
|
|
141
|
+
skipped: number;
|
|
142
|
+
conflicts: ConnectorConflict[];
|
|
143
|
+
validationErrors: ConnectorManifestValidationError[];
|
|
144
|
+
}
|
|
145
|
+
export interface ConnectorRegistrySnapshot {
|
|
146
|
+
readonly entries: ReadonlyMap<string, ConnectorInventoryEntry>;
|
|
147
|
+
readonly builtInEntries: ReadonlyMap<string, ConnectorInventoryEntry>;
|
|
148
|
+
readonly dynamicEntries: ReadonlyMap<string, ConnectorInventoryEntry>;
|
|
149
|
+
readonly conflicts: readonly ConnectorConflict[];
|
|
150
|
+
readonly validationErrors: readonly ConnectorManifestValidationError[];
|
|
151
|
+
readonly createdAt: string;
|
|
152
|
+
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export const connectorRunnerKindSchema = z.enum([
|
|
3
|
-
"declarative_http",
|
|
4
|
-
"declarative_a2a",
|
|
5
|
-
"declarative_mcp",
|
|
6
|
-
"cli_descriptor",
|
|
7
|
-
"custom_adapter",
|
|
8
|
-
"skill",
|
|
9
|
-
"browser",
|
|
10
|
-
"scriptable_node",
|
|
11
|
-
]);
|
|
12
|
-
export const connectorTrustStatusSchema = z.enum([
|
|
13
|
-
"declarative_trusted",
|
|
14
|
-
"custom_adapter_pending_trust",
|
|
15
|
-
"trusted_custom_adapter",
|
|
16
|
-
"blocked",
|
|
17
|
-
]);
|
|
18
|
-
export const capabilityDeclarationSchema = z.object({
|
|
19
|
-
id: z.string().min(1),
|
|
20
|
-
channel: z.string().optional(),
|
|
21
|
-
description: z.string().optional(),
|
|
22
|
-
sourceRefs: z.array(z.string().min(1)).optional(),
|
|
23
|
-
observedCount: z.number().int().positive().optional(),
|
|
24
|
-
});
|
|
25
|
-
export const runnerDeclarationSchema = z.object({
|
|
26
|
-
kind: connectorRunnerKindSchema,
|
|
27
|
-
entrypoint: z.string().optional(),
|
|
28
|
-
config: z.record(z.string(), z.unknown()).optional(),
|
|
29
|
-
});
|
|
30
|
-
export const credentialRequirementSchema = z.object({
|
|
31
|
-
type: z.string().min(1),
|
|
32
|
-
required: z.boolean().default(true),
|
|
33
|
-
description: z.string().optional(),
|
|
34
|
-
});
|
|
35
|
-
export const sourceRefPolicySchema = z.object({
|
|
36
|
-
minSourceRefs: z.number().int().min(0).default(1),
|
|
37
|
-
rejectInlineSensitivePayload: z.boolean().optional(),
|
|
38
|
-
});
|
|
39
|
-
export const trustDeclarationSchema = z.object({
|
|
40
|
-
status: connectorTrustStatusSchema.optional(),
|
|
41
|
-
override: z.boolean().optional(),
|
|
42
|
-
reason: z.string().optional(),
|
|
43
|
-
});
|
|
44
|
-
export const connectorManifestV6Schema = z.object({
|
|
45
|
-
schemaVersion: z.literal("sn.connector.v1"),
|
|
46
|
-
platformId: z.string().min(1),
|
|
47
|
-
displayName: z.string().min(1),
|
|
48
|
-
family: z.enum(["social_community", "agent_network", "work_platform", "custom"]),
|
|
49
|
-
capabilities: z.array(capabilityDeclarationSchema).min(1),
|
|
50
|
-
runner: runnerDeclarationSchema,
|
|
51
|
-
credentials: z.array(credentialRequirementSchema),
|
|
52
|
-
sourceRefPolicy: sourceRefPolicySchema,
|
|
53
|
-
trust: trustDeclarationSchema.optional(),
|
|
54
|
-
});
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const connectorRunnerKindSchema = z.enum([
|
|
3
|
+
"declarative_http",
|
|
4
|
+
"declarative_a2a",
|
|
5
|
+
"declarative_mcp",
|
|
6
|
+
"cli_descriptor",
|
|
7
|
+
"custom_adapter",
|
|
8
|
+
"skill",
|
|
9
|
+
"browser",
|
|
10
|
+
"scriptable_node",
|
|
11
|
+
]);
|
|
12
|
+
export const connectorTrustStatusSchema = z.enum([
|
|
13
|
+
"declarative_trusted",
|
|
14
|
+
"custom_adapter_pending_trust",
|
|
15
|
+
"trusted_custom_adapter",
|
|
16
|
+
"blocked",
|
|
17
|
+
]);
|
|
18
|
+
export const capabilityDeclarationSchema = z.object({
|
|
19
|
+
id: z.string().min(1),
|
|
20
|
+
channel: z.string().optional(),
|
|
21
|
+
description: z.string().optional(),
|
|
22
|
+
sourceRefs: z.array(z.string().min(1)).optional(),
|
|
23
|
+
observedCount: z.number().int().positive().optional(),
|
|
24
|
+
});
|
|
25
|
+
export const runnerDeclarationSchema = z.object({
|
|
26
|
+
kind: connectorRunnerKindSchema,
|
|
27
|
+
entrypoint: z.string().optional(),
|
|
28
|
+
config: z.record(z.string(), z.unknown()).optional(),
|
|
29
|
+
});
|
|
30
|
+
export const credentialRequirementSchema = z.object({
|
|
31
|
+
type: z.string().min(1),
|
|
32
|
+
required: z.boolean().default(true),
|
|
33
|
+
description: z.string().optional(),
|
|
34
|
+
});
|
|
35
|
+
export const sourceRefPolicySchema = z.object({
|
|
36
|
+
minSourceRefs: z.number().int().min(0).default(1),
|
|
37
|
+
rejectInlineSensitivePayload: z.boolean().optional(),
|
|
38
|
+
});
|
|
39
|
+
export const trustDeclarationSchema = z.object({
|
|
40
|
+
status: connectorTrustStatusSchema.optional(),
|
|
41
|
+
override: z.boolean().optional(),
|
|
42
|
+
reason: z.string().optional(),
|
|
43
|
+
});
|
|
44
|
+
export const connectorManifestV6Schema = z.object({
|
|
45
|
+
schemaVersion: z.literal("sn.connector.v1"),
|
|
46
|
+
platformId: z.string().min(1),
|
|
47
|
+
displayName: z.string().min(1),
|
|
48
|
+
family: z.enum(["social_community", "agent_network", "work_platform", "custom"]),
|
|
49
|
+
capabilities: z.array(capabilityDeclarationSchema).min(1),
|
|
50
|
+
runner: runnerDeclarationSchema,
|
|
51
|
+
credentials: z.array(credentialRequirementSchema),
|
|
52
|
+
sourceRefPolicy: sourceRefPolicySchema,
|
|
53
|
+
trust: trustDeclarationSchema.optional(),
|
|
54
|
+
});
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapter: assemble connector-system execution infrastructure into the
|
|
3
|
-
* ConnectorExecutor interface consumed by EffectDispatcher.
|
|
4
|
-
*
|
|
5
|
-
* When credentials / base URLs are missing, returns an honest
|
|
6
|
-
* terminal_failure instead of throwing so the heartbeat loop stays stable.
|
|
7
|
-
*/
|
|
8
|
-
import type { ConnectorExecutor } from "../base/contract.js";
|
|
9
|
-
export type { ConnectorExecutor } from "../base/contract.js";
|
|
10
|
-
import { type EvoMapSecretPort } from "../agent-network/evomap/adapter.js";
|
|
11
|
-
import type { ObservabilityDatabase } from "../../observability/db/index.js";
|
|
12
|
-
import type { StateDatabase } from "../../storage/db/index.js";
|
|
13
|
-
import { createCredentialVault } from "../../storage/services/credential-vault.js";
|
|
14
|
-
export interface ConnectorExecutorAdapterOptions {
|
|
15
|
-
stateDb: StateDatabase;
|
|
16
|
-
observabilityDb: ObservabilityDatabase;
|
|
17
|
-
workspaceRoot?: string;
|
|
18
|
-
}
|
|
19
|
-
export declare function createEvoMapSecretPort(vault: ReturnType<typeof createCredentialVault>): EvoMapSecretPort;
|
|
20
|
-
export declare function createConnectorExecutorAdapter(options: ConnectorExecutorAdapterOptions): ConnectorExecutor;
|
|
1
|
+
/**
|
|
2
|
+
* Adapter: assemble connector-system execution infrastructure into the
|
|
3
|
+
* ConnectorExecutor interface consumed by EffectDispatcher.
|
|
4
|
+
*
|
|
5
|
+
* When credentials / base URLs are missing, returns an honest
|
|
6
|
+
* terminal_failure instead of throwing so the heartbeat loop stays stable.
|
|
7
|
+
*/
|
|
8
|
+
import type { ConnectorExecutor } from "../base/contract.js";
|
|
9
|
+
export type { ConnectorExecutor } from "../base/contract.js";
|
|
10
|
+
import { type EvoMapSecretPort } from "../agent-network/evomap/adapter.js";
|
|
11
|
+
import type { ObservabilityDatabase } from "../../observability/db/index.js";
|
|
12
|
+
import type { StateDatabase } from "../../storage/db/index.js";
|
|
13
|
+
import { createCredentialVault } from "../../storage/services/credential-vault.js";
|
|
14
|
+
export interface ConnectorExecutorAdapterOptions {
|
|
15
|
+
stateDb: StateDatabase;
|
|
16
|
+
observabilityDb: ObservabilityDatabase;
|
|
17
|
+
workspaceRoot?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function createEvoMapSecretPort(vault: ReturnType<typeof createCredentialVault>): EvoMapSecretPort;
|
|
20
|
+
export declare function createConnectorExecutorAdapter(options: ConnectorExecutorAdapterOptions): ConnectorExecutor;
|