@kweaver-ai/kweaver-sdk 0.5.0 → 0.5.2

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.
Files changed (66) hide show
  1. package/README.md +6 -1
  2. package/README.zh.md +5 -0
  3. package/dist/api/agent-chat.d.ts +1 -1
  4. package/dist/api/agent-chat.js +4 -4
  5. package/dist/api/agent-list.d.ts +35 -0
  6. package/dist/api/agent-list.js +86 -12
  7. package/dist/api/bkn-backend.d.ts +60 -0
  8. package/dist/api/bkn-backend.js +103 -10
  9. package/dist/api/conversations.d.ts +6 -3
  10. package/dist/api/conversations.js +26 -27
  11. package/dist/api/dataflow.js +1 -10
  12. package/dist/api/datasources.js +1 -10
  13. package/dist/api/dataviews.js +1 -10
  14. package/dist/api/headers.d.ts +9 -0
  15. package/dist/api/headers.js +25 -0
  16. package/dist/api/knowledge-networks.d.ts +41 -0
  17. package/dist/api/knowledge-networks.js +69 -22
  18. package/dist/api/ontology-query.d.ts +14 -1
  19. package/dist/api/ontology-query.js +63 -49
  20. package/dist/api/semantic-search.js +2 -12
  21. package/dist/api/skills.d.ts +141 -0
  22. package/dist/api/skills.js +216 -0
  23. package/dist/api/vega.d.ts +63 -0
  24. package/dist/api/vega.js +131 -10
  25. package/dist/auth/oauth.d.ts +5 -1
  26. package/dist/auth/oauth.js +293 -94
  27. package/dist/cli.js +29 -4
  28. package/dist/client.d.ts +3 -0
  29. package/dist/client.js +4 -0
  30. package/dist/commands/agent.d.ts +33 -1
  31. package/dist/commands/agent.js +721 -49
  32. package/dist/commands/auth.js +211 -21
  33. package/dist/commands/bkn-ops.d.ts +77 -0
  34. package/dist/commands/bkn-ops.js +1056 -0
  35. package/dist/commands/bkn-query.d.ts +14 -0
  36. package/dist/commands/bkn-query.js +370 -0
  37. package/dist/commands/bkn-schema.d.ts +135 -0
  38. package/dist/commands/bkn-schema.js +1461 -0
  39. package/dist/commands/bkn-utils.d.ts +36 -0
  40. package/dist/commands/bkn-utils.js +102 -0
  41. package/dist/commands/bkn.d.ts +7 -113
  42. package/dist/commands/bkn.js +175 -2429
  43. package/dist/commands/dataview.d.ts +7 -0
  44. package/dist/commands/dataview.js +38 -2
  45. package/dist/commands/ds.d.ts +1 -0
  46. package/dist/commands/ds.js +8 -1
  47. package/dist/commands/import-csv.d.ts +2 -0
  48. package/dist/commands/import-csv.js +3 -2
  49. package/dist/commands/skill.d.ts +26 -0
  50. package/dist/commands/skill.js +524 -0
  51. package/dist/commands/vega.js +371 -14
  52. package/dist/config/jwt.d.ts +6 -0
  53. package/dist/config/jwt.js +21 -0
  54. package/dist/config/store.d.ts +37 -5
  55. package/dist/config/store.js +363 -30
  56. package/dist/index.d.ts +6 -1
  57. package/dist/index.js +5 -1
  58. package/dist/resources/bkn.d.ts +4 -0
  59. package/dist/resources/bkn.js +4 -0
  60. package/dist/resources/conversations.d.ts +5 -2
  61. package/dist/resources/conversations.js +17 -3
  62. package/dist/resources/skills.d.ts +47 -0
  63. package/dist/resources/skills.js +47 -0
  64. package/dist/resources/vega.d.ts +11 -0
  65. package/dist/resources/vega.js +37 -1
  66. package/package.json +1 -1
@@ -0,0 +1,47 @@
1
+ import type { ClientContext } from "../client.js";
2
+ import { type SkillListResult, type SkillStatus } from "../api/skills.js";
3
+ export declare class SkillsResource {
4
+ private readonly ctx;
5
+ constructor(ctx: ClientContext);
6
+ list(opts?: {
7
+ page?: number;
8
+ pageSize?: number;
9
+ sortBy?: "create_time" | "update_time" | "name";
10
+ sortOrder?: "asc" | "desc";
11
+ all?: boolean;
12
+ name?: string;
13
+ status?: SkillStatus;
14
+ source?: string;
15
+ createUser?: string;
16
+ }): Promise<SkillListResult>;
17
+ market(opts?: {
18
+ page?: number;
19
+ pageSize?: number;
20
+ sortBy?: "create_time" | "update_time" | "name";
21
+ sortOrder?: "asc" | "desc";
22
+ all?: boolean;
23
+ name?: string;
24
+ source?: string;
25
+ }): Promise<SkillListResult>;
26
+ get(skillId: string): Promise<import("../api/skills.js").SkillInfo>;
27
+ registerContent(content: string, opts?: {
28
+ source?: string;
29
+ extendInfo?: Record<string, unknown>;
30
+ }): Promise<import("../api/skills.js").RegisterSkillResult>;
31
+ registerZip(filename: string, bytes: Uint8Array, opts?: {
32
+ source?: string;
33
+ extendInfo?: Record<string, unknown>;
34
+ }): Promise<import("../api/skills.js").RegisterSkillResult>;
35
+ delete(skillId: string): Promise<import("../api/skills.js").DeleteSkillResult>;
36
+ updateStatus(skillId: string, status: SkillStatus): Promise<import("../api/skills.js").UpdateSkillStatusResult>;
37
+ content(skillId: string): Promise<import("../api/skills.js").SkillContentIndex>;
38
+ fetchContent(skillId: string): Promise<string>;
39
+ readFile(skillId: string, relPath: string): Promise<import("../api/skills.js").SkillFileReadResult>;
40
+ fetchFile(skillId: string, relPath: string): Promise<Uint8Array<ArrayBufferLike>>;
41
+ download(skillId: string): Promise<import("../api/skills.js").DownloadedSkillArchive>;
42
+ install(skillId: string, directory: string, opts?: {
43
+ force?: boolean;
44
+ }): Promise<{
45
+ directory: string;
46
+ }>;
47
+ }
@@ -0,0 +1,47 @@
1
+ import { deleteSkill, downloadSkill, fetchSkillContent, fetchSkillFile, getSkill, getSkillContentIndex, installSkillArchive, listSkillMarket, listSkills, readSkillFile, registerSkillContent, registerSkillZip, updateSkillStatus, } from "../api/skills.js";
2
+ export class SkillsResource {
3
+ ctx;
4
+ constructor(ctx) {
5
+ this.ctx = ctx;
6
+ }
7
+ async list(opts = {}) {
8
+ return listSkills({ ...this.ctx.base(), pageSize: 30, ...opts });
9
+ }
10
+ async market(opts = {}) {
11
+ return listSkillMarket({ ...this.ctx.base(), pageSize: 30, ...opts });
12
+ }
13
+ async get(skillId) {
14
+ return getSkill({ ...this.ctx.base(), skillId });
15
+ }
16
+ async registerContent(content, opts = {}) {
17
+ return registerSkillContent({ ...this.ctx.base(), content, ...opts });
18
+ }
19
+ async registerZip(filename, bytes, opts = {}) {
20
+ return registerSkillZip({ ...this.ctx.base(), filename, bytes, ...opts });
21
+ }
22
+ async delete(skillId) {
23
+ return deleteSkill({ ...this.ctx.base(), skillId });
24
+ }
25
+ async updateStatus(skillId, status) {
26
+ return updateSkillStatus({ ...this.ctx.base(), skillId, status });
27
+ }
28
+ async content(skillId) {
29
+ return getSkillContentIndex({ ...this.ctx.base(), skillId });
30
+ }
31
+ async fetchContent(skillId) {
32
+ return fetchSkillContent({ ...this.ctx.base(), skillId });
33
+ }
34
+ async readFile(skillId, relPath) {
35
+ return readSkillFile({ ...this.ctx.base(), skillId, relPath });
36
+ }
37
+ async fetchFile(skillId, relPath) {
38
+ return fetchSkillFile({ ...this.ctx.base(), skillId, relPath });
39
+ }
40
+ async download(skillId) {
41
+ return downloadSkill({ ...this.ctx.base(), skillId });
42
+ }
43
+ async install(skillId, directory, opts = {}) {
44
+ const archive = await this.download(skillId);
45
+ return installSkillArchive({ bytes: archive.bytes, directory, force: opts.force });
46
+ }
47
+ }
@@ -40,6 +40,17 @@ export declare class VegaResource {
40
40
  createResource(body: string): Promise<unknown>;
41
41
  updateResource(id: string, body: string): Promise<unknown>;
42
42
  deleteResources(ids: string): Promise<unknown>;
43
+ createDatasetDocs(id: string, body: string): Promise<unknown>;
44
+ updateDatasetDocs(id: string, body: string): Promise<unknown>;
45
+ deleteDatasetDocs(id: string, docIds: string): Promise<unknown>;
46
+ deleteDatasetDocsQuery(id: string, body: string): Promise<unknown>;
47
+ buildDataset(id: string, mode?: string): Promise<unknown>;
48
+ getDatasetBuildStatus(id: string, taskId: string): Promise<unknown>;
49
+ executeQuery(body: string): Promise<unknown>;
50
+ listAllResources(opts?: {
51
+ limit?: number;
52
+ offset?: number;
53
+ }): Promise<unknown[]>;
43
54
  listConnectorTypes(): Promise<unknown[]>;
44
55
  getConnectorType(type: string): Promise<unknown>;
45
56
  registerConnectorType(body: string): Promise<unknown>;
@@ -1,4 +1,4 @@
1
- import { vegaHealth, listVegaCatalogs, getVegaCatalog, createVegaCatalog, updateVegaCatalog, deleteVegaCatalogs, vegaCatalogHealthStatus, testVegaCatalogConnection, discoverVegaCatalog, listVegaCatalogResources, listVegaResources, getVegaResource, queryVegaResourceData, createVegaResource, updateVegaResource, deleteVegaResources, listVegaConnectorTypes, getVegaConnectorType, registerVegaConnectorType, updateVegaConnectorType, deleteVegaConnectorType, setVegaConnectorTypeEnabled, listVegaDiscoverTasks, getVegaDiscoverTask, } from "../api/vega.js";
1
+ import { vegaHealth, listVegaCatalogs, getVegaCatalog, createVegaCatalog, updateVegaCatalog, deleteVegaCatalogs, vegaCatalogHealthStatus, testVegaCatalogConnection, discoverVegaCatalog, listVegaCatalogResources, listVegaResources, getVegaResource, queryVegaResourceData, createVegaResource, updateVegaResource, deleteVegaResources, createVegaDatasetDocs, updateVegaDatasetDocs, deleteVegaDatasetDocs, deleteVegaDatasetDocsQuery, buildVegaDataset, getVegaDatasetBuildStatus, executeVegaQuery, listAllVegaResources, listVegaConnectorTypes, getVegaConnectorType, registerVegaConnectorType, updateVegaConnectorType, deleteVegaConnectorType, setVegaConnectorTypeEnabled, listVegaDiscoverTasks, getVegaDiscoverTask, } from "../api/vega.js";
2
2
  function unwrapArray(raw) {
3
3
  const parsed = JSON.parse(raw);
4
4
  if (Array.isArray(parsed))
@@ -83,6 +83,42 @@ export class VegaResource {
83
83
  const raw = await deleteVegaResources({ ...this.ctx.base(), ids });
84
84
  return raw ? JSON.parse(raw) : {};
85
85
  }
86
+ // ── Dataset Docs ────────────────────────────────────────────────────────────
87
+ async createDatasetDocs(id, body) {
88
+ const raw = await createVegaDatasetDocs({ ...this.ctx.base(), id, body });
89
+ return JSON.parse(raw);
90
+ }
91
+ async updateDatasetDocs(id, body) {
92
+ const raw = await updateVegaDatasetDocs({ ...this.ctx.base(), id, body });
93
+ return raw ? JSON.parse(raw) : {};
94
+ }
95
+ async deleteDatasetDocs(id, docIds) {
96
+ const raw = await deleteVegaDatasetDocs({ ...this.ctx.base(), id, docIds });
97
+ return raw ? JSON.parse(raw) : {};
98
+ }
99
+ async deleteDatasetDocsQuery(id, body) {
100
+ const raw = await deleteVegaDatasetDocsQuery({ ...this.ctx.base(), id, body });
101
+ return raw ? JSON.parse(raw) : {};
102
+ }
103
+ // ── Dataset Build ──────────────────────────────────────────────────────────
104
+ async buildDataset(id, mode) {
105
+ const raw = await buildVegaDataset({ ...this.ctx.base(), id, mode });
106
+ return JSON.parse(raw);
107
+ }
108
+ async getDatasetBuildStatus(id, taskId) {
109
+ const raw = await getVegaDatasetBuildStatus({ ...this.ctx.base(), id, taskId });
110
+ return JSON.parse(raw);
111
+ }
112
+ // ── Query ──────────────────────────────────────────────────────────────────
113
+ async executeQuery(body) {
114
+ const raw = await executeVegaQuery({ ...this.ctx.base(), body });
115
+ return JSON.parse(raw);
116
+ }
117
+ // ── Resource List All ──────────────────────────────────────────────────────
118
+ async listAllResources(opts = {}) {
119
+ const raw = await listAllVegaResources({ ...this.ctx.base(), ...opts });
120
+ return unwrapArray(raw);
121
+ }
86
122
  // ── Connector Types ─────────────────────────────────────────────────────────
87
123
  async listConnectorTypes() {
88
124
  const raw = await listVegaConnectorTypes(this.ctx.base());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kweaver-ai/kweaver-sdk",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "KWeaver TypeScript SDK — CLI tool and programmatic API for knowledge networks and Decision Agents.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",