@tickernelz/paperclip-pro 2026.1008.5 → 2026.1009.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.
package/dist/index.js CHANGED
@@ -14109,7 +14109,7 @@ var init_chat_channels = __esm({
14109
14109
  "reply"
14110
14110
  ];
14111
14111
  CHAT_SENDER_RULE_LISTS = ["allow", "deny"];
14112
- CHAT_OWNER_APPROVAL_STATUSES = ["pending", "approved", "rejected", "cancelled"];
14112
+ CHAT_OWNER_APPROVAL_STATUSES = ["pending", "approved", "rejected", "cancelled", "expired", "withdrawn"];
14113
14113
  }
14114
14114
  });
14115
14115
 
@@ -14474,7 +14474,8 @@ var init_chat_channels2 = __esm({
14474
14474
  gatewayAdmin: z27.boolean().default(true),
14475
14475
  reminderMinutes: z27.number().int().min(1).max(1440).default(30),
14476
14476
  maxReminders: z27.number().int().min(0).max(10).default(3),
14477
- grantTtlHours: z27.number().int().min(1).max(720).default(24)
14477
+ grantTtlHours: z27.number().int().min(1).max(720).default(24),
14478
+ pendingTtlHours: z27.number().int().min(1).max(168).default(24)
14478
14479
  }).strict().prefault({}),
14479
14480
  rotateAfterIdleHours: z27.number().int().min(1).max(720).default(24),
14480
14481
  progressNudgeSeconds: z27.number().int().min(0).max(3600).default(60),
@@ -19694,14 +19695,15 @@ function tool2(name, risk, description, shape, refine) {
19694
19695
  const { $schema: _schema, ...inputSchema } = z76.toJSONSchema(schema, { io: "input" });
19695
19696
  return { name: `openwa_${name}`, risk, description, schema, inputSchema };
19696
19697
  }
19697
- var OPENWA_SEND_KINDS, chat, uuid, e164, messageId, mention, triggerIds, operation, cursor2, GRANT_CATEGORIES, OPENWA_APPROVAL_MESSAGE_MAX_LENGTH, MEDIA_KINDS, senderRule, OPENWA_TOOLS, openwaToolCallSchema;
19698
+ var OPENWA_SEND_KINDS, chat, UUID_PATTERN, uuid, e164, messageId, mention, triggerIds, operation, cursor2, GRANT_CATEGORIES, OPENWA_APPROVAL_MESSAGE_MAX_LENGTH, MEDIA_KINDS, senderRule, OPENWA_TOOLS, openwaToolCallSchema;
19698
19699
  var init_openwa_tools = __esm({
19699
19700
  "../packages/shared/src/openwa-tools.ts"() {
19700
19701
  "use strict";
19701
19702
  init_chat_channels2();
19702
19703
  OPENWA_SEND_KINDS = ["text", "image", "video", "audio", "voice", "document", "sticker", "location", "contact", "poll"];
19703
19704
  chat = z76.string().min(3).max(200).optional().describe("chatRef, group id or E.164 number; default: origin chat");
19704
- uuid = z76.string().regex(/^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$/);
19705
+ UUID_PATTERN = /^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$/;
19706
+ uuid = z76.string().refine((value) => UUID_PATTERN.test(value), "Expected a UUID");
19705
19707
  e164 = z76.string().regex(/^\+?[1-9]\d{6,14}$/);
19706
19708
  messageId = z76.string().min(1).max(200);
19707
19709
  mention = z76.string().regex(/^(\+?[1-9]\d{6,14}|openwa:[A-Za-z0-9-]{1,64}:\d{5,25}@(c\.us|lid))$/);
@@ -19800,6 +19802,16 @@ var init_openwa_tools = __esm({
19800
19802
  conditions: z76.string().trim().min(1).max(2e3).optional()
19801
19803
  }
19802
19804
  ),
19805
+ tool2(
19806
+ "approval_withdraw",
19807
+ "write",
19808
+ "Withdraw your pending approval request from this chat when the owner's reply decided it differently or made it moot. Only owner runs or the run that created the request may withdraw. Sends and executes nothing; reminders stop.",
19809
+ {
19810
+ requestId: uuid,
19811
+ reason: z76.string().trim().min(1).max(500),
19812
+ ownerMessageRef: messageId.optional()
19813
+ }
19814
+ ),
19803
19815
  tool2(
19804
19816
  "stay_silent",
19805
19817
  "write",
@@ -19825,7 +19837,7 @@ var init_openwa_tools = __esm({
19825
19837
  tool2(
19826
19838
  "endpoint_config",
19827
19839
  "write",
19828
- "Owner-triggered runs only: change sender allow/deny lists, one chat's settings (default origin chat; null clears an override), approval toggles and reminders, or custom instructions. Empty call reads them. Credentials, number mode, owners and gateway admin level stay in Paperclip.",
19840
+ "Owner-triggered runs only: change sender allow/deny lists, one chat's settings (default origin chat; null clears an override), approval toggles, reminders and pending lifetime, or custom instructions. Empty call reads them. Credentials, number mode, owners and gateway admin level stay in Paperclip.",
19829
19841
  {
19830
19842
  senders: z76.object({
19831
19843
  add: z76.array(senderRule.extend({ label: z76.string().trim().min(1).max(120).optional() })).max(50).optional(),
@@ -19846,7 +19858,8 @@ var init_openwa_tools = __esm({
19846
19858
  waAdmin: z76.boolean().optional(),
19847
19859
  gatewayAdmin: z76.boolean().optional(),
19848
19860
  reminderMinutes: z76.number().int().min(1).max(1440).optional(),
19849
- maxReminders: z76.number().int().min(0).max(10).optional()
19861
+ maxReminders: z76.number().int().min(0).max(10).optional(),
19862
+ pendingTtlHours: z76.number().int().min(1).max(168).optional()
19850
19863
  }).strict().optional(),
19851
19864
  customInstructions: z76.string().max(OPENWA_CUSTOM_INSTRUCTIONS_MAX_LENGTH).optional()
19852
19865
  }
@@ -30009,7 +30022,7 @@ var init_chat_channels3 = __esm({
30009
30022
  (table) => [
30010
30023
  check3(
30011
30024
  "chat_scheduled_wakes_kind_check",
30012
- sql18`${table.kind} in ('owner_absent', 'approval_reminder')`
30025
+ sql18`${table.kind} in ('owner_absent', 'approval_reminder', 'approval_expiry')`
30013
30026
  ),
30014
30027
  check3(
30015
30028
  "chat_scheduled_wakes_state_check",
@@ -30072,7 +30085,7 @@ var init_chat_channels3 = __esm({
30072
30085
  ),
30073
30086
  check3(
30074
30087
  "chat_owner_approval_requests_status_check",
30075
- sql18`${table.status} in ('pending', 'approved', 'rejected', 'cancelled')`
30088
+ sql18`${table.status} in ('pending', 'approved', 'rejected', 'cancelled', 'expired', 'withdrawn')`
30076
30089
  ),
30077
30090
  check3(
30078
30091
  "chat_owner_approval_requests_resolved_via_check",
@@ -30287,7 +30300,7 @@ var init_chat_channels3 = __esm({
30287
30300
  (table) => [
30288
30301
  check3(
30289
30302
  "chat_audit_entries_kind_check",
30290
- sql18`${table.kind} in ('trigger_admitted', 'trigger_filtered', 'message_sent', 'publication_suppressed', 'tool_called', 'approval_requested', 'approval_reminded', 'approval_resolved', 'approval_cancelled', 'config_changed', 'group_added', 'group_left', 'session_health', 'linked_read', 'run_failed')`
30303
+ sql18`${table.kind} in ('trigger_admitted', 'trigger_filtered', 'message_sent', 'publication_suppressed', 'tool_called', 'approval_requested', 'approval_reminded', 'approval_resolved', 'approval_cancelled', 'approval_expired', 'approval_withdrawn', 'config_changed', 'group_added', 'group_left', 'session_health', 'linked_read', 'run_failed')`
30291
30304
  ),
30292
30305
  check3(
30293
30306
  "chat_audit_entries_actor_kind_check",