@kweaver-ai/kweaver-sdk 0.8.2 → 0.8.3

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 (40) hide show
  1. package/README.md +26 -52
  2. package/README.zh.md +27 -46
  3. package/dist/api/resources.d.ts +94 -0
  4. package/dist/api/resources.js +166 -0
  5. package/dist/cli.js +102 -10
  6. package/dist/client.d.ts +3 -3
  7. package/dist/client.js +5 -5
  8. package/dist/commands/agent-members.js +27 -11
  9. package/dist/commands/agent.js +383 -272
  10. package/dist/commands/auth.js +184 -71
  11. package/dist/commands/bkn-metric.js +37 -16
  12. package/dist/commands/bkn-ops.js +164 -86
  13. package/dist/commands/bkn-query.js +99 -31
  14. package/dist/commands/bkn-schema.d.ts +3 -3
  15. package/dist/commands/bkn-schema.js +127 -86
  16. package/dist/commands/bkn.js +153 -114
  17. package/dist/commands/call.js +23 -13
  18. package/dist/commands/config.js +22 -12
  19. package/dist/commands/context-loader.js +98 -92
  20. package/dist/commands/dataflow.js +14 -6
  21. package/dist/commands/ds.js +52 -30
  22. package/dist/commands/explore.js +18 -15
  23. package/dist/commands/model.js +53 -42
  24. package/dist/commands/resource.d.ts +1 -0
  25. package/dist/commands/{dataview.js → resource.js} +62 -84
  26. package/dist/commands/skill.js +201 -65
  27. package/dist/commands/token.js +11 -0
  28. package/dist/commands/tool.js +46 -29
  29. package/dist/commands/toolbox.js +31 -15
  30. package/dist/commands/vega.js +466 -250
  31. package/dist/help/format.d.ts +65 -0
  32. package/dist/help/format.js +141 -0
  33. package/dist/index.d.ts +3 -3
  34. package/dist/index.js +2 -2
  35. package/dist/resources/{dataviews.d.ts → resources.d.ts} +10 -11
  36. package/dist/resources/{dataviews.js → resources.js} +12 -13
  37. package/package.json +1 -1
  38. package/dist/api/dataviews.d.ts +0 -117
  39. package/dist/api/dataviews.js +0 -265
  40. package/dist/commands/dataview.d.ts +0 -8
package/dist/client.js CHANGED
@@ -8,7 +8,7 @@ import { ConversationsResource } from "./resources/conversations.js";
8
8
  import { ContextLoaderResource } from "./resources/context-loader.js";
9
9
  import { DataflowsResource } from "./resources/dataflows.js";
10
10
  import { DataSourcesResource } from "./resources/datasources.js";
11
- import { DataViewsResource } from "./resources/dataviews.js";
11
+ import { ResourcesResource } from "./resources/resources.js";
12
12
  import { KnowledgeNetworksResource } from "./resources/knowledge-networks.js";
13
13
  import { BknResource } from "./resources/bkn.js";
14
14
  import { SkillsResource } from "./resources/skills.js";
@@ -60,8 +60,8 @@ export class KWeaverClient {
60
60
  dataflows;
61
61
  /** Data source management (connect, test, list tables). */
62
62
  datasources;
63
- /** Data view creation and retrieval. */
64
- dataviews;
63
+ /** Vega-backend resource management (table/logicview resources under a catalog). */
64
+ resources;
65
65
  /** Vega observability platform (catalogs, resources, connector types). */
66
66
  vega;
67
67
  /** ADP/KWeaver skill registry, market, progressive read, and install helpers. */
@@ -100,7 +100,7 @@ export class KWeaverClient {
100
100
  this.conversations = new ConversationsResource(this);
101
101
  this.dataflows = new DataflowsResource(this);
102
102
  this.datasources = new DataSourcesResource(this);
103
- this.dataviews = new DataViewsResource(this);
103
+ this.resources = new ResourcesResource(this);
104
104
  this.vega = new VegaResource(this);
105
105
  this.skills = new SkillsResource(this);
106
106
  this.toolboxes = new ToolboxesResource(this);
@@ -156,7 +156,7 @@ export class KWeaverClient {
156
156
  this.conversations = new ConversationsResource(this);
157
157
  this.dataflows = new DataflowsResource(this);
158
158
  this.datasources = new DataSourcesResource(this);
159
- this.dataviews = new DataViewsResource(this);
159
+ this.resources = new ResourcesResource(this);
160
160
  this.vega = new VegaResource(this);
161
161
  this.skills = new SkillsResource(this);
162
162
  this.toolboxes = new ToolboxesResource(this);
@@ -6,6 +6,7 @@ import { getAgent, updateAgent } from "../api/agent-list.js";
6
6
  import { getSkill } from "../api/skills.js";
7
7
  import { ensureValidToken, formatHttpError } from "../auth/oauth.js";
8
8
  import { resolveBusinessDomain } from "../config/store.js";
9
+ import { renderHelp } from "../help/format.js";
9
10
  /** Deep-clone a JSON-serializable object so mutations don't leak to callers. */
10
11
  function clone(value) {
11
12
  return JSON.parse(JSON.stringify(value));
@@ -353,17 +354,32 @@ async function runSkillList(args) {
353
354
  export async function runAgentSkillCommand(args) {
354
355
  const [verb, ...rest] = args;
355
356
  if (!verb || verb === "--help" || verb === "-h") {
356
- console.log(`kweaver agent skill
357
-
358
- Subcommands:
359
- add <agent-id> <skill-id>... [--strict] [-bd <bd>] Attach skills to an agent
360
- remove <agent-id> <skill-id>... [-bd <bd>] Detach skills from an agent
361
- list <agent-id> [--pretty|--compact] [-bd <bd>] List skills attached to an agent
362
-
363
- Notes:
364
- --strict On add, reject skills that exist but are not in 'published' status.
365
- Default behaviour: warn and continue.
366
- Dedupe is automatic for add; remove silently skips not-attached ids.`);
357
+ console.log(renderHelp({
358
+ tagline: "Manage skills attached to an agent",
359
+ usage: "kweaver agent skill <subcommand> [flags]",
360
+ sections: [{
361
+ title: "AVAILABLE COMMANDS",
362
+ items: [
363
+ { name: "add", desc: "Attach skills to an agent" },
364
+ { name: "remove", desc: "Detach skills from an agent" },
365
+ { name: "list", desc: "List skills attached to an agent" },
366
+ ],
367
+ }],
368
+ flags: [
369
+ { name: "--strict", desc: "On add, reject skills that exist but are not in 'published' status. Default behaviour: warn and continue." },
370
+ { name: "-bd <bd>", desc: "Business domain" },
371
+ { name: "--pretty|--compact", desc: "Output formatting for list" },
372
+ ],
373
+ inheritedFlags: "--base-url, --token, --user, --help",
374
+ examples: [
375
+ "kweaver agent skill add <agent-id> <skill-id>... [--strict] [-bd <bd>]",
376
+ "kweaver agent skill remove <agent-id> <skill-id>... [-bd <bd>]",
377
+ "kweaver agent skill list <agent-id> [--pretty|--compact] [-bd <bd>]",
378
+ ],
379
+ learnMore: [
380
+ "Dedupe is automatic for add; remove silently skips not-attached ids.",
381
+ ],
382
+ }));
367
383
  return 0;
368
384
  }
369
385
  try {