@mnemom/agent-integrity-protocol 0.1.0 → 0.1.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.
package/dist/index.d.cts CHANGED
@@ -458,6 +458,8 @@ interface AIPCallbacks {
458
458
  interface AIPConfig {
459
459
  /** Alignment Card to evaluate against */
460
460
  card: AlignmentCard;
461
+ /** Agent ID for checkpoints. Defaults to card.card_id if not provided. */
462
+ agent_id?: string;
461
463
  /** Conscience values (optional; only BOUNDARY/FEAR types are injected into the conscience prompt) */
462
464
  conscience_values?: ConscienceValue[];
463
465
  /** Analysis LLM configuration */
package/dist/index.d.ts CHANGED
@@ -458,6 +458,8 @@ interface AIPCallbacks {
458
458
  interface AIPConfig {
459
459
  /** Alignment Card to evaluate against */
460
460
  card: AlignmentCard;
461
+ /** Agent ID for checkpoints. Defaults to card.card_id if not provided. */
462
+ agent_id?: string;
461
463
  /** Conscience values (optional; only BOUNDARY/FEAR types are injected into the conscience prompt) */
462
464
  conscience_values?: ConscienceValue[];
463
465
  /** Analysis LLM configuration */
package/dist/index.js CHANGED
@@ -1297,7 +1297,7 @@ function createClient(config) {
1297
1297
  async check(responseBody, provider) {
1298
1298
  if (destroyed) throw new Error("AIP client has been destroyed");
1299
1299
  const adapter = provider ? registry.get(provider) : registry.detectFromUrl(config.analysis_llm.base_url);
1300
- const thinking = adapter.extractThinking(responseBody);
1300
+ const thinking = adapter.extractThinking(responseBody) ?? adapter.extractThinkingFromStream(responseBody);
1301
1301
  if (!thinking) {
1302
1302
  return buildSyntheticSignal(config, window, "clear");
1303
1303
  }
@@ -1341,8 +1341,7 @@ function createClient(config) {
1341
1341
  truncated: prompt.truncated,
1342
1342
  confidence: thinking.confidence
1343
1343
  },
1344
- agentId: config.card.card_id,
1345
- // Use card_id as agent proxy
1344
+ agentId: config.agent_id ?? config.card.card_id,
1346
1345
  cardId: config.card.card_id,
1347
1346
  sessionId: window.getSessionId(),
1348
1347
  windowPosition: {
@@ -1432,7 +1431,7 @@ function buildSyntheticSignal(config, window, verdict) {
1432
1431
  return {
1433
1432
  checkpoint: {
1434
1433
  checkpoint_id: `ic-synthetic-${Date.now()}`,
1435
- agent_id: config.card.card_id,
1434
+ agent_id: config.agent_id ?? config.card.card_id,
1436
1435
  card_id: config.card.card_id,
1437
1436
  session_id: window.getSessionId(),
1438
1437
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),