@integrity-labs/agt-cli 0.28.893 → 0.28.895

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/mcp/index.js CHANGED
@@ -45008,6 +45008,73 @@ function truncate(text, max) {
45008
45008
  return text.length > max ? `${text.slice(0, max)}\u2026` : text;
45009
45009
  }
45010
45010
 
45011
+ // src/integration-improve-render.ts
45012
+ function fenceFor(...values) {
45013
+ let longest = 0;
45014
+ for (const value of values) {
45015
+ for (const run of value.match(/`+/g) ?? []) longest = Math.max(longest, run.length);
45016
+ }
45017
+ return "`".repeat(Math.max(3, longest + 1));
45018
+ }
45019
+ function renderImproveResponse(data) {
45020
+ const typedChanges = data.proposed.changed_fields ?? [];
45021
+ const overridesChanged = !!data.proposed.appended_to_overrides;
45022
+ const nothingChanged = typedChanges.length === 0 && !overridesChanged;
45023
+ const lines = [];
45024
+ lines.push(data.applied ? "\u2705 Applied integration context update" : "\u{1F4CB} Proposed integration context update (preview)");
45025
+ lines.push("");
45026
+ lines.push(`Rationale: ${data.proposed.rationale}`);
45027
+ if (typedChanges.length > 0) {
45028
+ lines.push("");
45029
+ lines.push("## Typed field changes");
45030
+ for (const field of typedChanges) {
45031
+ const before = JSON.stringify(data.current.values[field] ?? null);
45032
+ const after = JSON.stringify(data.proposed.values[field] ?? null);
45033
+ lines.push(`- \`${field}\`: ${before} \u2192 ${after}`);
45034
+ }
45035
+ }
45036
+ if (overridesChanged) {
45037
+ lines.push("");
45038
+ lines.push("## Overrides change");
45039
+ const note = data.proposed.overrides_append;
45040
+ if (typeof note === "string" && note.length > 0) {
45041
+ lines.push("Appending this note. The existing overrides text is kept exactly as it is:");
45042
+ const fence = fenceFor(note);
45043
+ lines.push(fence);
45044
+ lines.push(note);
45045
+ lines.push(fence);
45046
+ } else {
45047
+ const fence = fenceFor(data.current.overrides ?? "", data.proposed.overrides ?? "");
45048
+ lines.push("Before:");
45049
+ lines.push(fence);
45050
+ lines.push(data.current.overrides || "(empty)");
45051
+ lines.push(fence);
45052
+ lines.push("After:");
45053
+ lines.push(fence);
45054
+ lines.push(data.proposed.overrides || "(empty)");
45055
+ lines.push(fence);
45056
+ }
45057
+ }
45058
+ if (nothingChanged) {
45059
+ lines.push("");
45060
+ lines.push("## No change proposed");
45061
+ lines.push(
45062
+ data.applied ? "Nothing was changed: no typed field changes and nothing added to the overrides." : "Nothing to apply: no typed field changes and nothing to add to the overrides. The rationale above says why."
45063
+ );
45064
+ }
45065
+ if (!data.applied) {
45066
+ if (!nothingChanged) {
45067
+ lines.push("");
45068
+ lines.push("---");
45069
+ lines.push("Show this diff to the user. If they confirm, call `integration_improve` again with `auto_apply: true` and the same arguments to apply.");
45070
+ }
45071
+ } else if (!nothingChanged) {
45072
+ lines.push("");
45073
+ lines.push("Update applied. The manager will re-render the integration's SKILL.md files on the next refresh cycle.");
45074
+ }
45075
+ return lines.join("\n");
45076
+ }
45077
+
45011
45078
  // src/kanban-list-render.ts
45012
45079
  var KANBAN_LIST_DISPLAY_ORDER = [
45013
45080
  "in_progress",
@@ -48858,7 +48925,7 @@ server.tool(
48858
48925
  // Description leads with the user phrasings the agent should match against,
48859
48926
  // then explains the safety rule. Order matters — Claude\'s tool selection
48860
48927
  // weights the first line of a description heavily.
48861
- `Update, edit, or add a rule to an installed integration (e.g. the Coding integration, the Knowledge Base integration, the Slack integration). USE THIS TOOL when the user says any of: "update the X integration", "add a rule to integration Y", "tell the X integration not to do Z", "change the X integration so it does Y", "the Coding integration should always/never...", "remember this for the X integration". This is the ONLY correct way to modify an integration's behavior. NEVER edit SKILL.md files under .claude/skills/integration-* directly \u2014 those files are derived from the platform database and your edits will be silently overwritten on the next manager refresh. The platform calls an LLM to translate the user's request into a structured update of the integration's typed context fields and/or freeform overrides text, then returns a diff for you to show the user. Default flow is preview-then-apply: call once to get the proposed diff, show it to the user, then call again with auto_apply=true if they confirm. Only works for integrations that are actually installed on this agent.`,
48928
+ `Update, edit, or add a rule to an installed integration (e.g. the Coding integration, the Knowledge Base integration, the Slack integration). USE THIS TOOL when the user says any of: "update the X integration", "add a rule to integration Y", "tell the X integration not to do Z", "change the X integration so it does Y", "the Coding integration should always/never...", "remember this for the X integration". This is the ONLY correct way to modify an integration's behavior. NEVER edit SKILL.md files under .claude/skills/integration-* directly \u2014 those files are derived from the platform database and your edits will be silently overwritten on the next manager refresh. The platform calls an LLM to translate the user's request into a structured update of the integration's typed context fields and/or freeform overrides text, then returns a diff for you to show the user. Default flow is preview-then-apply: call once to get the proposed diff, show it to the user, then call again with auto_apply=true if they confirm. Only works for integrations that are actually installed on this agent. Stored overrides are never rewritten: a note is only ever appended after them, and existing overrides text cannot be removed or reworded through this tool. If an auto_apply=true call fails as INDETERMINATE, do NOT retry it: a retry generates the note again and can append it twice. Tell the user the outcome is unknown instead.`,
48862
48929
  {
48863
48930
  integration_slug: external_exports.string().optional().describe('Integration slug to improve (e.g. "claude-code-github"). Either this or integration_id is required.'),
48864
48931
  integration_id: external_exports.string().optional().describe("Integration UUID. Either this or integration_slug is required."),
@@ -48880,50 +48947,23 @@ server.tool(
48880
48947
  content: [{ type: "text", text: "Error: either integration_slug or integration_id is required." }]
48881
48948
  };
48882
48949
  }
48883
- const data = await apiPost("/host/improve-integration", {
48884
- agent_id: AGT_AGENT_ID,
48885
- integration_slug: integrationSlug,
48886
- integration_id: integrationId,
48887
- feedback: params.feedback,
48888
- transcript_snippet: params.transcript_snippet,
48889
- auto_apply: params.auto_apply ?? false
48890
- });
48891
- const lines = [];
48892
- lines.push(data.applied ? "\u2705 Applied integration context update" : "\u{1F4CB} Proposed integration context update (preview)");
48893
- lines.push("");
48894
- lines.push(`Rationale: ${data.proposed.rationale}`);
48895
- if (data.proposed.changed_fields.length > 0) {
48896
- lines.push("");
48897
- lines.push("## Typed field changes");
48898
- for (const field of data.proposed.changed_fields) {
48899
- const before = JSON.stringify(data.current.values[field] ?? null);
48900
- const after = JSON.stringify(data.proposed.values[field] ?? null);
48901
- lines.push(`- \`${field}\`: ${before} \u2192 ${after}`);
48902
- }
48903
- }
48904
- if (data.proposed.appended_to_overrides) {
48905
- lines.push("");
48906
- lines.push("## Overrides change");
48907
- const before = data.current.overrides || "(empty)";
48908
- const after = data.proposed.overrides || "(empty)";
48909
- lines.push("Before:");
48910
- lines.push("```");
48911
- lines.push(before);
48912
- lines.push("```");
48913
- lines.push("After:");
48914
- lines.push("```");
48915
- lines.push(after);
48916
- lines.push("```");
48917
- }
48918
- if (!data.applied) {
48919
- lines.push("");
48920
- lines.push("---");
48921
- lines.push("Show this diff to the user. If they confirm, call `integration_improve` again with `auto_apply: true` and the same arguments to apply.");
48922
- } else {
48923
- lines.push("");
48924
- lines.push("Update applied. The manager will re-render the integration's SKILL.md files on the next refresh cycle.");
48925
- }
48926
- return { content: [{ type: "text", text: lines.join("\n") }] };
48950
+ const autoApply = params.auto_apply ?? false;
48951
+ const data = await apiPost(
48952
+ "/host/improve-integration",
48953
+ {
48954
+ agent_id: AGT_AGENT_ID,
48955
+ integration_slug: integrationSlug,
48956
+ integration_id: integrationId,
48957
+ feedback: params.feedback,
48958
+ transcript_snippet: params.transcript_snippet,
48959
+ auto_apply: autoApply
48960
+ },
48961
+ false,
48962
+ FORWARD_TOOL_CALL_TIMEOUT_MS,
48963
+ "integration_improve",
48964
+ !autoApply
48965
+ );
48966
+ return { content: [{ type: "text", text: renderImproveResponse(data) }] };
48927
48967
  }
48928
48968
  );
48929
48969
  server.tool(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.893",
3
+ "version": "0.28.895",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {