@native-marketing/sdk 0.1.1 → 0.2.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 +12 -3
- package/dist/index.js +1176 -1020
- package/package.json +1 -1
- package/release.json +2 -2
- package/types/contracts/agent/capabilities.d.ts +59 -0
- package/types/contracts/agent/index.d.ts +4 -0
- package/types/contracts/agent/input-repair.d.ts +32 -0
- package/types/contracts/agent/publication-preflight.d.ts +6 -0
- package/types/contracts/agent/test-records.d.ts +28 -0
- package/types/contracts/agent/validation.d.ts +7 -0
- package/types/sdk/agent-capabilities.d.ts +3 -0
- package/types/sdk/capability-definition.d.ts +24 -0
- package/types/sdk/client.d.ts +3 -2
- package/types/sdk/index.d.ts +2 -1
package/package.json
CHANGED
package/release.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"sourceCommit": "
|
|
2
|
+
"sourceCommit": "351676c470fe22c510ee38fe9c3e6032de241407",
|
|
3
3
|
"workingTreeDirty": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"openapiTypesSha256": "ab00b08c6f94b2b39d7f4010de2335d70be26e7987e9db6dc57fa308426aecc4",
|
|
6
6
|
"localBuild": true
|
|
7
7
|
}
|
|
@@ -25,6 +25,7 @@ export declare const capabilityQuerySchema: z.ZodObject<{
|
|
|
25
25
|
}>>;
|
|
26
26
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
27
27
|
cursor: z.ZodOptional<z.ZodString>;
|
|
28
|
+
profile: z.ZodOptional<z.ZodLiteral<"AGENT_V3">>;
|
|
28
29
|
}, z.core.$strict>;
|
|
29
30
|
export declare const capabilityDescribeSchema: z.ZodObject<{
|
|
30
31
|
name: z.ZodString;
|
|
@@ -97,7 +98,65 @@ export declare const capabilityDefinitionSchema: z.ZodObject<{
|
|
|
97
98
|
callsReauthorize: z.ZodLiteral<true>;
|
|
98
99
|
}, z.core.$strict>;
|
|
99
100
|
}, z.core.$strict>;
|
|
101
|
+
export declare const agentCapabilityPageSchema: z.ZodObject<{
|
|
102
|
+
catalogRevision: z.ZodString;
|
|
103
|
+
authority: z.ZodObject<{
|
|
104
|
+
discoveryIsAuthority: z.ZodLiteral<false>;
|
|
105
|
+
callsReauthorize: z.ZodLiteral<true>;
|
|
106
|
+
}, z.core.$strict>;
|
|
107
|
+
page: z.ZodObject<{
|
|
108
|
+
hasMore: z.ZodBoolean;
|
|
109
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
110
|
+
}, z.core.$strict>;
|
|
111
|
+
schemaVersion: z.ZodLiteral<3>;
|
|
112
|
+
matching: z.ZodLiteral<"ACTION_OBJECT_BILINGUAL">;
|
|
113
|
+
result: z.ZodEnum<{
|
|
114
|
+
BROWSE: "BROWSE";
|
|
115
|
+
MATCH: "MATCH";
|
|
116
|
+
NO_MATCH: "NO_MATCH";
|
|
117
|
+
}>;
|
|
118
|
+
scope: z.ZodLiteral<"CURRENT_AUTHORIZED_CATALOGUE">;
|
|
119
|
+
items: z.ZodArray<z.ZodObject<{
|
|
120
|
+
name: z.ZodString;
|
|
121
|
+
title: z.ZodString;
|
|
122
|
+
summary: z.ZodString;
|
|
123
|
+
group: z.ZodEnum<{
|
|
124
|
+
administration: "administration";
|
|
125
|
+
delivery: "delivery";
|
|
126
|
+
foundation: "foundation";
|
|
127
|
+
knowledge: "knowledge";
|
|
128
|
+
operating: "operating";
|
|
129
|
+
review: "review";
|
|
130
|
+
strategy: "strategy";
|
|
131
|
+
system: "system";
|
|
132
|
+
tasks: "tasks";
|
|
133
|
+
}>;
|
|
134
|
+
readOnlyHint: z.ZodNullable<z.ZodBoolean>;
|
|
135
|
+
requiresHumanDecision: z.ZodBoolean;
|
|
136
|
+
businessStateChecked: z.ZodLiteral<false>;
|
|
137
|
+
schemaSha256: z.ZodOptional<z.ZodString>;
|
|
138
|
+
definition: z.ZodOptional<z.ZodObject<{
|
|
139
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
140
|
+
schemaSha256: z.ZodString;
|
|
141
|
+
definition: z.ZodObject<{
|
|
142
|
+
name: z.ZodString;
|
|
143
|
+
title: z.ZodOptional<z.ZodString>;
|
|
144
|
+
description: z.ZodOptional<z.ZodString>;
|
|
145
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
146
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
147
|
+
annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
148
|
+
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
149
|
+
}, z.core.$strict>;
|
|
150
|
+
authority: z.ZodObject<{
|
|
151
|
+
discoveryIsAuthority: z.ZodLiteral<false>;
|
|
152
|
+
callsReauthorize: z.ZodLiteral<true>;
|
|
153
|
+
}, z.core.$strict>;
|
|
154
|
+
}, z.core.$strict>>;
|
|
155
|
+
supportsValidateOnly: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
+
}, z.core.$strict>>;
|
|
157
|
+
}, z.core.$strict>;
|
|
100
158
|
export type CapabilityQuery = z.infer<typeof capabilityQuerySchema>;
|
|
101
159
|
export type CapabilitySummary = z.infer<typeof capabilitySummarySchema>;
|
|
102
160
|
export type CapabilityPage = z.infer<typeof capabilityPageSchema>;
|
|
103
161
|
export type CapabilityDefinition = z.infer<typeof capabilityDefinitionSchema>;
|
|
162
|
+
export type AgentCapabilityPage = z.infer<typeof agentCapabilityPageSchema>;
|
|
@@ -33,7 +33,11 @@ export * from './execution/index.js';
|
|
|
33
33
|
export * from './guidance.js';
|
|
34
34
|
export * from './read-receipt.js';
|
|
35
35
|
export * from './capabilities.js';
|
|
36
|
+
export * from './input-repair.js';
|
|
36
37
|
export * from './capability-outcome.js';
|
|
37
38
|
export * from './business-search.js';
|
|
38
39
|
export * from './compact-surface.js';
|
|
39
40
|
export * from './document-page.js';
|
|
41
|
+
export * from './test-records.js';
|
|
42
|
+
export * from './validation.js';
|
|
43
|
+
export * from './publication-preflight.js';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const capabilityInputRepairSchema: z.ZodObject<{
|
|
3
|
+
phase: z.ZodLiteral<"INPUT">;
|
|
4
|
+
handlerEntered: z.ZodLiteral<false>;
|
|
5
|
+
issues: z.ZodArray<z.ZodObject<{
|
|
6
|
+
field: z.ZodString;
|
|
7
|
+
message: z.ZodLiteral<"Value does not match the declared schema.">;
|
|
8
|
+
expectedType: z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
array: "array";
|
|
10
|
+
boolean: "boolean";
|
|
11
|
+
integer: "integer";
|
|
12
|
+
null: "null";
|
|
13
|
+
number: "number";
|
|
14
|
+
object: "object";
|
|
15
|
+
string: "string";
|
|
16
|
+
}>>;
|
|
17
|
+
allowedRange: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
}, z.core.$strict>>;
|
|
21
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
24
|
+
}, z.core.$strict>>;
|
|
25
|
+
argumentPatch: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
26
|
+
schema: z.ZodObject<{
|
|
27
|
+
tool: z.ZodLiteral<"cf_describe_capability">;
|
|
28
|
+
arguments: z.ZodObject<{
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const publicationPreflightSchema: import("zod").ZodObject<{
|
|
2
|
+
packageCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3
|
+
targetKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
|
+
destinationCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
5
|
+
programCode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
6
|
+
}, import("zod/v4/core").$strict>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const testRecordSaveSchema: z.ZodObject<{
|
|
3
|
+
recordId: z.ZodString;
|
|
4
|
+
expectedVersion: z.ZodNumber;
|
|
5
|
+
label: z.ZodString;
|
|
6
|
+
payload: z.ZodString;
|
|
7
|
+
requestId: z.ZodString;
|
|
8
|
+
validateOnly: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export declare const testRecordReadSchema: z.ZodObject<{
|
|
11
|
+
recordId: z.ZodString;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export declare const testRecordCleanupSchema: z.ZodObject<{
|
|
14
|
+
records: z.ZodArray<z.ZodObject<{
|
|
15
|
+
recordId: z.ZodString;
|
|
16
|
+
expectedVersion: z.ZodNumber;
|
|
17
|
+
}, z.core.$strict>>;
|
|
18
|
+
requestId: z.ZodString;
|
|
19
|
+
validateOnly: z.ZodDefault<z.ZodBoolean>;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
export declare const testRecordReceiptSchema: z.ZodObject<{
|
|
22
|
+
operation: z.ZodEnum<{
|
|
23
|
+
CLEANUP: "CLEANUP";
|
|
24
|
+
SAVE: "SAVE";
|
|
25
|
+
}>;
|
|
26
|
+
requestId: z.ZodString;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export declare const testRecordRejectionCodes: readonly ['MCP_TEST_RECORD_CONFLICT', 'MCP_TEST_RECORD_NOT_FOUND', 'MCP_TEST_RECORD_CLEANED', 'IDEMPOTENCY_CONFLICT'];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const capabilityValidationSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
expectedSchemaSha256: z.ZodString;
|
|
5
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
6
|
+
validateOnly: z.ZodDefault<z.ZodLiteral<true>>;
|
|
7
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Client } from '@modelcontextprotocol/client';
|
|
2
|
+
import { type CapabilityQuery, type AgentCapabilityPage } from '../contracts/index.js';
|
|
3
|
+
export declare function findAgentCapabilities(client: Client, input?: Partial<CapabilityQuery>, timeout?: number): Promise<AgentCapabilityPage>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type CapabilityDefinition } from '../contracts/index.js';
|
|
2
|
+
export declare function verifyCapabilityDefinition(raw: unknown, name: string, expectedHash?: string): CapabilityDefinition;
|
|
3
|
+
/** Per connection metadata only. A cache hit is never permission to execute. */
|
|
4
|
+
export declare class CapabilityDefinitionCache {
|
|
5
|
+
private readonly values;
|
|
6
|
+
remember(value: CapabilityDefinition): void;
|
|
7
|
+
get(name: string, hash: string): {
|
|
8
|
+
schemaVersion: 1;
|
|
9
|
+
schemaSha256: string;
|
|
10
|
+
definition: {
|
|
11
|
+
name: string;
|
|
12
|
+
title?: string | undefined;
|
|
13
|
+
description?: string | undefined;
|
|
14
|
+
inputSchema: Record<string, unknown>;
|
|
15
|
+
outputSchema?: Record<string, unknown> | undefined;
|
|
16
|
+
annotations?: Record<string, unknown> | undefined;
|
|
17
|
+
_meta?: Record<string, unknown> | undefined;
|
|
18
|
+
};
|
|
19
|
+
authority: {
|
|
20
|
+
discoveryIsAuthority: false;
|
|
21
|
+
callsReauthorize: true;
|
|
22
|
+
};
|
|
23
|
+
} | undefined;
|
|
24
|
+
}
|
package/types/sdk/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readNativePackageFile } from './package-files.js';
|
|
2
2
|
import { readNativeProjectMediaFile } from './project-media.js';
|
|
3
3
|
import { uploadNativeProjectMedia, uploadNativeMaterial, type NativeMaterialUpload } from './material-upload.js';
|
|
4
|
-
import type { BusinessDocumentInput, AgentSummaryInput, AgentSummary, CapabilityCall, BusinessSearchQuery, BusinessSearchPage, BusinessContentPageRead, BusinessContentPage, CapabilityQuery, CapabilityPage, CapabilityDefinition, CapabilitySchemaRead, BusinessDocumentPage } from '../contracts/index.js';
|
|
4
|
+
import type { BusinessDocumentInput, AgentSummaryInput, AgentSummary, CapabilityCall, BusinessSearchQuery, BusinessSearchPage, BusinessContentPageRead, BusinessContentPage, CapabilityQuery, CapabilityPage, AgentCapabilityPage, CapabilityDefinition, CapabilitySchemaRead, BusinessDocumentPage } from '../contracts/index.js';
|
|
5
5
|
import { readNativeCapabilityDescriptor, readNativeCapabilitySchemaPage } from './schema-pages.js';
|
|
6
6
|
import { inspectNativeTool, listNativeToolsPage, type NativeToolOptions, type NativeToolResult } from './operations.js';
|
|
7
7
|
export interface NativeAgentClient {
|
|
@@ -24,7 +24,8 @@ export interface NativeAgentClient {
|
|
|
24
24
|
searchBusiness(input?: Partial<BusinessSearchQuery>): Promise<BusinessSearchPage>;
|
|
25
25
|
readBusinessPage(input: BusinessContentPageRead): Promise<BusinessContentPage>;
|
|
26
26
|
findCapabilities(input?: Partial<CapabilityQuery>): Promise<CapabilityPage>;
|
|
27
|
-
|
|
27
|
+
discoverCapabilities(input?: Partial<CapabilityQuery>): Promise<AgentCapabilityPage>;
|
|
28
|
+
describeCapability(name: string, expectedSchemaSha256?: string): Promise<CapabilityDefinition>;
|
|
28
29
|
}
|
|
29
30
|
export declare function withNativeAgentClient<T>(connection: {
|
|
30
31
|
resource: string;
|
package/types/sdk/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { withNativeAgentClient, type NativeAgentClient } from './client.js';
|
|
2
2
|
export { runNetworkCli } from './cli/run.js';
|
|
3
|
+
export { findAgentCapabilities } from './agent-capabilities.js';
|
|
3
4
|
export { findNativeCapabilities, describeNativeCapability } from './capabilities.js';
|
|
4
|
-
export type { CapabilityPage, CapabilityDefinition, CapabilityQuery, } from '../contracts/index.js';
|
|
5
|
+
export type { CapabilityPage, AgentCapabilityPage, CapabilityDefinition, CapabilityQuery, } from '../contracts/index.js';
|
|
5
6
|
export { CliError as NativeAgentClientError } from './errors.js';
|
|
6
7
|
export { searchNativeBusiness, readNativeBusinessPage } from './business-search.js';
|
|
7
8
|
export type { BusinessSearchQuery, BusinessSearchPage, BusinessContentPageRead, BusinessContentPage, } from '../contracts/index.js';
|