@superdoc/sdk 2.26.0 → 2.27.0-next.4
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 +202 -29
- package/dist/agent/catalog.d.ts +0 -4
- package/dist/agent/catalog.js +0 -4
- package/dist/generated/client.cjs +14 -1
- package/dist/generated/client.d.ts +1496 -215
- package/dist/generated/client.js +14 -1
- package/dist/generated/contract.cjs +1 -2
- package/dist/generated/contract.d.ts +1 -0
- package/dist/generated/contract.js +1 -2
- package/dist/index.cjs +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/runtime/host.cjs +36 -3
- package/dist/runtime/host.d.ts +5 -0
- package/dist/runtime/host.js +36 -4
- package/dist/runtime/notifications.cjs +124 -0
- package/dist/runtime/notifications.d.ts +35 -0
- package/dist/runtime/notifications.js +116 -0
- package/dist/runtime/process.cjs +4 -1
- package/dist/runtime/process.d.ts +2 -0
- package/dist/runtime/process.js +4 -1
- package/dist/runtime/sdk-policy.d.ts +1 -0
- package/dist/runtime/sdk-version.generated.cjs +1 -1
- package/dist/runtime/sdk-version.generated.d.ts +1 -1
- package/dist/runtime/sdk-version.generated.js +1 -1
- package/dist/runtime/transport-common.cjs +9 -1
- package/dist/runtime/transport-common.d.ts +3 -0
- package/dist/runtime/transport-common.js +8 -1
- package/package.json +7 -7
- package/tools/generation-receipt.json +51 -13
- package/tools/tools-policy.json +1 -1
|
@@ -19,7 +19,8 @@ function buildStructuredReadInput(operation, params, options, encodedArgv) {
|
|
|
19
19
|
!params.sessionId ||
|
|
20
20
|
params.doc != null ||
|
|
21
21
|
options.stdinBytes !== undefined ||
|
|
22
|
-
options.collaborationAuth !== undefined
|
|
22
|
+
options.collaborationAuth !== undefined ||
|
|
23
|
+
options.identityClaim !== undefined)
|
|
23
24
|
return undefined;
|
|
24
25
|
if (!encodedArgv)
|
|
25
26
|
return undefined;
|
|
@@ -92,6 +93,12 @@ function buildStructuredReadInput(operation, params, options, encodedArgv) {
|
|
|
92
93
|
}
|
|
93
94
|
return input;
|
|
94
95
|
}
|
|
96
|
+
function normalizeIdentityClaim(value) {
|
|
97
|
+
if (typeof value !== 'string' || value.length === 0) {
|
|
98
|
+
throw new errors.SuperDocCliError('identityClaim must be a non-empty string.', { code: 'INVALID_ARGUMENT' });
|
|
99
|
+
}
|
|
100
|
+
return value;
|
|
101
|
+
}
|
|
95
102
|
function normalizeCollaborationAuth(value) {
|
|
96
103
|
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
97
104
|
throw new errors.SuperDocCliError('collaborationAuth must be an object.', { code: 'INVALID_ARGUMENT' });
|
|
@@ -301,4 +308,5 @@ exports.buildOperationArgv = buildOperationArgv;
|
|
|
301
308
|
exports.buildStructuredReadInput = buildStructuredReadInput;
|
|
302
309
|
exports.captureMutationPlanAuthor = captureMutationPlanAuthor;
|
|
303
310
|
exports.normalizeCollaborationAuth = normalizeCollaborationAuth;
|
|
311
|
+
exports.normalizeIdentityClaim = normalizeIdentityClaim;
|
|
304
312
|
exports.resolveInvocation = resolveInvocation;
|
|
@@ -27,10 +27,13 @@ export interface CollaborationAuth {
|
|
|
27
27
|
}
|
|
28
28
|
export interface DocOpenOptions extends InvokeOptions {
|
|
29
29
|
collaborationAuth?: CollaborationAuth;
|
|
30
|
+
identityClaim?: string;
|
|
30
31
|
}
|
|
31
32
|
export interface TransportInvokeOptions extends InvokeOptions {
|
|
32
33
|
collaborationAuth?: CollaborationAuth;
|
|
34
|
+
identityClaim?: string;
|
|
33
35
|
}
|
|
36
|
+
export declare function normalizeIdentityClaim(value: unknown): string;
|
|
34
37
|
export declare function normalizeCollaborationAuth(value: unknown): CollaborationAuth;
|
|
35
38
|
/**
|
|
36
39
|
* Minimal invoke interface that both SuperDocRuntime and BoundRuntime satisfy.
|
|
@@ -16,7 +16,8 @@ export function buildStructuredReadInput(operation, params, options, encodedArgv
|
|
|
16
16
|
!params.sessionId ||
|
|
17
17
|
params.doc != null ||
|
|
18
18
|
options.stdinBytes !== undefined ||
|
|
19
|
-
options.collaborationAuth !== undefined
|
|
19
|
+
options.collaborationAuth !== undefined ||
|
|
20
|
+
options.identityClaim !== undefined)
|
|
20
21
|
return undefined;
|
|
21
22
|
if (!encodedArgv)
|
|
22
23
|
return undefined;
|
|
@@ -89,6 +90,12 @@ export function buildStructuredReadInput(operation, params, options, encodedArgv
|
|
|
89
90
|
}
|
|
90
91
|
return input;
|
|
91
92
|
}
|
|
93
|
+
export function normalizeIdentityClaim(value) {
|
|
94
|
+
if (typeof value !== 'string' || value.length === 0) {
|
|
95
|
+
throw new SuperDocCliError('identityClaim must be a non-empty string.', { code: 'INVALID_ARGUMENT' });
|
|
96
|
+
}
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
92
99
|
export function normalizeCollaborationAuth(value) {
|
|
93
100
|
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
94
101
|
throw new SuperDocCliError('collaborationAuth must be an object.', { code: 'INVALID_ARGUMENT' });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.27.0-next.4",
|
|
4
4
|
"description": "Node SDK for SuperDoc, wrapping the SuperDoc CLI to read and edit .docx files from JavaScript and TypeScript.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"typescript": "^5.9.2"
|
|
39
39
|
},
|
|
40
40
|
"optionalDependencies": {
|
|
41
|
-
"@superdoc/sdk-darwin-arm64": "2.
|
|
42
|
-
"@superdoc/sdk-darwin-x64": "2.
|
|
43
|
-
"@superdoc/sdk-linux-x64": "2.
|
|
44
|
-
"@superdoc/sdk-linux-arm64": "2.
|
|
45
|
-
"@superdoc/sdk-windows-x64": "2.
|
|
41
|
+
"@superdoc/sdk-darwin-arm64": "2.27.0-next.4",
|
|
42
|
+
"@superdoc/sdk-darwin-x64": "2.27.0-next.4",
|
|
43
|
+
"@superdoc/sdk-linux-x64": "2.27.0-next.4",
|
|
44
|
+
"@superdoc/sdk-linux-arm64": "2.27.0-next.4",
|
|
45
|
+
"@superdoc/sdk-windows-x64": "2.27.0-next.4"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"typecheck": "tsc --noEmit",
|
|
54
54
|
"typecheck:consumer": "tsc --noEmit --strict --skipLibCheck --target ES2022 --module NodeNext --moduleResolution NodeNext ../../../../tests/consumer-typecheck/src/sdk-per-open-collaboration-auth.mts ../../../../tests/consumer-typecheck/src/sdk-replace-file.mts ../../../../tests/consumer-typecheck/src/sdk-retained-paragraph.mts ../../../../tests/consumer-typecheck/src/sdk-state-directory.mts ../../../../tests/consumer-typecheck/src/sdk-agent-evidence.mts ../../../../tests/consumer-typecheck/src/sdk-custom-actions.mts ../../../../tests/consumer-typecheck/src/sd4807-sdk-inspect.mts ../../../../tests/consumer-typecheck/src/sdk-tracked-only-policy.mts ../../../../tests/consumer-typecheck/src/sdk-tracked-review-route.mts ../../../../tests/consumer-typecheck/src/sd5266-sdk-placeholder-null.mts ../../../../tests/consumer-typecheck/src/sdk-schema-types.mts",
|
|
55
55
|
"test:agent-actions": "bun test src/__tests__/actions.test.ts src/__tests__/agent-runtime.test.ts src/__tests__/execution-context.test.ts src/__tests__/custom-actions.test.ts src/__tests__/textbox-snapshot.test.ts",
|
|
56
|
-
"test:cli-host": "bun test src/__tests__/diff-direct-styles.e2e.test.ts src/__tests__/default-cli-optimization.e2e.test.ts src/runtime/__tests__/host-spawn-args.test.ts src/runtime/__tests__/cli-host.test.ts src/__tests__/tracked-review-route.test.ts src/__tests__/cli-document-lifecycle.e2e.test.ts src/__tests__/request-timeout-ms.e2e.test.ts src/__tests__/agent-evidence.e2e.test.ts src/__tests__/agent-apply.e2e.test.ts src/__tests__/find-text.e2e.test.ts src/__tests__/custom-actions.e2e.test.ts",
|
|
56
|
+
"test:cli-host": "bun test src/__tests__/diff-tracked-styles.e2e.test.ts src/__tests__/diff-direct-styles.e2e.test.ts src/__tests__/default-cli-optimization.e2e.test.ts src/runtime/__tests__/host-spawn-args.test.ts src/runtime/__tests__/cli-host.test.ts src/__tests__/tracked-review-route.test.ts src/__tests__/cli-document-lifecycle.e2e.test.ts src/__tests__/request-timeout-ms.e2e.test.ts src/__tests__/agent-evidence.e2e.test.ts src/__tests__/agent-apply.e2e.test.ts src/__tests__/find-text.e2e.test.ts src/__tests__/custom-actions.e2e.test.ts src/__tests__/typed-engine-cli-a3c.e2e.test.ts",
|
|
57
57
|
"smoke:product-action": "node scripts/product-action-smoke.mjs"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"formatVersion": 1,
|
|
3
|
-
"contractHash": "
|
|
4
|
-
"documentApiSourceHash": "
|
|
5
|
-
"generatorHash": "
|
|
3
|
+
"contractHash": "67d2fe0392b01382a12e7a22c4802c47859daf8023416d8ae1d2f85018aabf80",
|
|
4
|
+
"documentApiSourceHash": "ceec5c125a3b69dab05ef4e4e3a777a49fc576dc4326845025c3e003938795e9",
|
|
5
|
+
"generatorHash": "3923bb2c89673f667eb651022b01addad5b8f027c3678e9e585a208c43339034",
|
|
6
6
|
"inputs": {
|
|
7
|
-
"apps/cli/src/host/sdk-policy.ts": "
|
|
7
|
+
"apps/cli/src/host/sdk-policy.ts": "df3587f39b4888a7b11135cc453126febb6fa8e4d3fb59b3f4f9169b4364dcd3",
|
|
8
8
|
"packages/sdk/codegen/src/artifacts.mjs": "1e03c94c1da3cca73a078b5ab445f891409e6053eb695d52933628226c7f1583",
|
|
9
9
|
"packages/sdk/codegen/src/contract-identity.mjs": "9d2fd074c10cf71f89e4cb9a1c8d96f9c4df4a15e11207cd0921dc58b6906b52",
|
|
10
10
|
"packages/sdk/codegen/src/generate-action-names.mjs": "eedb0b3e7ecab3bb7a4e507e339d8a06754cb8bab154da2583be2d5de024ea28",
|
|
11
11
|
"packages/sdk/codegen/src/generate-action-policy.mjs": "f99188ec75594ee37a8ef37e021f357c1d308cc4d5eae71a045a1426f58b9fbf",
|
|
12
12
|
"packages/sdk/codegen/src/generate-all.mjs": "e364d1b02b0c866886c357a598597b3efb3692e2320a88980981fd5f428c7433",
|
|
13
13
|
"packages/sdk/codegen/src/generate-intent-tools.mjs": "843391a0eb83bf762985be96047e9e9109b87c7d9352cde7aabf49f0e57147b5",
|
|
14
|
-
"packages/sdk/codegen/src/generate-node.mjs": "
|
|
14
|
+
"packages/sdk/codegen/src/generate-node.mjs": "968fd315d782dc9a7c9cc39ac59888bb32bb8969e1e6827735f27fc86a509cd7",
|
|
15
15
|
"packages/sdk/codegen/src/generate-python.mjs": "e6415bb2047db279bf40f32f16ba1c6a4f5d99c9df303a69cc0b9ececfa01028",
|
|
16
|
+
"packages/sdk/codegen/src/generate-rust.mjs": "4ec6abca076e10206e3b7a027f790d78c848ffc1f24eef4c99b1d1fb80881ea9",
|
|
16
17
|
"packages/sdk/codegen/src/model/schema.mjs": "29cb1167413280907ad324d8a1fcb54dc70cce829df00c1a755f43040d01cf3b",
|
|
17
18
|
"packages/sdk/codegen/src/node22-core-characters.json": "ba26df167c0853b955b6e04d856a899a7c83865c7b5834d80645d1b41d66c693",
|
|
18
19
|
"packages/sdk/codegen/src/shared.mjs": "a411e7ea4fab43b5b08b00294c746ff7063ceddbae66ece8d8c5990f131e0f7c",
|
|
19
20
|
"packages/sdk/codegen/src/targets.mjs": "62c5ae3e3813e07b37e62487d973bac60ef6bea558a01f3ace2e0c6e8374e147",
|
|
20
|
-
"packages/sdk/langs/node/package.json": "
|
|
21
|
+
"packages/sdk/langs/node/package.json": "c0c8f204058a94163e824a2254377dc82383d12e4c9d45a3a6e9b7fc3d9c5a37",
|
|
21
22
|
"packages/sdk/langs/node/scripts/embed-prompts.mjs": "1b1641bf89cad962a4ff11d93f301fe5a4e32fe856cd3c9586106d8aaab4ad80",
|
|
22
23
|
"packages/sdk/langs/node/scripts/embed-tools.mjs": "4cd8b0605b088421ea1fdf8e4e19c70f571f4e3352309a1480491600122e7bb3",
|
|
23
24
|
"packages/sdk/langs/node/scripts/embed-version.mjs": "95e2ff3a7c15cb38130e12f04c8a96c901a5e55d9960610ebefa37178fd19cde",
|
|
24
25
|
"packages/sdk/langs/node/src/agent/action-descriptors.json": "b2afbe8a23454bf807f7220172fb6211ccd098849f1ca27dc3546fdc352c8e48",
|
|
25
26
|
"packages/sdk/langs/node/src/agent/actions.ts": "a5ee29da19690344586e39f18631924c58ae8852b49b18339eeadaa45b1ea971",
|
|
26
|
-
"packages/sdk/langs/node/src/agent/catalog.ts": "
|
|
27
|
+
"packages/sdk/langs/node/src/agent/catalog.ts": "2b602247785611b1c8bfdf59fb2c03a810ec4bc2346655ec9e76d979bb382179",
|
|
27
28
|
"packages/sdk/langs/node/src/presets/core.ts": "b0f32dfc94ddfc86ad96a676da26b526edfcd5f658bfc077d880df69c057c214",
|
|
28
29
|
"packages/sdk/langs/node/src/prompts/full-addendum.md": "1c18055ddee8e40661417f75d16c12741c7b5f89987386396dc673b4fc837875",
|
|
29
30
|
"packages/sdk/langs/node/src/prompts/mcp-prompt.md": "ba1e239877b2b316744477e3ca7b6982fa265edb1358759209cc439457728e8b",
|
|
30
31
|
"packages/sdk/langs/node/src/prompts/system-prompt.md": "dd9bdac644843db2f4964ea091f5c832b8c8eb058703861210374037c077bb92",
|
|
31
32
|
"packages/sdk/langs/node/src/runtime/tracked-support.ts": "779efa7c8a949090aa83e7db93d4fa84500e7563a2d47c464305f4513c424e6f",
|
|
33
|
+
"packages/sdk/langs/rust/Cargo.toml": "18f2f1cc98055b77b9368c27335a2d82816cf4c8d2376e93697c34d6450ba0ae",
|
|
34
|
+
"packages/sdk/langs/rust/rust-toolchain.toml": "080d1c422a980a506912db5c2cc9fbedcf1df1fe4c8de676934ab7c421c5d768",
|
|
32
35
|
"packages/sdk/scripts/sdk-generate.mjs": "fc5b0cb07a39972694a0c60cfef19b2e166ec12890fb5060e97b2b818f746ef3",
|
|
33
36
|
"packages/sdk/scripts/sdk-platform-targets.mjs": "1c9d5d29f346bdccad4dadcabca371d8a2943b1613ad5a673dcee8ecfac511b5",
|
|
34
37
|
"packages/sdk/tools/prompt-templates/system-prompt-core.md": "98632908dbece800115db92181b2a48823725b6e2612383de6bc6c34f57ac72e",
|
|
@@ -37,16 +40,51 @@
|
|
|
37
40
|
"scripts/generate-all.mjs": "fbcb0920173f8170321a3583e18b2b175e54cdca47b39f3c390c727cf9a5f911"
|
|
38
41
|
},
|
|
39
42
|
"outputs": {
|
|
43
|
+
"packages/sdk/langs/rust/src/generated/mod.rs": {
|
|
44
|
+
"id": "rust-mod",
|
|
45
|
+
"sha256": "e07e97de86a03ea4c64919ee23c8584cf07612a2aec762499b4c6b45c3712d8a",
|
|
46
|
+
"consumers": [
|
|
47
|
+
"rust"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"packages/sdk/langs/rust/src/generated/types.rs": {
|
|
51
|
+
"id": "rust-types",
|
|
52
|
+
"sha256": "40f41cf13908df8d0f45d34dc02286355925dc5f84aefb1e38c70db2425e6cd3",
|
|
53
|
+
"consumers": [
|
|
54
|
+
"rust"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"packages/sdk/langs/rust/src/generated/operations.rs": {
|
|
58
|
+
"id": "rust-operations",
|
|
59
|
+
"sha256": "d3d2e6d35482a71cc150fe853ad63e9e426b112b3c4f1d8c074be531e7c12f80",
|
|
60
|
+
"consumers": [
|
|
61
|
+
"rust"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"packages/sdk/langs/rust/assets/contract.json": {
|
|
65
|
+
"id": "rust-contract",
|
|
66
|
+
"sha256": "9310fd98f9425ecc40a47d504de4bf1330329e61e2b4a2e6b7a2c99d3b0f898a",
|
|
67
|
+
"consumers": [
|
|
68
|
+
"rust"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"packages/sdk/langs/rust/assets/action-policy.json": {
|
|
72
|
+
"id": "rust-action-policy",
|
|
73
|
+
"sha256": "95160a6f5adb6c37cf2ec7bb532dbcac90865f7a5218bd5f305f636b31a8adf7",
|
|
74
|
+
"consumers": [
|
|
75
|
+
"rust"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
40
78
|
"packages/sdk/langs/node/src/generated/contract.ts": {
|
|
41
79
|
"id": "node-contract",
|
|
42
|
-
"sha256": "
|
|
80
|
+
"sha256": "3f52e57265a61fe5bd810577d08609c355621552e2c89b3e6d9606c34c65578d",
|
|
43
81
|
"consumers": [
|
|
44
82
|
"node"
|
|
45
83
|
]
|
|
46
84
|
},
|
|
47
85
|
"packages/sdk/langs/node/src/generated/client.ts": {
|
|
48
86
|
"id": "node-client",
|
|
49
|
-
"sha256": "
|
|
87
|
+
"sha256": "3b264deb29612aed21ccb2fbb9798ea34ec308578540f201209d95c81c834641",
|
|
50
88
|
"consumers": [
|
|
51
89
|
"node"
|
|
52
90
|
]
|
|
@@ -60,14 +98,14 @@
|
|
|
60
98
|
},
|
|
61
99
|
"packages/sdk/langs/python/superdoc/generated/contract.py": {
|
|
62
100
|
"id": "python-contract",
|
|
63
|
-
"sha256": "
|
|
101
|
+
"sha256": "c5093485313e585353eb89a8efc5cb4c3465fb21ba53daa0bb936112beade3e2",
|
|
64
102
|
"consumers": [
|
|
65
103
|
"python"
|
|
66
104
|
]
|
|
67
105
|
},
|
|
68
106
|
"packages/sdk/langs/python/superdoc/generated/client.py": {
|
|
69
107
|
"id": "python-client",
|
|
70
|
-
"sha256": "
|
|
108
|
+
"sha256": "1b848a952098a35fb78f9a056693fff8d99bf68d49d0fa17e48a93395ad9b54d",
|
|
71
109
|
"consumers": [
|
|
72
110
|
"python"
|
|
73
111
|
]
|
|
@@ -111,7 +149,7 @@
|
|
|
111
149
|
},
|
|
112
150
|
"packages/sdk/tools/tools-policy.json": {
|
|
113
151
|
"id": "tool-policy",
|
|
114
|
-
"sha256": "
|
|
152
|
+
"sha256": "c8b1e511217f76f4e1393e757040d70bc6937b337f28396c77644f6598dc36f8",
|
|
115
153
|
"consumers": [
|
|
116
154
|
"node",
|
|
117
155
|
"python"
|
|
@@ -193,7 +231,7 @@
|
|
|
193
231
|
},
|
|
194
232
|
"packages/sdk/langs/node/src/runtime/sdk-version.generated.ts": {
|
|
195
233
|
"id": "node-sdk-version",
|
|
196
|
-
"sha256": "
|
|
234
|
+
"sha256": "aa7d39fafb7b2c596caee428b67afbbe3c97ac1fc050893eb1b35c27852afde6",
|
|
197
235
|
"consumers": [
|
|
198
236
|
"node"
|
|
199
237
|
]
|
package/tools/tools-policy.json
CHANGED