@native-marketing/sdk 0.3.6 → 0.3.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/dist/http.js +7513 -431
- package/dist/index.js +1289 -67
- package/package.json +11 -1
- package/release.json +3 -3
- package/types/contracts/access/permission.d.ts +3 -0
- package/types/contracts/access/project-access.d.ts +2 -0
- package/types/contracts/agent/human-presentation-validation.d.ts +4 -0
- package/types/contracts/agent/human-presentation.d.ts +300 -0
- package/types/contracts/client-lifecycle.d.ts +55 -0
- package/types/contracts/client-update-policy.d.ts +84 -0
- package/types/contracts/generated/client-release.d.ts +14 -0
- package/types/contracts/index.d.ts +4 -0
- package/types/http/client-version.d.ts +35 -0
- package/types/http/client.d.ts +1 -0
- package/types/http/generated/schema.d.ts +594 -0
- package/types/http/human-presentation.d.ts +247 -0
- package/types/http/index.d.ts +4 -0
- package/types/sdk/capability-definition.d.ts +1 -0
- package/types/sdk/cli/commands.d.ts +1 -1
- package/types/sdk/cli/output.d.ts +8 -0
- package/types/sdk/cli/run.d.ts +1 -0
- package/types/sdk/client.d.ts +12 -0
- package/types/sdk/human-presentation.d.ts +566 -0
- package/types/sdk/index.d.ts +6 -0
- package/types/sdk/transport.d.ts +6 -1
- package/types/sdk/updates/commands.d.ts +11 -0
- package/types/sdk/updates/install.d.ts +20 -0
- package/types/sdk/updates/registry.d.ts +26 -0
- package/types/sdk/updates/store.d.ts +14 -0
- package/types/sdk/updates/version.d.ts +93 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { humanPresentationInputSchema, issueHumanReadLinkInputSchema, humanReadLinkLookupSchema, humanReadLinkReceiptQuerySchema, revokeHumanReadLinkInputSchema, cleanupHumanReadLinksInputSchema } from '../contracts/index.js';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { ContentFactoryClientOptions } from './client.js';
|
|
4
|
+
import { ApiClientError } from './errors.js';
|
|
5
|
+
export declare class HumanPresentationHttpError extends ApiClientError {
|
|
6
|
+
readonly outcome: 'NOT_SENT' | 'UNKNOWN' | 'REJECTED';
|
|
7
|
+
readonly details: Record<string, unknown>;
|
|
8
|
+
constructor(status: number, code: string, outcome: 'NOT_SENT' | 'UNKNOWN' | 'REJECTED', details: Record<string, unknown>);
|
|
9
|
+
}
|
|
10
|
+
export declare function createHumanPresentationHttpClient(options: ContentFactoryClientOptions & {
|
|
11
|
+
projectCode: string;
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
}): {
|
|
14
|
+
getHumanPresentation: (input: z.input<typeof humanPresentationInputSchema>) => Promise<{
|
|
15
|
+
human: {
|
|
16
|
+
schemaVersion: 1;
|
|
17
|
+
interactions: {
|
|
18
|
+
interactionRef: string;
|
|
19
|
+
kind: "CONTENT_PACKAGE_REVIEW";
|
|
20
|
+
subjectRef: string;
|
|
21
|
+
title: string;
|
|
22
|
+
summary: string;
|
|
23
|
+
state: "APPROVED" | "PENDING" | "REJECTED" | "RESOLVED";
|
|
24
|
+
sourceState: string;
|
|
25
|
+
actionDigest: string;
|
|
26
|
+
expiresAt: null;
|
|
27
|
+
reviewUrl: string;
|
|
28
|
+
canReview: boolean;
|
|
29
|
+
}[];
|
|
30
|
+
links: ({
|
|
31
|
+
linkRef: string;
|
|
32
|
+
kind: "READABLE_CONTENT";
|
|
33
|
+
title: string;
|
|
34
|
+
subjectRef: string;
|
|
35
|
+
url: string;
|
|
36
|
+
access: "AUTHENTICATED";
|
|
37
|
+
representation: "CURRENT_VIEW";
|
|
38
|
+
expiresAt: null;
|
|
39
|
+
} | {
|
|
40
|
+
linkRef: string;
|
|
41
|
+
kind: "READABLE_CONTENT";
|
|
42
|
+
title: string;
|
|
43
|
+
subjectRef: string;
|
|
44
|
+
url: string;
|
|
45
|
+
access: "TEMPORARY_PUBLIC_READ";
|
|
46
|
+
representation: "SNAPSHOT";
|
|
47
|
+
snapshotRef: string;
|
|
48
|
+
contentSha256: string;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
expiresAt: string;
|
|
51
|
+
})[];
|
|
52
|
+
};
|
|
53
|
+
}>;
|
|
54
|
+
issueHumanReadLink: (input: z.input<typeof issueHumanReadLinkInputSchema>) => Promise<{
|
|
55
|
+
linkRef: string;
|
|
56
|
+
issuanceRequestId: string;
|
|
57
|
+
state: "ACTIVE" | "EXPIRED" | "REVOKED" | "UNAVAILABLE";
|
|
58
|
+
packageCode: string;
|
|
59
|
+
manifestHash: string;
|
|
60
|
+
expiresAt: string;
|
|
61
|
+
human: {
|
|
62
|
+
schemaVersion: 1;
|
|
63
|
+
interactions: {
|
|
64
|
+
interactionRef: string;
|
|
65
|
+
kind: "CONTENT_PACKAGE_REVIEW";
|
|
66
|
+
subjectRef: string;
|
|
67
|
+
title: string;
|
|
68
|
+
summary: string;
|
|
69
|
+
state: "APPROVED" | "PENDING" | "REJECTED" | "RESOLVED";
|
|
70
|
+
sourceState: string;
|
|
71
|
+
actionDigest: string;
|
|
72
|
+
expiresAt: null;
|
|
73
|
+
reviewUrl: string;
|
|
74
|
+
canReview: boolean;
|
|
75
|
+
}[];
|
|
76
|
+
links: ({
|
|
77
|
+
linkRef: string;
|
|
78
|
+
kind: "READABLE_CONTENT";
|
|
79
|
+
title: string;
|
|
80
|
+
subjectRef: string;
|
|
81
|
+
url: string;
|
|
82
|
+
access: "AUTHENTICATED";
|
|
83
|
+
representation: "CURRENT_VIEW";
|
|
84
|
+
expiresAt: null;
|
|
85
|
+
} | {
|
|
86
|
+
linkRef: string;
|
|
87
|
+
kind: "READABLE_CONTENT";
|
|
88
|
+
title: string;
|
|
89
|
+
subjectRef: string;
|
|
90
|
+
url: string;
|
|
91
|
+
access: "TEMPORARY_PUBLIC_READ";
|
|
92
|
+
representation: "SNAPSHOT";
|
|
93
|
+
snapshotRef: string;
|
|
94
|
+
contentSha256: string;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
expiresAt: string;
|
|
97
|
+
})[];
|
|
98
|
+
};
|
|
99
|
+
}>;
|
|
100
|
+
getHumanReadLink: (input: z.input<typeof humanReadLinkLookupSchema>) => Promise<{
|
|
101
|
+
linkRef: string;
|
|
102
|
+
issuanceRequestId: string;
|
|
103
|
+
state: "ACTIVE" | "EXPIRED" | "REVOKED" | "UNAVAILABLE";
|
|
104
|
+
packageCode: string;
|
|
105
|
+
manifestHash: string;
|
|
106
|
+
expiresAt: string;
|
|
107
|
+
human: {
|
|
108
|
+
schemaVersion: 1;
|
|
109
|
+
interactions: {
|
|
110
|
+
interactionRef: string;
|
|
111
|
+
kind: "CONTENT_PACKAGE_REVIEW";
|
|
112
|
+
subjectRef: string;
|
|
113
|
+
title: string;
|
|
114
|
+
summary: string;
|
|
115
|
+
state: "APPROVED" | "PENDING" | "REJECTED" | "RESOLVED";
|
|
116
|
+
sourceState: string;
|
|
117
|
+
actionDigest: string;
|
|
118
|
+
expiresAt: null;
|
|
119
|
+
reviewUrl: string;
|
|
120
|
+
canReview: boolean;
|
|
121
|
+
}[];
|
|
122
|
+
links: ({
|
|
123
|
+
linkRef: string;
|
|
124
|
+
kind: "READABLE_CONTENT";
|
|
125
|
+
title: string;
|
|
126
|
+
subjectRef: string;
|
|
127
|
+
url: string;
|
|
128
|
+
access: "AUTHENTICATED";
|
|
129
|
+
representation: "CURRENT_VIEW";
|
|
130
|
+
expiresAt: null;
|
|
131
|
+
} | {
|
|
132
|
+
linkRef: string;
|
|
133
|
+
kind: "READABLE_CONTENT";
|
|
134
|
+
title: string;
|
|
135
|
+
subjectRef: string;
|
|
136
|
+
url: string;
|
|
137
|
+
access: "TEMPORARY_PUBLIC_READ";
|
|
138
|
+
representation: "SNAPSHOT";
|
|
139
|
+
snapshotRef: string;
|
|
140
|
+
contentSha256: string;
|
|
141
|
+
createdAt: string;
|
|
142
|
+
expiresAt: string;
|
|
143
|
+
})[];
|
|
144
|
+
};
|
|
145
|
+
}>;
|
|
146
|
+
getHumanReadLinkReceipt: (input: z.input<typeof humanReadLinkReceiptQuerySchema>) => Promise<{
|
|
147
|
+
status: "FOUND";
|
|
148
|
+
receipt: {
|
|
149
|
+
linkRef: string;
|
|
150
|
+
issuanceRequestId: string;
|
|
151
|
+
state: "ACTIVE" | "EXPIRED" | "REVOKED" | "UNAVAILABLE";
|
|
152
|
+
packageCode: string;
|
|
153
|
+
manifestHash: string;
|
|
154
|
+
expiresAt: string;
|
|
155
|
+
human: {
|
|
156
|
+
schemaVersion: 1;
|
|
157
|
+
interactions: {
|
|
158
|
+
interactionRef: string;
|
|
159
|
+
kind: "CONTENT_PACKAGE_REVIEW";
|
|
160
|
+
subjectRef: string;
|
|
161
|
+
title: string;
|
|
162
|
+
summary: string;
|
|
163
|
+
state: "APPROVED" | "PENDING" | "REJECTED" | "RESOLVED";
|
|
164
|
+
sourceState: string;
|
|
165
|
+
actionDigest: string;
|
|
166
|
+
expiresAt: null;
|
|
167
|
+
reviewUrl: string;
|
|
168
|
+
canReview: boolean;
|
|
169
|
+
}[];
|
|
170
|
+
links: ({
|
|
171
|
+
linkRef: string;
|
|
172
|
+
kind: "READABLE_CONTENT";
|
|
173
|
+
title: string;
|
|
174
|
+
subjectRef: string;
|
|
175
|
+
url: string;
|
|
176
|
+
access: "AUTHENTICATED";
|
|
177
|
+
representation: "CURRENT_VIEW";
|
|
178
|
+
expiresAt: null;
|
|
179
|
+
} | {
|
|
180
|
+
linkRef: string;
|
|
181
|
+
kind: "READABLE_CONTENT";
|
|
182
|
+
title: string;
|
|
183
|
+
subjectRef: string;
|
|
184
|
+
url: string;
|
|
185
|
+
access: "TEMPORARY_PUBLIC_READ";
|
|
186
|
+
representation: "SNAPSHOT";
|
|
187
|
+
snapshotRef: string;
|
|
188
|
+
contentSha256: string;
|
|
189
|
+
createdAt: string;
|
|
190
|
+
expiresAt: string;
|
|
191
|
+
})[];
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
} | {
|
|
195
|
+
status: "NOT_FOUND";
|
|
196
|
+
}>;
|
|
197
|
+
revokeHumanReadLink: (input: z.input<typeof revokeHumanReadLinkInputSchema>) => Promise<{
|
|
198
|
+
linkRef: string;
|
|
199
|
+
issuanceRequestId: string;
|
|
200
|
+
state: "ACTIVE" | "EXPIRED" | "REVOKED" | "UNAVAILABLE";
|
|
201
|
+
packageCode: string;
|
|
202
|
+
manifestHash: string;
|
|
203
|
+
expiresAt: string;
|
|
204
|
+
human: {
|
|
205
|
+
schemaVersion: 1;
|
|
206
|
+
interactions: {
|
|
207
|
+
interactionRef: string;
|
|
208
|
+
kind: "CONTENT_PACKAGE_REVIEW";
|
|
209
|
+
subjectRef: string;
|
|
210
|
+
title: string;
|
|
211
|
+
summary: string;
|
|
212
|
+
state: "APPROVED" | "PENDING" | "REJECTED" | "RESOLVED";
|
|
213
|
+
sourceState: string;
|
|
214
|
+
actionDigest: string;
|
|
215
|
+
expiresAt: null;
|
|
216
|
+
reviewUrl: string;
|
|
217
|
+
canReview: boolean;
|
|
218
|
+
}[];
|
|
219
|
+
links: ({
|
|
220
|
+
linkRef: string;
|
|
221
|
+
kind: "READABLE_CONTENT";
|
|
222
|
+
title: string;
|
|
223
|
+
subjectRef: string;
|
|
224
|
+
url: string;
|
|
225
|
+
access: "AUTHENTICATED";
|
|
226
|
+
representation: "CURRENT_VIEW";
|
|
227
|
+
expiresAt: null;
|
|
228
|
+
} | {
|
|
229
|
+
linkRef: string;
|
|
230
|
+
kind: "READABLE_CONTENT";
|
|
231
|
+
title: string;
|
|
232
|
+
subjectRef: string;
|
|
233
|
+
url: string;
|
|
234
|
+
access: "TEMPORARY_PUBLIC_READ";
|
|
235
|
+
representation: "SNAPSHOT";
|
|
236
|
+
snapshotRef: string;
|
|
237
|
+
contentSha256: string;
|
|
238
|
+
createdAt: string;
|
|
239
|
+
expiresAt: string;
|
|
240
|
+
})[];
|
|
241
|
+
};
|
|
242
|
+
}>;
|
|
243
|
+
cleanupHumanReadLinks: (input?: z.input<typeof cleanupHumanReadLinksInputSchema>) => Promise<{
|
|
244
|
+
reclaimed: number;
|
|
245
|
+
limit: number;
|
|
246
|
+
}>;
|
|
247
|
+
};
|
package/types/http/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export { createContentFactoryClient } from './client.js';
|
|
2
|
+
export { createHumanPresentationHttpClient, HumanPresentationHttpError, } from './human-presentation.js';
|
|
3
|
+
export type { HumanPresentation, HumanInteraction, HumanReadLink, HumanReadLinkResult, IssueHumanReadLinkInput, } from '../contracts/index.js';
|
|
4
|
+
export { getNativeClientVersion, checkNativeHttpVersion } from './client-version.js';
|
|
5
|
+
export { assessNativeCompatibility, planNativeUpdate, defaultUpdatePolicy, type NativeClientRelease, type NativeClientIdentity, type NativeRegistryRelease, type NativeCompatibility, type NativeUpdatePolicy, type NativeUpdatePlan, } from '../contracts/index.js';
|
|
2
6
|
export { readingDocument } from '../contracts/index.js';
|
|
3
7
|
export { programActivationRequirements } from '../contracts/index.js';
|
|
4
8
|
export type { ProjectAccessView, ProjectAccessChange } from '../contracts/index.js';
|
|
@@ -3,6 +3,7 @@ export declare function verifyCapabilityDefinition(raw: unknown, name: string, e
|
|
|
3
3
|
/** Per connection metadata only. A cache hit is never permission to execute. */
|
|
4
4
|
export declare class CapabilityDefinitionCache {
|
|
5
5
|
private readonly values;
|
|
6
|
+
clear(): void;
|
|
6
7
|
remember(value: CapabilityDefinition): void;
|
|
7
8
|
get(name: string, hash: string): {
|
|
8
9
|
schemaVersion: 1;
|
|
@@ -2,7 +2,7 @@ import type { Client } from '@modelcontextprotocol/client';
|
|
|
2
2
|
import type { ParsedArgs } from './input.js';
|
|
3
3
|
export declare function resolveCommand(parsed: ParsedArgs): {
|
|
4
4
|
tool?: string;
|
|
5
|
-
mode: 'media-file' | 'package-file' | 'upload' | 'list' | 'inspect' | 'call' | 'discover' | 'describe' | 'search' | 'business-read' | 'summary' | 'capability-call' | 'capability-read' | 'capability-write' | 'document' | 'schema' | 'descriptor';
|
|
5
|
+
mode: 'media-file' | 'package-file' | 'upload' | 'list' | 'inspect' | 'call' | 'discover' | 'describe' | 'search' | 'business-read' | 'summary' | 'capability-call' | 'capability-read' | 'capability-write' | 'document' | 'schema' | 'descriptor' | 'human';
|
|
6
6
|
};
|
|
7
7
|
/** 工具目录由当前服务器提供;有分页时有界查找,不以本地名称推断授权。 */
|
|
8
8
|
export declare function businessCommand(client: Client, parsed: ParsedArgs, input: Record<string, unknown>, resource: string): Promise<unknown>;
|
package/types/sdk/cli/run.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export declare function runNetworkCli(args: string[], env?: NodeJS.ProcessEnv, io?: {
|
|
3
3
|
stdin?: AsyncIterable<string | Uint8Array>;
|
|
4
4
|
notify?: (message: string) => void;
|
|
5
|
+
executablePath?: string;
|
|
5
6
|
}, executable?: 'cf' | 'cf-agent'): Promise<{
|
|
6
7
|
exitCode: number;
|
|
7
8
|
envelope: {
|
package/types/sdk/client.d.ts
CHANGED
|
@@ -2,9 +2,19 @@ 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
4
|
import type { BusinessDocumentInput, AgentSummaryInput, AgentSummary, CapabilityCall, BusinessSearchQuery, BusinessSearchPage, BusinessContentPageRead, BusinessContentPage, CapabilityQuery, CapabilityPage, AgentCapabilityPage, CapabilityDefinition, CapabilitySchemaRead, BusinessDocumentPage } from '../contracts/index.js';
|
|
5
|
+
import { getNativeHumanPresentation, issueNativeHumanReadLink, getNativeHumanReadLink, getNativeHumanReadLinkReceipt, revokeNativeHumanReadLink, cleanupNativeHumanReadLinks } from './human-presentation.js';
|
|
5
6
|
import { readNativeCapabilityDescriptor, readNativeCapabilitySchemaPage } from './schema-pages.js';
|
|
6
7
|
import { inspectNativeTool, listNativeToolsPage, type NativeToolOptions, type NativeToolResult } from './operations.js';
|
|
8
|
+
import { readNativeServerVersion } from './updates/version.js';
|
|
7
9
|
export interface NativeAgentClient {
|
|
10
|
+
getHumanPresentation(input: Parameters<typeof getNativeHumanPresentation>[2]): ReturnType<typeof getNativeHumanPresentation>;
|
|
11
|
+
issueHumanReadLink(input: Parameters<typeof issueNativeHumanReadLink>[2]): ReturnType<typeof issueNativeHumanReadLink>;
|
|
12
|
+
getHumanReadLink(input: Parameters<typeof getNativeHumanReadLink>[2]): ReturnType<typeof getNativeHumanReadLink>;
|
|
13
|
+
getHumanReadLinkReceipt(input: Parameters<typeof getNativeHumanReadLinkReceipt>[2]): ReturnType<typeof getNativeHumanReadLinkReceipt>;
|
|
14
|
+
revokeHumanReadLink(input: Parameters<typeof revokeNativeHumanReadLink>[2]): ReturnType<typeof revokeNativeHumanReadLink>;
|
|
15
|
+
cleanupHumanReadLinks(input?: Parameters<typeof cleanupNativeHumanReadLinks>[2]): ReturnType<typeof cleanupNativeHumanReadLinks>;
|
|
16
|
+
getVersion(): ReturnType<typeof readNativeServerVersion>;
|
|
17
|
+
refreshVersion(): Promise<ReturnType<typeof readNativeServerVersion>>;
|
|
8
18
|
readPackageFile(input: Parameters<typeof readNativePackageFile>[1]): ReturnType<typeof readNativePackageFile>;
|
|
9
19
|
readProjectMediaFile(input: Parameters<typeof readNativeProjectMediaFile>[1]): ReturnType<typeof readNativeProjectMediaFile>;
|
|
10
20
|
uploadProjectMedia(file: Parameters<typeof uploadNativeProjectMedia>[1]): ReturnType<typeof uploadNativeProjectMedia>;
|
|
@@ -32,4 +42,6 @@ export declare function withNativeAgentClient<T>(connection: {
|
|
|
32
42
|
accessToken: string;
|
|
33
43
|
}, action: (client: NativeAgentClient) => Promise<T>, options?: {
|
|
34
44
|
timeoutMs?: number;
|
|
45
|
+
requireCompatibility?: boolean;
|
|
46
|
+
onVersion?: (version: ReturnType<typeof readNativeServerVersion>) => void;
|
|
35
47
|
}): Promise<T>;
|