@integrity-labs/agt-cli 0.28.1191 → 0.28.1192

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 (31) hide show
  1. package/dist/bin/agt.js +6 -6
  2. package/dist/{chunk-7T4CZ2NS.js → chunk-DXLSLT5G.js} +2 -2
  3. package/dist/{chunk-L5BWZX3Z.js → chunk-NJ2AUTIO.js} +3 -3
  4. package/dist/{chunk-5RDPFXWO.js → chunk-TCPX64GU.js} +7 -5
  5. package/dist/chunk-TCPX64GU.js.map +1 -0
  6. package/dist/{chunk-VS3QXUDM.js → chunk-UQYIFOWE.js} +2 -2
  7. package/dist/{chunk-GRU6GNLP.js → chunk-UUO7QTLC.js} +76 -15
  8. package/dist/chunk-UUO7QTLC.js.map +1 -0
  9. package/dist/{claude-code-updater-JPVLPWVR.js → claude-code-updater-EOJQHUZ2.js} +3 -3
  10. package/dist/{claude-pair-runtime-JXXYGKWS.js → claude-pair-runtime-WKTA3HNF.js} +3 -3
  11. package/dist/lib/manager-worker.js +71 -23
  12. package/dist/lib/manager-worker.js.map +1 -1
  13. package/dist/mcp/direct-chat-channel.js +3 -0
  14. package/dist/mcp/index.js +54 -1
  15. package/dist/mcp/origami.js +3 -0
  16. package/dist/mcp/slack-channel.js +3 -0
  17. package/dist/mcp/telegram-channel.js +3 -0
  18. package/dist/{persistent-session-NSA3UYRF.js → persistent-session-5MGJGJIB.js} +4 -4
  19. package/dist/{responsiveness-probe-MWH3BKAL.js → responsiveness-probe-J4CBYZS3.js} +4 -4
  20. package/dist/{session-auth-dead-RYU7ZB56.js → session-auth-dead-7CSZHNBK.js} +3 -3
  21. package/package.json +1 -1
  22. package/dist/chunk-5RDPFXWO.js.map +0 -1
  23. package/dist/chunk-GRU6GNLP.js.map +0 -1
  24. /package/dist/{chunk-7T4CZ2NS.js.map → chunk-DXLSLT5G.js.map} +0 -0
  25. /package/dist/{chunk-L5BWZX3Z.js.map → chunk-NJ2AUTIO.js.map} +0 -0
  26. /package/dist/{chunk-VS3QXUDM.js.map → chunk-UQYIFOWE.js.map} +0 -0
  27. /package/dist/{claude-code-updater-JPVLPWVR.js.map → claude-code-updater-EOJQHUZ2.js.map} +0 -0
  28. /package/dist/{claude-pair-runtime-JXXYGKWS.js.map → claude-pair-runtime-WKTA3HNF.js.map} +0 -0
  29. /package/dist/{persistent-session-NSA3UYRF.js.map → persistent-session-5MGJGJIB.js.map} +0 -0
  30. /package/dist/{responsiveness-probe-MWH3BKAL.js.map → responsiveness-probe-J4CBYZS3.js.map} +0 -0
  31. /package/dist/{session-auth-dead-RYU7ZB56.js.map → session-auth-dead-7CSZHNBK.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-XWVM4KPK.js";
5
5
  import {
6
6
  FORCED_UPDATE_HARD_DEADLINE_MS
7
- } from "./chunk-GRU6GNLP.js";
7
+ } from "./chunk-UUO7QTLC.js";
8
8
  import {
9
9
  effectiveClaudeJsonPath
10
10
  } from "./chunk-AIUIMEUS.js";
@@ -722,4 +722,4 @@ export {
722
722
  probeClaudeInstalls,
723
723
  maybeUpdateClaudeCode
724
724
  };
725
- //# sourceMappingURL=chunk-VS3QXUDM.js.map
725
+ //# sourceMappingURL=chunk-UQYIFOWE.js.map
@@ -164,30 +164,90 @@ var AGENT_RULES_SECTION_END = "<!-- AGT:RULES_END -->";
164
164
  var MAX_AGENT_RULES = 8;
165
165
  var MAX_AGENT_RULE_CHARS = 200;
166
166
  var MAX_AGENT_RULES_CHARS = MAX_AGENT_RULES * (MAX_AGENT_RULE_CHARS + 4);
167
- function agentRulesRestartBasis(rules) {
167
+ var MAX_ORG_RULES = 10;
168
+ var MAX_TEAM_RULES = 10;
169
+ var MAX_INHERITED_RULES_CHARS = (MAX_ORG_RULES + MAX_TEAM_RULES) * (MAX_AGENT_RULE_CHARS + 4);
170
+ function resolveInheritedForDelivery(received, lastKnown, currentTeamId) {
171
+ if (received === void 0)
172
+ return { rules: void 0, reusedLastKnown: [], unknown: [] };
173
+ const reusedLastKnown = [];
174
+ const unknown2 = [];
175
+ const pick = (scope) => {
176
+ const got = received[scope];
177
+ if (got !== null)
178
+ return got;
179
+ if (lastKnown && (scope === "organization" || lastKnown.teamId === currentTeamId)) {
180
+ reusedLastKnown.push(scope);
181
+ return lastKnown.rules[scope];
182
+ }
183
+ unknown2.push(scope);
184
+ return [];
185
+ };
186
+ return { rules: { organization: pick("organization"), team: pick("team") }, reusedLastKnown, unknown: unknown2 };
187
+ }
188
+ function agentRulesRestartBasis(rules, inherited) {
189
+ const own = basisOf(rules);
190
+ const org = basisOf(inherited?.organization ?? []);
191
+ const team = basisOf(inherited?.team ?? []);
192
+ if (org === "" && team === "")
193
+ return own;
194
+ return `${own}organization\0${org}team\0${team}`;
195
+ }
196
+ function basisOf(rules) {
168
197
  return [...rules].map((r) => r.text.trim()).filter((t) => t.length > 0).sort().join("\0");
169
198
  }
170
- function agentHasRules(rules) {
171
- return rules.some((r) => r.text.trim().length > 0);
199
+ function agentHasRules(rules, inherited) {
200
+ const any = (list) => list.some((r) => r.text.trim().length > 0);
201
+ return any(rules) || any(inherited?.organization ?? []) || any(inherited?.team ?? []);
172
202
  }
173
- function buildAgentRulesSection(rules) {
174
- const kept = rules.map((r) => r.text.trim()).filter(Boolean).filter((t) => t.length <= MAX_AGENT_RULE_CHARS).slice(0, MAX_AGENT_RULES);
175
- if (kept.length === 0)
176
- return "";
177
- const lines = kept.map((t) => `- ${t}`).join("\n");
203
+ function buildAgentRulesSection(rules, inherited) {
204
+ const kept = keepRenderable(rules, MAX_AGENT_RULES);
205
+ const org = keepRenderable(inherited?.organization ?? [], MAX_ORG_RULES);
206
+ const team = keepRenderable(inherited?.team ?? [], MAX_TEAM_RULES);
207
+ if (org.length === 0 && team.length === 0) {
208
+ if (kept.length === 0)
209
+ return "";
210
+ return `${AGENT_RULES_SECTION_START}
211
+ ## Standing rules from your people
212
+
213
+ ${RULES_PREAMBLE}
214
+
215
+ ${bullets(kept)}
216
+ ${AGENT_RULES_SECTION_END}
217
+
218
+ `;
219
+ }
220
+ const blocks = [];
221
+ if (org.length > 0)
222
+ blocks.push(`From your organisation:
223
+ ${bullets(org)}`);
224
+ if (team.length > 0)
225
+ blocks.push(`From your team:
226
+ ${bullets(team)}`);
227
+ if (kept.length > 0)
228
+ blocks.push(`Yours:
229
+ ${bullets(kept)}`);
178
230
  return `${AGENT_RULES_SECTION_START}
179
231
  ## Standing rules from your people
180
232
 
181
- Rules your team has asked you to follow every time, in their words. They are not
182
- task-specific \u2014 they apply on every turn regardless of what you are doing. If one
183
- ever conflicts with a guardrail above, the guardrail wins and you should say so
184
- rather than silently picking one.
233
+ ${RULES_PREAMBLE} If two of these rules conflict, the more specific one wins:
234
+ yours over your team's, and your team's over your organisation's.
185
235
 
186
- ${lines}
236
+ ${blocks.join("\n\n")}
187
237
  ${AGENT_RULES_SECTION_END}
188
238
 
189
239
  `;
190
240
  }
241
+ var RULES_PREAMBLE = `Rules your team has asked you to follow every time, in their words. They are not
242
+ task-specific \u2014 they apply on every turn regardless of what you are doing. If one
243
+ ever conflicts with a guardrail above, the guardrail wins and you should say so
244
+ rather than silently picking one.`;
245
+ function bullets(texts) {
246
+ return texts.map((t) => `- ${t}`).join("\n");
247
+ }
248
+ function keepRenderable(rules, max) {
249
+ return rules.map((r) => r.text.trim()).filter(Boolean).filter((t) => t.length <= MAX_AGENT_RULE_CHARS).slice(0, max);
250
+ }
191
251
 
192
252
  // ../../packages/core/dist/provisioning/frameworks/claudecode/agent-console-url.js
193
253
  var DEFAULT_AGENT_CONSOLE_URL = "https://app.ninjafy.com";
@@ -1477,7 +1537,7 @@ function generateClaudeMd(input) {
1477
1537
  const renderIntegrations = input.renderIntegrationsSection === true;
1478
1538
  const integrationsSection = renderIntegrations ? buildIntegrationsSection(integrations) : "";
1479
1539
  const capabilityPromptSection = buildCapabilityPromptSection(integrations, renderIntegrations);
1480
- const agentRulesSection = buildAgentRulesSection(input.agentRules ?? []);
1540
+ const agentRulesSection = buildAgentRulesSection(input.agentRules ?? [], input.inheritedAgentRules);
1481
1541
  const kanbanWorkPolicySection = buildKanbanWorkPolicySection();
1482
1542
  const platformStorageSection = buildPlatformStorageSection(input.hasWorkflows);
1483
1543
  const skillAuthoringSection = buildSkillAuthoringSection();
@@ -17445,6 +17505,7 @@ export {
17445
17505
  scrubPreservingIdentifiers,
17446
17506
  identifierMemoryName,
17447
17507
  EXTRACTOR_IDENTIFIER_RULE,
17508
+ resolveInheritedForDelivery,
17448
17509
  agentRulesRestartBasis,
17449
17510
  agentHasRules,
17450
17511
  SCRATCH_RETENTION_DAYS,
@@ -17611,4 +17672,4 @@ export {
17611
17672
  isForcedUpdatePastDeadline,
17612
17673
  shouldMintReplacementKey
17613
17674
  };
17614
- //# sourceMappingURL=chunk-GRU6GNLP.js.map
17675
+ //# sourceMappingURL=chunk-UUO7QTLC.js.map