@zhama/tego-plugin-sdk 1.40.0 → 1.40.1
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/manifest.d.cts +654 -654
- package/dist/manifest.d.ts +654 -654
- package/dist/publish.cjs +1 -1
- package/dist/publish.d.cts +6 -3
- package/dist/publish.d.ts +6 -3
- package/dist/publish.js +1 -1
- package/dist/server.d.cts +33 -33
- package/dist/server.d.ts +33 -33
- package/package.json +1 -1
package/dist/publish.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var $=Object.defineProperty;var
|
|
1
|
+
"use strict";var $=Object.defineProperty;var i=(e,n)=>$(e,"name",{value:n,configurable:!0});var chunkQQOUNXLC_cjs=require("./chunk-QQOUNXLC.cjs");require("./chunk-6EKQMOYT.cjs"),require("./chunk-H6GXDFLP.cjs"),require("./chunk-45Y4CR4R.cjs");var chunk2P6UEAPV_cjs=require("./chunk-2P6UEAPV.cjs");require("./chunk-N4SXZZPY.cjs"),require("./chunk-IOZFHJ4F.cjs"),require("./chunk-AJY7ZHXK.cjs"),require("./chunk-OP64Y4IN.cjs");var promises=require("fs/promises"),path=require("path"),API_PREFIX="/api/v1/tego-os";async function publishPlugin(e){const n=e.log===null?()=>{}:e.log??(r=>console.log(r)),a=await chunkQQOUNXLC_cjs.packPlugin({root:e.root,log:n});return publishPackedPlugin(a,e)}i(publishPlugin,"publishPlugin");async function publishPackedPlugin(e,n){const a=n.log===null?()=>{}:n.log??(p=>console.log(p)),r=n.fetchImpl??fetch,t=createCaller(n.server,n.token,r),s=await promises.readFile(e.file),o=path.basename(e.file);a("\u203A presigning upload");const c=await t("POST","/admin/runtime-plugins/presign-stream",{filename:o,mimeType:"application/zip",size:s.byteLength});a(`\u203A uploading ${o} (${s.byteLength} bytes)`),await putArchive(n.server,c.uploadUrl,s,r),a("\u203A inspecting package");const u=await t("POST","/admin/runtime-plugins/inspect",{uploadToken:c.uploadToken});a(` ${u.pluginId}@${u.semanticVersion} \u2014 ${describeParts(u)}${u.isUpgrade?" (upgrade)":""}${u.requiresConfig?", needs config":""}`),a("\u203A finalizing release");const g=await t("POST","/admin/runtime-plugins/upload",{uploadToken:c.uploadToken,...n.meta});let l=g.release;a(` release ${l.id} (${l.status})`),(n.approve??!0)&&(a("\u203A approving release"),l=await t("POST",`/admin/runtime-plugins/releases/${encodeURIComponent(l.id)}/approve`,{}),a(` release ${l.id} (${l.status})`));let d=null;if(n.install??!0){const p=chunk2P6UEAPV_cjs.resolvePluginScope(e.manifest),f=p==="avatar"?{releaseId:l.id,avatarIds:n.avatarIds??await currentAvatarIds(t,e.manifest.id,a)}:{releaseId:l.id};a(`\u203A installing for tenant (${p}-scoped)`),d=await t("POST","/admin/runtime-plugins/installs",f),reportInstall(d,a)}return{packed:e,preview:u,catalog:g.catalog,release:l,install:d}}i(publishPackedPlugin,"publishPackedPlugin");async function currentAvatarIds(e,n,a){const t=(await e("GET","/admin/runtime-plugins/installs")).find(s=>s.pluginId===n);return t?(a(` keeping the ${t.avatarIds.length} avatars it is installed on`),t.avatarIds):(a(" first install: no avatars selected (pass --avatar to choose)"),[])}i(currentAvatarIds,"currentAvatarIds");function describeParts(e){const n=[];return e.parts.frontend&&n.push(`frontend (${e.parts.frontend.locales.length} locales)`),e.parts.backend&&n.push(`backend (${e.parts.backend.migrationCount} migrations)`),e.parts.claw&&n.push("claw"),n.join(", ")||"no parts"}i(describeParts,"describeParts");function reportInstall(e,n){const a=e.avatars;if(!a||a.attempted===0){n(` installed ${e.pluginId}@${e.version}`);return}const r=a.attempted-a.failures.length;n(` installed ${e.pluginId}@${e.version} \u2014 ${r}/${a.attempted} avatars`);for(const t of a.failures)n(` \u2717 ${t.avatarId}: ${t.message}`)}i(reportInstall,"reportInstall");function createCaller(e,n,a){const r=e.replace(/\/+$/,"");return i(async function(s,o,c){const u=await a(`${r}${API_PREFIX}${o}`,{method:s,headers:{authorization:`Bearer ${n}`,...c===void 0?{}:{"content-type":"application/json"}},...c===void 0?{}:{body:JSON.stringify(c)}});return unwrap(u,`${s} ${o}`)},"call")}i(createCaller,"createCaller");async function putArchive(e,n,a,r){const t=e.replace(/\/+$/,""),s=await r(`${t}${n}`,{method:"PUT",headers:{"content-type":"application/zip"},body:a});await unwrap(s,"PUT upload")}i(putArchive,"putArchive");async function unwrap(e,n){let a;try{a=await e.json()}catch{a=null}if(!e.ok||!a?.success){const r=a?.error?.message??`HTTP ${e.status}`;throw new Error(`${n} failed: ${r}`)}return a.data}i(unwrap,"unwrap"),exports.publishPackedPlugin=publishPackedPlugin,exports.publishPlugin=publishPlugin;
|
package/dist/publish.d.cts
CHANGED
|
@@ -9,9 +9,12 @@ interface PublishPluginOptions {
|
|
|
9
9
|
/** Admin bearer token. The publish endpoints all sit behind `adminMiddleware`. */
|
|
10
10
|
token: string;
|
|
11
11
|
/**
|
|
12
|
-
* Avatars to install onto, for an avatar-scoped plugin
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* Avatars to install onto, for an avatar-scoped plugin: the complete set, so
|
|
13
|
+
* any avatar left out is uninstalled. An empty array installs it for nobody,
|
|
14
|
+
* which is the server's own contract, not a no-op — it still creates the
|
|
15
|
+
* tenant install. Omitted, an upgrade keeps the avatars the plugin is
|
|
16
|
+
* installed on now and a first install selects none. Ignored for a
|
|
17
|
+
* tenant-scoped plugin.
|
|
15
18
|
*/
|
|
16
19
|
avatarIds?: string[];
|
|
17
20
|
/** Catalog metadata to stamp on the release. */
|
package/dist/publish.d.ts
CHANGED
|
@@ -9,9 +9,12 @@ interface PublishPluginOptions {
|
|
|
9
9
|
/** Admin bearer token. The publish endpoints all sit behind `adminMiddleware`. */
|
|
10
10
|
token: string;
|
|
11
11
|
/**
|
|
12
|
-
* Avatars to install onto, for an avatar-scoped plugin
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* Avatars to install onto, for an avatar-scoped plugin: the complete set, so
|
|
13
|
+
* any avatar left out is uninstalled. An empty array installs it for nobody,
|
|
14
|
+
* which is the server's own contract, not a no-op — it still creates the
|
|
15
|
+
* tenant install. Omitted, an upgrade keeps the avatars the plugin is
|
|
16
|
+
* installed on now and a first install selects none. Ignored for a
|
|
17
|
+
* tenant-scoped plugin.
|
|
15
18
|
*/
|
|
16
19
|
avatarIds?: string[];
|
|
17
20
|
/** Catalog metadata to stamp on the release. */
|
package/dist/publish.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var v=Object.defineProperty;var s=(a,e)=>v(a,"name",{value:e,configurable:!0});import{packPlugin as h}from"./chunk-UZBWS5AR.js";import"./chunk-44LPR67H.js";import"./chunk-2KXEYXM2.js";import"./chunk-2NTAWYCG.js";import{resolvePluginScope as I}from"./chunk-IVJECPGG.js";import"./chunk-INCA3GFW.js";import"./chunk-XOXUS4VI.js";import"./chunk-VMCGDDGP.js";import"./chunk-SNUCO2MK.js";import{readFile as w}from"fs/promises";import{basename as P}from"path";var y="/api/v1/tego-os";async function T(a){const e=a.log===null?()=>{}:a.log??(i=>console.log(i)),t=await h({root:a.root,log:e});return f(t,a)}s(T,"publishPlugin");async function f(a,e){const t=e.log===null?()=>{}:e.log??(p=>console.log(p)),i=e.fetchImpl??fetch,n=S(e.server,e.token,i),r=await w(a.file),c=P(a.file);t("\u203A presigning upload");const u=await n("POST","/admin/runtime-plugins/presign-stream",{filename:c,mimeType:"application/zip",size:r.byteLength});t(`\u203A uploading ${c} (${r.byteLength} bytes)`),await z(e.server,u.uploadUrl,r,i),t("\u203A inspecting package");const l=await n("POST","/admin/runtime-plugins/inspect",{uploadToken:u.uploadToken});t(` ${l.pluginId}@${l.semanticVersion} \u2014 ${k(l)}${l.isUpgrade?" (upgrade)":""}${l.requiresConfig?", needs config":""}`),t("\u203A finalizing release");const g=await n("POST","/admin/runtime-plugins/upload",{uploadToken:u.uploadToken,...e.meta});let o=g.release;t(` release ${o.id} (${o.status})`),(e.approve??!0)&&(t("\u203A approving release"),o=await n("POST",`/admin/runtime-plugins/releases/${encodeURIComponent(o.id)}/approve`,{}),t(` release ${o.id} (${o.status})`));let d=null;if(e.install??!0){const p=I(a.manifest),$=p==="avatar"?{releaseId:o.id,avatarIds:e.avatarIds??await b(n,a.manifest.id,t)}:{releaseId:o.id};t(`\u203A installing for tenant (${p}-scoped)`),d=await n("POST","/admin/runtime-plugins/installs",$),A(d,t)}return{packed:a,preview:l,catalog:g.catalog,release:o,install:d}}s(f,"publishPackedPlugin");async function b(a,e,t){const n=(await a("GET","/admin/runtime-plugins/installs")).find(r=>r.pluginId===e);return n?(t(` keeping the ${n.avatarIds.length} avatars it is installed on`),n.avatarIds):(t(" first install: no avatars selected (pass --avatar to choose)"),[])}s(b,"currentAvatarIds");function k(a){const e=[];return a.parts.frontend&&e.push(`frontend (${a.parts.frontend.locales.length} locales)`),a.parts.backend&&e.push(`backend (${a.parts.backend.migrationCount} migrations)`),a.parts.claw&&e.push("claw"),e.join(", ")||"no parts"}s(k,"describeParts");function A(a,e){const t=a.avatars;if(!t||t.attempted===0){e(` installed ${a.pluginId}@${a.version}`);return}const i=t.attempted-t.failures.length;e(` installed ${a.pluginId}@${a.version} \u2014 ${i}/${t.attempted} avatars`);for(const n of t.failures)e(` \u2717 ${n.avatarId}: ${n.message}`)}s(A,"reportInstall");function S(a,e,t){const i=a.replace(/\/+$/,"");return s(async function(r,c,u){const l=await t(`${i}${y}${c}`,{method:r,headers:{authorization:`Bearer ${e}`,...u===void 0?{}:{"content-type":"application/json"}},...u===void 0?{}:{body:JSON.stringify(u)}});return m(l,`${r} ${c}`)},"call")}s(S,"createCaller");async function z(a,e,t,i){const n=a.replace(/\/+$/,""),r=await i(`${n}${e}`,{method:"PUT",headers:{"content-type":"application/zip"},body:t});await m(r,"PUT upload")}s(z,"putArchive");async function m(a,e){let t;try{t=await a.json()}catch{t=null}if(!a.ok||!t?.success){const i=t?.error?.message??`HTTP ${a.status}`;throw new Error(`${e} failed: ${i}`)}return t.data}s(m,"unwrap");export{f as publishPackedPlugin,T as publishPlugin};
|
package/dist/server.d.cts
CHANGED
|
@@ -15,32 +15,32 @@ declare const accountInviteSchema: z.ZodEffects<z.ZodObject<{
|
|
|
15
15
|
requestId: string;
|
|
16
16
|
organizationName: string;
|
|
17
17
|
email?: string | undefined;
|
|
18
|
-
phone?: string | undefined;
|
|
19
18
|
username?: string | undefined;
|
|
19
|
+
phone?: string | undefined;
|
|
20
20
|
userId?: string | undefined;
|
|
21
21
|
fullName?: string | undefined;
|
|
22
22
|
}, {
|
|
23
23
|
requestId: string;
|
|
24
24
|
organizationName: string;
|
|
25
25
|
email?: string | undefined;
|
|
26
|
-
phone?: string | undefined;
|
|
27
26
|
username?: string | undefined;
|
|
27
|
+
phone?: string | undefined;
|
|
28
28
|
userId?: string | undefined;
|
|
29
29
|
fullName?: string | undefined;
|
|
30
30
|
}>, {
|
|
31
31
|
requestId: string;
|
|
32
32
|
organizationName: string;
|
|
33
33
|
email?: string | undefined;
|
|
34
|
-
phone?: string | undefined;
|
|
35
34
|
username?: string | undefined;
|
|
35
|
+
phone?: string | undefined;
|
|
36
36
|
userId?: string | undefined;
|
|
37
37
|
fullName?: string | undefined;
|
|
38
38
|
}, {
|
|
39
39
|
requestId: string;
|
|
40
40
|
organizationName: string;
|
|
41
41
|
email?: string | undefined;
|
|
42
|
-
phone?: string | undefined;
|
|
43
42
|
username?: string | undefined;
|
|
43
|
+
phone?: string | undefined;
|
|
44
44
|
userId?: string | undefined;
|
|
45
45
|
fullName?: string | undefined;
|
|
46
46
|
}>;
|
|
@@ -59,36 +59,36 @@ declare const accountProvisionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
59
59
|
requestId: string;
|
|
60
60
|
organizationName: string;
|
|
61
61
|
email?: string | undefined;
|
|
62
|
-
phone?: string | undefined;
|
|
63
62
|
password?: string | undefined;
|
|
64
63
|
username?: string | undefined;
|
|
64
|
+
phone?: string | undefined;
|
|
65
65
|
userId?: string | undefined;
|
|
66
66
|
fullName?: string | undefined;
|
|
67
67
|
}, {
|
|
68
68
|
requestId: string;
|
|
69
69
|
organizationName: string;
|
|
70
70
|
email?: string | undefined;
|
|
71
|
-
phone?: string | undefined;
|
|
72
71
|
password?: string | undefined;
|
|
73
72
|
username?: string | undefined;
|
|
73
|
+
phone?: string | undefined;
|
|
74
74
|
userId?: string | undefined;
|
|
75
75
|
fullName?: string | undefined;
|
|
76
76
|
}>, {
|
|
77
77
|
requestId: string;
|
|
78
78
|
organizationName: string;
|
|
79
79
|
email?: string | undefined;
|
|
80
|
-
phone?: string | undefined;
|
|
81
80
|
password?: string | undefined;
|
|
82
81
|
username?: string | undefined;
|
|
82
|
+
phone?: string | undefined;
|
|
83
83
|
userId?: string | undefined;
|
|
84
84
|
fullName?: string | undefined;
|
|
85
85
|
}, {
|
|
86
86
|
requestId: string;
|
|
87
87
|
organizationName: string;
|
|
88
88
|
email?: string | undefined;
|
|
89
|
-
phone?: string | undefined;
|
|
90
89
|
password?: string | undefined;
|
|
91
90
|
username?: string | undefined;
|
|
91
|
+
phone?: string | undefined;
|
|
92
92
|
userId?: string | undefined;
|
|
93
93
|
fullName?: string | undefined;
|
|
94
94
|
}>;
|
|
@@ -445,13 +445,13 @@ declare const pluginCollectionEnsureSchema: z.ZodObject<{
|
|
|
445
445
|
/** @deprecated Accepted for older clients; reads use ordinary knowledge ACL. */
|
|
446
446
|
policyScope: z.ZodOptional<z.ZodString>;
|
|
447
447
|
}, "strict", z.ZodTypeAny, {
|
|
448
|
-
key: string;
|
|
449
448
|
name: string;
|
|
449
|
+
key: string;
|
|
450
450
|
accessMode?: "managed" | "private" | undefined;
|
|
451
451
|
policyScope?: string | undefined;
|
|
452
452
|
}, {
|
|
453
|
-
key: string;
|
|
454
453
|
name: string;
|
|
454
|
+
key: string;
|
|
455
455
|
accessMode?: "managed" | "private" | undefined;
|
|
456
456
|
policyScope?: string | undefined;
|
|
457
457
|
}>;
|
|
@@ -462,23 +462,23 @@ declare const pluginCollectionPermissionsSchema: z.ZodObject<{
|
|
|
462
462
|
subjectType: z.ZodEnum<["user", "team", "role", "tenant"]>;
|
|
463
463
|
subjectId: z.ZodString;
|
|
464
464
|
}, "strict", z.ZodTypeAny, {
|
|
465
|
-
subjectType: "
|
|
465
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
466
466
|
subjectId: string;
|
|
467
467
|
}, {
|
|
468
|
-
subjectType: "
|
|
468
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
469
469
|
subjectId: string;
|
|
470
470
|
}>, "many">;
|
|
471
471
|
}, "strict", z.ZodTypeAny, {
|
|
472
472
|
key: string;
|
|
473
473
|
grants: {
|
|
474
|
-
subjectType: "
|
|
474
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
475
475
|
subjectId: string;
|
|
476
476
|
}[];
|
|
477
477
|
syncRevision?: string | undefined;
|
|
478
478
|
}, {
|
|
479
479
|
key: string;
|
|
480
480
|
grants: {
|
|
481
|
-
subjectType: "
|
|
481
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
482
482
|
subjectId: string;
|
|
483
483
|
}[];
|
|
484
484
|
syncRevision?: string | undefined;
|
|
@@ -524,23 +524,23 @@ declare const pluginCollectionAccessSchema: z.ZodEffects<z.ZodObject<{
|
|
|
524
524
|
/** Identity snapshot returned by access({enabled:false}); required to resume. */
|
|
525
525
|
identityRevision: z.ZodOptional<z.ZodString>;
|
|
526
526
|
}, "strict", z.ZodTypeAny, {
|
|
527
|
-
key?: string | undefined;
|
|
528
527
|
enabled?: boolean | undefined;
|
|
528
|
+
key?: string | undefined;
|
|
529
529
|
syncRevision?: string | undefined;
|
|
530
530
|
identityRevision?: string | undefined;
|
|
531
531
|
}, {
|
|
532
|
-
key?: string | undefined;
|
|
533
532
|
enabled?: boolean | undefined;
|
|
533
|
+
key?: string | undefined;
|
|
534
534
|
syncRevision?: string | undefined;
|
|
535
535
|
identityRevision?: string | undefined;
|
|
536
536
|
}>, {
|
|
537
|
-
key?: string | undefined;
|
|
538
537
|
enabled?: boolean | undefined;
|
|
538
|
+
key?: string | undefined;
|
|
539
539
|
syncRevision?: string | undefined;
|
|
540
540
|
identityRevision?: string | undefined;
|
|
541
541
|
}, {
|
|
542
|
-
key?: string | undefined;
|
|
543
542
|
enabled?: boolean | undefined;
|
|
543
|
+
key?: string | undefined;
|
|
544
544
|
syncRevision?: string | undefined;
|
|
545
545
|
identityRevision?: string | undefined;
|
|
546
546
|
}>;
|
|
@@ -553,31 +553,31 @@ declare const pluginCollectionImportSchema: z.ZodObject<{
|
|
|
553
553
|
text: z.ZodString;
|
|
554
554
|
metadata: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>;
|
|
555
555
|
}, "strict", z.ZodTypeAny, {
|
|
556
|
-
title: string;
|
|
557
556
|
text: string;
|
|
557
|
+
title: string;
|
|
558
558
|
externalId: string;
|
|
559
559
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
560
560
|
}, {
|
|
561
|
-
title: string;
|
|
562
561
|
text: string;
|
|
562
|
+
title: string;
|
|
563
563
|
externalId: string;
|
|
564
564
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
565
565
|
}>, "many">, {
|
|
566
|
-
title: string;
|
|
567
566
|
text: string;
|
|
567
|
+
title: string;
|
|
568
568
|
externalId: string;
|
|
569
569
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
570
570
|
}[], {
|
|
571
|
-
title: string;
|
|
572
571
|
text: string;
|
|
572
|
+
title: string;
|
|
573
573
|
externalId: string;
|
|
574
574
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
575
575
|
}[]>;
|
|
576
576
|
}, "strict", z.ZodTypeAny, {
|
|
577
577
|
key: string;
|
|
578
578
|
documents: {
|
|
579
|
-
title: string;
|
|
580
579
|
text: string;
|
|
580
|
+
title: string;
|
|
581
581
|
externalId: string;
|
|
582
582
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
583
583
|
}[];
|
|
@@ -585,8 +585,8 @@ declare const pluginCollectionImportSchema: z.ZodObject<{
|
|
|
585
585
|
}, {
|
|
586
586
|
key: string;
|
|
587
587
|
documents: {
|
|
588
|
-
title: string;
|
|
589
588
|
text: string;
|
|
589
|
+
title: string;
|
|
590
590
|
externalId: string;
|
|
591
591
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
592
592
|
}[];
|
|
@@ -688,8 +688,8 @@ declare const pluginCollectionDocumentContentSchema: z.ZodObject<{
|
|
|
688
688
|
page: z.ZodDefault<z.ZodNumber>;
|
|
689
689
|
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
690
690
|
}, "strict", z.ZodTypeAny, {
|
|
691
|
-
key: string;
|
|
692
691
|
page: number;
|
|
692
|
+
key: string;
|
|
693
693
|
externalId: string;
|
|
694
694
|
pageSize: number;
|
|
695
695
|
}, {
|
|
@@ -705,13 +705,13 @@ declare const pluginCollectionSearchSchema: z.ZodObject<{
|
|
|
705
705
|
/** Equality per key; an array matches any of its values. */
|
|
706
706
|
filter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>>>;
|
|
707
707
|
}, "strict", z.ZodTypeAny, {
|
|
708
|
-
key: string;
|
|
709
708
|
query: string;
|
|
709
|
+
key: string;
|
|
710
710
|
topK: number;
|
|
711
711
|
filter?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
712
712
|
}, {
|
|
713
|
-
key: string;
|
|
714
713
|
query: string;
|
|
714
|
+
key: string;
|
|
715
715
|
filter?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
716
716
|
topK?: number | undefined;
|
|
717
717
|
}>;
|
|
@@ -889,39 +889,39 @@ declare const pluginKnowledgeBaseInputSchema: z.ZodObject<{
|
|
|
889
889
|
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
890
890
|
}, "strict", z.ZodTypeAny, {
|
|
891
891
|
permission: "view" | "manage" | "use" | "operate";
|
|
892
|
-
subjectType: "
|
|
892
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
893
893
|
subjectId: string;
|
|
894
894
|
expiresAt?: string | null | undefined;
|
|
895
895
|
}, {
|
|
896
896
|
permission: "view" | "manage" | "use" | "operate";
|
|
897
|
-
subjectType: "
|
|
897
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
898
898
|
subjectId: string;
|
|
899
899
|
expiresAt?: string | null | undefined;
|
|
900
900
|
}>, "many">;
|
|
901
901
|
idempotencyKey: z.ZodString;
|
|
902
902
|
}, "strict", z.ZodTypeAny, {
|
|
903
|
+
name: string;
|
|
903
904
|
scope: {
|
|
904
905
|
type: "team";
|
|
905
906
|
teamId: string;
|
|
906
907
|
};
|
|
907
|
-
name: string;
|
|
908
908
|
grants: {
|
|
909
909
|
permission: "view" | "manage" | "use" | "operate";
|
|
910
|
-
subjectType: "
|
|
910
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
911
911
|
subjectId: string;
|
|
912
912
|
expiresAt?: string | null | undefined;
|
|
913
913
|
}[];
|
|
914
914
|
idempotencyKey: string;
|
|
915
915
|
description?: string | undefined;
|
|
916
916
|
}, {
|
|
917
|
+
name: string;
|
|
917
918
|
scope: {
|
|
918
919
|
type: "team";
|
|
919
920
|
teamId: string;
|
|
920
921
|
};
|
|
921
|
-
name: string;
|
|
922
922
|
grants: {
|
|
923
923
|
permission: "view" | "manage" | "use" | "operate";
|
|
924
|
-
subjectType: "
|
|
924
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
925
925
|
subjectId: string;
|
|
926
926
|
expiresAt?: string | null | undefined;
|
|
927
927
|
}[];
|
package/dist/server.d.ts
CHANGED
|
@@ -15,32 +15,32 @@ declare const accountInviteSchema: z.ZodEffects<z.ZodObject<{
|
|
|
15
15
|
requestId: string;
|
|
16
16
|
organizationName: string;
|
|
17
17
|
email?: string | undefined;
|
|
18
|
-
phone?: string | undefined;
|
|
19
18
|
username?: string | undefined;
|
|
19
|
+
phone?: string | undefined;
|
|
20
20
|
userId?: string | undefined;
|
|
21
21
|
fullName?: string | undefined;
|
|
22
22
|
}, {
|
|
23
23
|
requestId: string;
|
|
24
24
|
organizationName: string;
|
|
25
25
|
email?: string | undefined;
|
|
26
|
-
phone?: string | undefined;
|
|
27
26
|
username?: string | undefined;
|
|
27
|
+
phone?: string | undefined;
|
|
28
28
|
userId?: string | undefined;
|
|
29
29
|
fullName?: string | undefined;
|
|
30
30
|
}>, {
|
|
31
31
|
requestId: string;
|
|
32
32
|
organizationName: string;
|
|
33
33
|
email?: string | undefined;
|
|
34
|
-
phone?: string | undefined;
|
|
35
34
|
username?: string | undefined;
|
|
35
|
+
phone?: string | undefined;
|
|
36
36
|
userId?: string | undefined;
|
|
37
37
|
fullName?: string | undefined;
|
|
38
38
|
}, {
|
|
39
39
|
requestId: string;
|
|
40
40
|
organizationName: string;
|
|
41
41
|
email?: string | undefined;
|
|
42
|
-
phone?: string | undefined;
|
|
43
42
|
username?: string | undefined;
|
|
43
|
+
phone?: string | undefined;
|
|
44
44
|
userId?: string | undefined;
|
|
45
45
|
fullName?: string | undefined;
|
|
46
46
|
}>;
|
|
@@ -59,36 +59,36 @@ declare const accountProvisionSchema: z.ZodEffects<z.ZodObject<{
|
|
|
59
59
|
requestId: string;
|
|
60
60
|
organizationName: string;
|
|
61
61
|
email?: string | undefined;
|
|
62
|
-
phone?: string | undefined;
|
|
63
62
|
password?: string | undefined;
|
|
64
63
|
username?: string | undefined;
|
|
64
|
+
phone?: string | undefined;
|
|
65
65
|
userId?: string | undefined;
|
|
66
66
|
fullName?: string | undefined;
|
|
67
67
|
}, {
|
|
68
68
|
requestId: string;
|
|
69
69
|
organizationName: string;
|
|
70
70
|
email?: string | undefined;
|
|
71
|
-
phone?: string | undefined;
|
|
72
71
|
password?: string | undefined;
|
|
73
72
|
username?: string | undefined;
|
|
73
|
+
phone?: string | undefined;
|
|
74
74
|
userId?: string | undefined;
|
|
75
75
|
fullName?: string | undefined;
|
|
76
76
|
}>, {
|
|
77
77
|
requestId: string;
|
|
78
78
|
organizationName: string;
|
|
79
79
|
email?: string | undefined;
|
|
80
|
-
phone?: string | undefined;
|
|
81
80
|
password?: string | undefined;
|
|
82
81
|
username?: string | undefined;
|
|
82
|
+
phone?: string | undefined;
|
|
83
83
|
userId?: string | undefined;
|
|
84
84
|
fullName?: string | undefined;
|
|
85
85
|
}, {
|
|
86
86
|
requestId: string;
|
|
87
87
|
organizationName: string;
|
|
88
88
|
email?: string | undefined;
|
|
89
|
-
phone?: string | undefined;
|
|
90
89
|
password?: string | undefined;
|
|
91
90
|
username?: string | undefined;
|
|
91
|
+
phone?: string | undefined;
|
|
92
92
|
userId?: string | undefined;
|
|
93
93
|
fullName?: string | undefined;
|
|
94
94
|
}>;
|
|
@@ -445,13 +445,13 @@ declare const pluginCollectionEnsureSchema: z.ZodObject<{
|
|
|
445
445
|
/** @deprecated Accepted for older clients; reads use ordinary knowledge ACL. */
|
|
446
446
|
policyScope: z.ZodOptional<z.ZodString>;
|
|
447
447
|
}, "strict", z.ZodTypeAny, {
|
|
448
|
-
key: string;
|
|
449
448
|
name: string;
|
|
449
|
+
key: string;
|
|
450
450
|
accessMode?: "managed" | "private" | undefined;
|
|
451
451
|
policyScope?: string | undefined;
|
|
452
452
|
}, {
|
|
453
|
-
key: string;
|
|
454
453
|
name: string;
|
|
454
|
+
key: string;
|
|
455
455
|
accessMode?: "managed" | "private" | undefined;
|
|
456
456
|
policyScope?: string | undefined;
|
|
457
457
|
}>;
|
|
@@ -462,23 +462,23 @@ declare const pluginCollectionPermissionsSchema: z.ZodObject<{
|
|
|
462
462
|
subjectType: z.ZodEnum<["user", "team", "role", "tenant"]>;
|
|
463
463
|
subjectId: z.ZodString;
|
|
464
464
|
}, "strict", z.ZodTypeAny, {
|
|
465
|
-
subjectType: "
|
|
465
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
466
466
|
subjectId: string;
|
|
467
467
|
}, {
|
|
468
|
-
subjectType: "
|
|
468
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
469
469
|
subjectId: string;
|
|
470
470
|
}>, "many">;
|
|
471
471
|
}, "strict", z.ZodTypeAny, {
|
|
472
472
|
key: string;
|
|
473
473
|
grants: {
|
|
474
|
-
subjectType: "
|
|
474
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
475
475
|
subjectId: string;
|
|
476
476
|
}[];
|
|
477
477
|
syncRevision?: string | undefined;
|
|
478
478
|
}, {
|
|
479
479
|
key: string;
|
|
480
480
|
grants: {
|
|
481
|
-
subjectType: "
|
|
481
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
482
482
|
subjectId: string;
|
|
483
483
|
}[];
|
|
484
484
|
syncRevision?: string | undefined;
|
|
@@ -524,23 +524,23 @@ declare const pluginCollectionAccessSchema: z.ZodEffects<z.ZodObject<{
|
|
|
524
524
|
/** Identity snapshot returned by access({enabled:false}); required to resume. */
|
|
525
525
|
identityRevision: z.ZodOptional<z.ZodString>;
|
|
526
526
|
}, "strict", z.ZodTypeAny, {
|
|
527
|
-
key?: string | undefined;
|
|
528
527
|
enabled?: boolean | undefined;
|
|
528
|
+
key?: string | undefined;
|
|
529
529
|
syncRevision?: string | undefined;
|
|
530
530
|
identityRevision?: string | undefined;
|
|
531
531
|
}, {
|
|
532
|
-
key?: string | undefined;
|
|
533
532
|
enabled?: boolean | undefined;
|
|
533
|
+
key?: string | undefined;
|
|
534
534
|
syncRevision?: string | undefined;
|
|
535
535
|
identityRevision?: string | undefined;
|
|
536
536
|
}>, {
|
|
537
|
-
key?: string | undefined;
|
|
538
537
|
enabled?: boolean | undefined;
|
|
538
|
+
key?: string | undefined;
|
|
539
539
|
syncRevision?: string | undefined;
|
|
540
540
|
identityRevision?: string | undefined;
|
|
541
541
|
}, {
|
|
542
|
-
key?: string | undefined;
|
|
543
542
|
enabled?: boolean | undefined;
|
|
543
|
+
key?: string | undefined;
|
|
544
544
|
syncRevision?: string | undefined;
|
|
545
545
|
identityRevision?: string | undefined;
|
|
546
546
|
}>;
|
|
@@ -553,31 +553,31 @@ declare const pluginCollectionImportSchema: z.ZodObject<{
|
|
|
553
553
|
text: z.ZodString;
|
|
554
554
|
metadata: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>;
|
|
555
555
|
}, "strict", z.ZodTypeAny, {
|
|
556
|
-
title: string;
|
|
557
556
|
text: string;
|
|
557
|
+
title: string;
|
|
558
558
|
externalId: string;
|
|
559
559
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
560
560
|
}, {
|
|
561
|
-
title: string;
|
|
562
561
|
text: string;
|
|
562
|
+
title: string;
|
|
563
563
|
externalId: string;
|
|
564
564
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
565
565
|
}>, "many">, {
|
|
566
|
-
title: string;
|
|
567
566
|
text: string;
|
|
567
|
+
title: string;
|
|
568
568
|
externalId: string;
|
|
569
569
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
570
570
|
}[], {
|
|
571
|
-
title: string;
|
|
572
571
|
text: string;
|
|
572
|
+
title: string;
|
|
573
573
|
externalId: string;
|
|
574
574
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
575
575
|
}[]>;
|
|
576
576
|
}, "strict", z.ZodTypeAny, {
|
|
577
577
|
key: string;
|
|
578
578
|
documents: {
|
|
579
|
-
title: string;
|
|
580
579
|
text: string;
|
|
580
|
+
title: string;
|
|
581
581
|
externalId: string;
|
|
582
582
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
583
583
|
}[];
|
|
@@ -585,8 +585,8 @@ declare const pluginCollectionImportSchema: z.ZodObject<{
|
|
|
585
585
|
}, {
|
|
586
586
|
key: string;
|
|
587
587
|
documents: {
|
|
588
|
-
title: string;
|
|
589
588
|
text: string;
|
|
589
|
+
title: string;
|
|
590
590
|
externalId: string;
|
|
591
591
|
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
592
592
|
}[];
|
|
@@ -688,8 +688,8 @@ declare const pluginCollectionDocumentContentSchema: z.ZodObject<{
|
|
|
688
688
|
page: z.ZodDefault<z.ZodNumber>;
|
|
689
689
|
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
690
690
|
}, "strict", z.ZodTypeAny, {
|
|
691
|
-
key: string;
|
|
692
691
|
page: number;
|
|
692
|
+
key: string;
|
|
693
693
|
externalId: string;
|
|
694
694
|
pageSize: number;
|
|
695
695
|
}, {
|
|
@@ -705,13 +705,13 @@ declare const pluginCollectionSearchSchema: z.ZodObject<{
|
|
|
705
705
|
/** Equality per key; an array matches any of its values. */
|
|
706
706
|
filter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>>>;
|
|
707
707
|
}, "strict", z.ZodTypeAny, {
|
|
708
|
-
key: string;
|
|
709
708
|
query: string;
|
|
709
|
+
key: string;
|
|
710
710
|
topK: number;
|
|
711
711
|
filter?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
712
712
|
}, {
|
|
713
|
-
key: string;
|
|
714
713
|
query: string;
|
|
714
|
+
key: string;
|
|
715
715
|
filter?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
716
716
|
topK?: number | undefined;
|
|
717
717
|
}>;
|
|
@@ -889,39 +889,39 @@ declare const pluginKnowledgeBaseInputSchema: z.ZodObject<{
|
|
|
889
889
|
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
890
890
|
}, "strict", z.ZodTypeAny, {
|
|
891
891
|
permission: "view" | "manage" | "use" | "operate";
|
|
892
|
-
subjectType: "
|
|
892
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
893
893
|
subjectId: string;
|
|
894
894
|
expiresAt?: string | null | undefined;
|
|
895
895
|
}, {
|
|
896
896
|
permission: "view" | "manage" | "use" | "operate";
|
|
897
|
-
subjectType: "
|
|
897
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
898
898
|
subjectId: string;
|
|
899
899
|
expiresAt?: string | null | undefined;
|
|
900
900
|
}>, "many">;
|
|
901
901
|
idempotencyKey: z.ZodString;
|
|
902
902
|
}, "strict", z.ZodTypeAny, {
|
|
903
|
+
name: string;
|
|
903
904
|
scope: {
|
|
904
905
|
type: "team";
|
|
905
906
|
teamId: string;
|
|
906
907
|
};
|
|
907
|
-
name: string;
|
|
908
908
|
grants: {
|
|
909
909
|
permission: "view" | "manage" | "use" | "operate";
|
|
910
|
-
subjectType: "
|
|
910
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
911
911
|
subjectId: string;
|
|
912
912
|
expiresAt?: string | null | undefined;
|
|
913
913
|
}[];
|
|
914
914
|
idempotencyKey: string;
|
|
915
915
|
description?: string | undefined;
|
|
916
916
|
}, {
|
|
917
|
+
name: string;
|
|
917
918
|
scope: {
|
|
918
919
|
type: "team";
|
|
919
920
|
teamId: string;
|
|
920
921
|
};
|
|
921
|
-
name: string;
|
|
922
922
|
grants: {
|
|
923
923
|
permission: "view" | "manage" | "use" | "operate";
|
|
924
|
-
subjectType: "
|
|
924
|
+
subjectType: "user" | "team" | "tenant" | "role";
|
|
925
925
|
subjectId: string;
|
|
926
926
|
expiresAt?: string | null | undefined;
|
|
927
927
|
}[];
|