@inkeep/agents-cli 0.14.16 → 0.15.0

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 (2) hide show
  1. package/dist/index.js +41 -23
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -2639,9 +2639,15 @@ var init_schemas = __esm({
2639
2639
  updatedAt: true
2640
2640
  });
2641
2641
  ContextConfigUpdateSchema = ContextConfigInsertSchema.partial();
2642
- ContextConfigApiSelectSchema = createApiSchema(ContextConfigSelectSchema);
2643
- ContextConfigApiInsertSchema = createApiInsertSchema(ContextConfigInsertSchema);
2644
- ContextConfigApiUpdateSchema = createApiUpdateSchema(ContextConfigUpdateSchema);
2642
+ ContextConfigApiSelectSchema = createApiSchema(ContextConfigSelectSchema).omit({
2643
+ graphId: true
2644
+ });
2645
+ ContextConfigApiInsertSchema = createApiInsertSchema(ContextConfigInsertSchema).omit({
2646
+ graphId: true
2647
+ });
2648
+ ContextConfigApiUpdateSchema = createApiUpdateSchema(ContextConfigUpdateSchema).omit({
2649
+ graphId: true
2650
+ });
2645
2651
  AgentToolRelationSelectSchema = createSelectSchema(agentToolRelations);
2646
2652
  AgentToolRelationInsertSchema = createInsertSchema(agentToolRelations).extend({
2647
2653
  id: resourceIdSchema,
@@ -13635,7 +13641,6 @@ var init_projectFull = __esm({
13635
13641
  init_logger();
13636
13642
  init_agentGraphs();
13637
13643
  init_artifactComponents();
13638
- init_contextConfigs();
13639
13644
  init_credentialReferences();
13640
13645
  init_dataComponents();
13641
13646
  init_graphFull2();
@@ -20917,14 +20922,15 @@ ${errorText}`);
20917
20922
  const projectId = projectIdOverride || "";
20918
20923
  return new _ExecutionApiClient(resolvedApiUrl, tenantId, projectId, config.agentsRunApiKey);
20919
20924
  }
20920
- async chatCompletion(graphId, messages2, conversationId) {
20925
+ async chatCompletion(graphId, messages2, conversationId, emitOperations) {
20921
20926
  const response = await this.authenticatedFetch(`${this.apiUrl}/v1/chat/completions`, {
20922
20927
  method: "POST",
20923
20928
  headers: {
20924
20929
  Accept: "text/event-stream",
20925
20930
  "x-inkeep-tenant-id": this.tenantId || "test-tenant-id",
20926
20931
  "x-inkeep-project-id": this.projectId,
20927
- "x-inkeep-graph-id": graphId
20932
+ "x-inkeep-graph-id": graphId,
20933
+ ...emitOperations && { "x-emit-operations": "true" }
20928
20934
  },
20929
20935
  body: JSON.stringify({
20930
20936
  model: "gpt-4o-mini",
@@ -21108,9 +21114,9 @@ async function chatCommandEnhanced(graphIdInput, options) {
21108
21114
  });
21109
21115
  const conversationId = `cli-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
21110
21116
  const messages2 = [];
21111
- let debugMode = false;
21117
+ let emitOperations = false;
21112
21118
  console.log(chalk9.gray('\n\u{1F4AC} Chat session started. Type "exit" or press Ctrl+C to quit.'));
21113
- console.log(chalk9.gray("Commands: help, clear, history, reset, debug\n"));
21119
+ console.log(chalk9.gray("Commands: help, clear, history, reset, operations\n"));
21114
21120
  async function handleStreamingResponse(stream, showDebug = false) {
21115
21121
  const decoder = new TextDecoder();
21116
21122
  const reader = stream.getReader();
@@ -21154,19 +21160,24 @@ async function chatCommandEnhanced(graphIdInput, options) {
21154
21160
  debugOperations.push(dataOp);
21155
21161
  if (showDebug && dataOp.type === "data-operation") {
21156
21162
  const opType = dataOp.data?.type || "unknown";
21157
- const ctx = dataOp.data?.ctx || {};
21158
- let ctxDisplay = "";
21159
- if (opType === "agent_thinking" || opType === "iteration_start") {
21160
- ctxDisplay = ctx.agent || JSON.stringify(ctx);
21161
- } else if (opType === "task_creation") {
21162
- ctxDisplay = `agent: ${ctx.agent}`;
21163
+ const label = dataOp.data?.label || "Unknown operation";
21164
+ const details = dataOp.data?.details || {};
21165
+ const agentId = details.agentId || "unknown-agent";
21166
+ let displayText = "";
21167
+ if (opType === "completion") {
21168
+ displayText = `${label} (agent: ${agentId})`;
21169
+ } else if (opType === "tool_execution") {
21170
+ const toolData = details.data || {};
21171
+ displayText = `${label} - ${toolData.toolName || "unknown tool"}`;
21172
+ } else if (opType === "agent_generate" || opType === "agent_reasoning") {
21173
+ displayText = `${label}`;
21163
21174
  } else {
21164
- ctxDisplay = JSON.stringify(ctx);
21175
+ displayText = `${label} (${agentId})`;
21165
21176
  }
21166
21177
  if (opType === "completion" && hasStartedResponse) {
21167
21178
  console.log("");
21168
21179
  }
21169
- console.log(chalk9.gray(` [${opType}] ${ctxDisplay}`));
21180
+ console.log(chalk9.gray(` [${opType}] ${displayText}`));
21170
21181
  }
21171
21182
  currentPos = jsonEnd;
21172
21183
  } catch {
@@ -21225,17 +21236,19 @@ async function chatCommandEnhanced(graphIdInput, options) {
21225
21236
  console.log(chalk9.gray(" \u2022 clear - Clear the screen (preserves context)"));
21226
21237
  console.log(chalk9.gray(" \u2022 history - Show conversation history"));
21227
21238
  console.log(chalk9.gray(" \u2022 reset - Reset conversation context"));
21228
- console.log(chalk9.gray(" \u2022 debug - Toggle debug mode (show/hide data operations)"));
21239
+ console.log(
21240
+ chalk9.gray(" \u2022 operations - Toggle emit operations (show/hide data operations)")
21241
+ );
21229
21242
  console.log(chalk9.gray(" \u2022 help - Show this help message"));
21230
21243
  console.log(chalk9.gray("\n Commands can be prefixed with / (e.g., /help)\n"));
21231
21244
  rl.prompt();
21232
21245
  return;
21233
21246
  }
21234
- if (command === "debug") {
21235
- debugMode = !debugMode;
21247
+ if (command === "operations") {
21248
+ emitOperations = !emitOperations;
21236
21249
  console.log(chalk9.yellow(`
21237
- \u{1F527} Debug mode: ${debugMode ? "ON" : "OFF"}`));
21238
- if (debugMode) {
21250
+ \u{1F527} Data operations: ${emitOperations ? "ON" : "OFF"}`));
21251
+ if (emitOperations) {
21239
21252
  console.log(chalk9.gray("Data operations will be shown during responses.\n"));
21240
21253
  } else {
21241
21254
  console.log(chalk9.gray("Data operations are hidden.\n"));
@@ -21272,13 +21285,18 @@ async function chatCommandEnhanced(graphIdInput, options) {
21272
21285
  messages2.push({ role: "user", content: trimmedInput });
21273
21286
  try {
21274
21287
  if (!graphId) throw new Error("No graph selected");
21275
- const response = await executionApi.chatCompletion(graphId, messages2, conversationId);
21288
+ const response = await executionApi.chatCompletion(
21289
+ graphId,
21290
+ messages2,
21291
+ conversationId,
21292
+ emitOperations
21293
+ );
21276
21294
  let assistantResponse;
21277
21295
  if (typeof response === "string") {
21278
21296
  console.log(chalk9.green("Assistant>"), response);
21279
21297
  assistantResponse = response;
21280
21298
  } else {
21281
- assistantResponse = await handleStreamingResponse(response, debugMode);
21299
+ assistantResponse = await handleStreamingResponse(response, emitOperations);
21282
21300
  }
21283
21301
  messages2.push({ role: "assistant", content: assistantResponse });
21284
21302
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-cli",
3
- "version": "0.14.16",
3
+ "version": "0.15.0",
4
4
  "description": "Inkeep CLI tool",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -45,8 +45,8 @@
45
45
  "recast": "^0.23.0",
46
46
  "ts-morph": "^26.0.0",
47
47
  "tsx": "^4.20.5",
48
- "@inkeep/agents-sdk": "^0.14.16",
49
- "@inkeep/agents-core": "^0.14.16"
48
+ "@inkeep/agents-sdk": "^0.15.0",
49
+ "@inkeep/agents-core": "^0.15.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/degit": "^2.8.6",