@ghostpaw/affinity 0.1.4 → 0.1.5

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.cjs CHANGED
@@ -1454,8 +1454,8 @@ function searchContacts(db, query, filters, options) {
1454
1454
  GROUP BY c.id
1455
1455
  `;
1456
1456
  const rows = db.prepare(sql).all(
1457
- ...params,
1458
1457
  normalizedPattern,
1458
+ ...params,
1459
1459
  pattern,
1460
1460
  pattern,
1461
1461
  normalizedPattern
@@ -7089,10 +7089,15 @@ function manageRelationshipToolHandler(db, input) {
7089
7089
  if (!to.ok) {
7090
7090
  return to.result;
7091
7091
  }
7092
+ const merged = {
7093
+ ...input.input,
7094
+ ...input.kind !== void 0 && input.input?.kind === void 0 ? { kind: input.kind } : {},
7095
+ ...input.role !== void 0 && input.input?.role === void 0 ? { role: input.role } : {}
7096
+ };
7092
7097
  return mutationToolResult(
7093
7098
  "seed_social_link",
7094
7099
  seedSocialLink(db, {
7095
- ...input.input,
7100
+ ...merged,
7096
7101
  fromContactId: from.value.id,
7097
7102
  toContactId: to.value.id
7098
7103
  }),
@@ -7130,10 +7135,15 @@ function manageRelationshipToolHandler(db, input) {
7130
7135
  if (!to.ok) {
7131
7136
  return to.result;
7132
7137
  }
7138
+ const merged = {
7139
+ ...input.input,
7140
+ ...input.kind !== void 0 && input.input?.kind === void 0 ? { kind: input.kind } : {},
7141
+ ...input.role !== void 0 && input.input?.role === void 0 ? { role: input.role } : {}
7142
+ };
7133
7143
  return mutationToolResult(
7134
7144
  "set_structural_tie",
7135
7145
  setStructuralTie(db, {
7136
- ...input.input,
7146
+ ...merged,
7137
7147
  fromContactId: from.value.id,
7138
7148
  toContactId: to.value.id
7139
7149
  }),
@@ -7167,7 +7177,9 @@ var manageRelationshipTool = defineAffinityTool({
7167
7177
  action: "Which relationship action to perform.",
7168
7178
  from: "Source contact locator for actions that create or set links.",
7169
7179
  to: "Destination contact locator for actions that create or set links.",
7170
- input: "Action-specific creation payload.",
7180
+ input: "Action-specific creation payload (alternative to top-level kind/role).",
7181
+ kind: "Link kind for seed_social_link or set_structural_tie. Can be passed here or inside input.",
7182
+ role: "Optional role for seed_social_link or set_structural_tie. Can be passed here or inside input.",
7171
7183
  link: "Target link locator for existing-link actions.",
7172
7184
  bond: "Replacement bond text or null.",
7173
7185
  state: "Replacement link state.",
@@ -7190,9 +7202,15 @@ var manageRelationshipTool = defineAffinityTool({
7190
7202
  to: contactLocatorSchema5(
7191
7203
  "Target contact. Required when action=seed_social_link or set_structural_tie. Provide contactId or identity."
7192
7204
  ),
7205
+ kind: stringSchema(
7206
+ "Link kind. Required for seed_social_link and set_structural_tie. Can be passed here or inside input."
7207
+ ),
7208
+ role: stringSchema(
7209
+ "Optional role for seed_social_link or set_structural_tie. Can be passed here or inside input."
7210
+ ),
7193
7211
  input: {
7194
7212
  type: "object",
7195
- description: "Payload for seed_social_link or set_structural_tie. Shape depends on action."
7213
+ description: "Full payload for seed_social_link or set_structural_tie. Alternative to top-level kind/role."
7196
7214
  },
7197
7215
  link: linkLocatorSchema3(
7198
7216
  "Target link. Required when action=revise_bond, override_state, or remove_structural_tie. Provide linkId or endpoints."
package/dist/index.d.cts CHANGED
@@ -1362,7 +1362,9 @@ type ManageRelationshipToolInput = {
1362
1362
  action: "seed_social_link";
1363
1363
  from: ContactLocator;
1364
1364
  to: ContactLocator;
1365
- input: Omit<SeedSocialLinkInput, "fromContactId" | "toContactId">;
1365
+ input?: Omit<SeedSocialLinkInput, "fromContactId" | "toContactId">;
1366
+ kind?: string;
1367
+ role?: string;
1366
1368
  } | {
1367
1369
  action: "revise_bond";
1368
1370
  link: LinkLocator;
@@ -1377,7 +1379,9 @@ type ManageRelationshipToolInput = {
1377
1379
  action: "set_structural_tie";
1378
1380
  from: ContactLocator;
1379
1381
  to: ContactLocator;
1380
- input: Omit<SetStructuralTieInput, "fromContactId" | "toContactId">;
1382
+ input?: Omit<SetStructuralTieInput, "fromContactId" | "toContactId">;
1383
+ kind?: string;
1384
+ role?: string;
1381
1385
  } | {
1382
1386
  action: "remove_structural_tie";
1383
1387
  link: LinkLocator;
package/dist/index.d.ts CHANGED
@@ -1362,7 +1362,9 @@ type ManageRelationshipToolInput = {
1362
1362
  action: "seed_social_link";
1363
1363
  from: ContactLocator;
1364
1364
  to: ContactLocator;
1365
- input: Omit<SeedSocialLinkInput, "fromContactId" | "toContactId">;
1365
+ input?: Omit<SeedSocialLinkInput, "fromContactId" | "toContactId">;
1366
+ kind?: string;
1367
+ role?: string;
1366
1368
  } | {
1367
1369
  action: "revise_bond";
1368
1370
  link: LinkLocator;
@@ -1377,7 +1379,9 @@ type ManageRelationshipToolInput = {
1377
1379
  action: "set_structural_tie";
1378
1380
  from: ContactLocator;
1379
1381
  to: ContactLocator;
1380
- input: Omit<SetStructuralTieInput, "fromContactId" | "toContactId">;
1382
+ input?: Omit<SetStructuralTieInput, "fromContactId" | "toContactId">;
1383
+ kind?: string;
1384
+ role?: string;
1381
1385
  } | {
1382
1386
  action: "remove_structural_tie";
1383
1387
  link: LinkLocator;
package/dist/index.js CHANGED
@@ -1452,8 +1452,8 @@ function searchContacts(db, query, filters, options) {
1452
1452
  GROUP BY c.id
1453
1453
  `;
1454
1454
  const rows = db.prepare(sql).all(
1455
- ...params,
1456
1455
  normalizedPattern,
1456
+ ...params,
1457
1457
  pattern,
1458
1458
  pattern,
1459
1459
  normalizedPattern
@@ -7087,10 +7087,15 @@ function manageRelationshipToolHandler(db, input) {
7087
7087
  if (!to.ok) {
7088
7088
  return to.result;
7089
7089
  }
7090
+ const merged = {
7091
+ ...input.input,
7092
+ ...input.kind !== void 0 && input.input?.kind === void 0 ? { kind: input.kind } : {},
7093
+ ...input.role !== void 0 && input.input?.role === void 0 ? { role: input.role } : {}
7094
+ };
7090
7095
  return mutationToolResult(
7091
7096
  "seed_social_link",
7092
7097
  seedSocialLink(db, {
7093
- ...input.input,
7098
+ ...merged,
7094
7099
  fromContactId: from.value.id,
7095
7100
  toContactId: to.value.id
7096
7101
  }),
@@ -7128,10 +7133,15 @@ function manageRelationshipToolHandler(db, input) {
7128
7133
  if (!to.ok) {
7129
7134
  return to.result;
7130
7135
  }
7136
+ const merged = {
7137
+ ...input.input,
7138
+ ...input.kind !== void 0 && input.input?.kind === void 0 ? { kind: input.kind } : {},
7139
+ ...input.role !== void 0 && input.input?.role === void 0 ? { role: input.role } : {}
7140
+ };
7131
7141
  return mutationToolResult(
7132
7142
  "set_structural_tie",
7133
7143
  setStructuralTie(db, {
7134
- ...input.input,
7144
+ ...merged,
7135
7145
  fromContactId: from.value.id,
7136
7146
  toContactId: to.value.id
7137
7147
  }),
@@ -7165,7 +7175,9 @@ var manageRelationshipTool = defineAffinityTool({
7165
7175
  action: "Which relationship action to perform.",
7166
7176
  from: "Source contact locator for actions that create or set links.",
7167
7177
  to: "Destination contact locator for actions that create or set links.",
7168
- input: "Action-specific creation payload.",
7178
+ input: "Action-specific creation payload (alternative to top-level kind/role).",
7179
+ kind: "Link kind for seed_social_link or set_structural_tie. Can be passed here or inside input.",
7180
+ role: "Optional role for seed_social_link or set_structural_tie. Can be passed here or inside input.",
7169
7181
  link: "Target link locator for existing-link actions.",
7170
7182
  bond: "Replacement bond text or null.",
7171
7183
  state: "Replacement link state.",
@@ -7188,9 +7200,15 @@ var manageRelationshipTool = defineAffinityTool({
7188
7200
  to: contactLocatorSchema5(
7189
7201
  "Target contact. Required when action=seed_social_link or set_structural_tie. Provide contactId or identity."
7190
7202
  ),
7203
+ kind: stringSchema(
7204
+ "Link kind. Required for seed_social_link and set_structural_tie. Can be passed here or inside input."
7205
+ ),
7206
+ role: stringSchema(
7207
+ "Optional role for seed_social_link or set_structural_tie. Can be passed here or inside input."
7208
+ ),
7191
7209
  input: {
7192
7210
  type: "object",
7193
- description: "Payload for seed_social_link or set_structural_tie. Shape depends on action."
7211
+ description: "Full payload for seed_social_link or set_structural_tie. Alternative to top-level kind/role."
7194
7212
  },
7195
7213
  link: linkLocatorSchema3(
7196
7214
  "Target link. Required when action=revise_bond, override_state, or remove_structural_tie. Provide linkId or endpoints."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghostpaw/affinity",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Relationship intelligence and social CRM model for Node.js — SQLite, zero dependencies, with a built-in LLM tool facade",
5
5
  "license": "MIT",
6
6
  "author": {