@kanvas/openclaw-plugin 0.1.7 → 0.1.8
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/domains/crm/index.js +32 -0
- package/dist/index.js +1 -1
- package/dist/tools/crm.js +40 -0
- package/package.json +1 -1
|
@@ -811,6 +811,38 @@ export class CrmService {
|
|
|
811
811
|
`;
|
|
812
812
|
return this.client.query(query, { first });
|
|
813
813
|
}
|
|
814
|
+
async createPeopleRelationship(input) {
|
|
815
|
+
const mutation = `
|
|
816
|
+
mutation CreatePeopleRelationship($input: PeopleRelationshipInput!) {
|
|
817
|
+
createPeopleRelationship(input: $input) {
|
|
818
|
+
id
|
|
819
|
+
name
|
|
820
|
+
description
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
`;
|
|
824
|
+
return this.client.query(mutation, { input });
|
|
825
|
+
}
|
|
826
|
+
async updatePeopleRelationship(id, input) {
|
|
827
|
+
const mutation = `
|
|
828
|
+
mutation UpdatePeopleRelationship($id: ID!, $input: UpdatePeopleRelationshipInput!) {
|
|
829
|
+
updatePeopleRelationship(id: $id, input: $input) {
|
|
830
|
+
id
|
|
831
|
+
name
|
|
832
|
+
description
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
`;
|
|
836
|
+
return this.client.query(mutation, { id, input });
|
|
837
|
+
}
|
|
838
|
+
async deletePeopleRelationship(id) {
|
|
839
|
+
const mutation = `
|
|
840
|
+
mutation DeletePeopleRelationship($id: ID!) {
|
|
841
|
+
deletePeopleRelationship(id: $id)
|
|
842
|
+
}
|
|
843
|
+
`;
|
|
844
|
+
return this.client.query(mutation, { id });
|
|
845
|
+
}
|
|
814
846
|
async listContactTypes(first = 50) {
|
|
815
847
|
const query = `
|
|
816
848
|
query ContactTypes($first: Int) {
|
package/dist/index.js
CHANGED
|
@@ -103,7 +103,7 @@ export default {
|
|
|
103
103
|
await runSetup();
|
|
104
104
|
});
|
|
105
105
|
}, { commands: ["setup"] });
|
|
106
|
-
api.logger.info("Kanvas plugin registered —
|
|
106
|
+
api.logger.info("Kanvas plugin registered — 53 tools loaded");
|
|
107
107
|
},
|
|
108
108
|
};
|
|
109
109
|
const KANVAS_SYSTEM_CONTEXT = `
|
package/dist/tools/crm.js
CHANGED
|
@@ -447,6 +447,46 @@ export function registerCrmTools(api, service, ensureAuth) {
|
|
|
447
447
|
return toolResult(await service.listPeopleRelationships(params.first));
|
|
448
448
|
},
|
|
449
449
|
});
|
|
450
|
+
api.registerTool({
|
|
451
|
+
name: "kanvas_create_people_relationship",
|
|
452
|
+
label: "Create People Relationship",
|
|
453
|
+
description: "Create a new relationship type (e.g. Architect, Client, Consultant) for use when adding participants to leads.",
|
|
454
|
+
parameters: Type.Object({
|
|
455
|
+
name: Type.String({ description: 'Relationship name (e.g. "Architect", "Consultant", "Decision Maker")' }),
|
|
456
|
+
description: Type.Optional(Type.String({ description: "Description of this relationship type" })),
|
|
457
|
+
}),
|
|
458
|
+
async execute(_id, params) {
|
|
459
|
+
await ensureAuth();
|
|
460
|
+
return toolResult(await service.createPeopleRelationship(params));
|
|
461
|
+
},
|
|
462
|
+
});
|
|
463
|
+
api.registerTool({
|
|
464
|
+
name: "kanvas_update_people_relationship",
|
|
465
|
+
label: "Update People Relationship",
|
|
466
|
+
description: "Update a relationship type's name or description.",
|
|
467
|
+
parameters: Type.Object({
|
|
468
|
+
id: Type.String({ description: "Relationship ID" }),
|
|
469
|
+
name: Type.Optional(Type.String()),
|
|
470
|
+
description: Type.Optional(Type.String()),
|
|
471
|
+
}),
|
|
472
|
+
async execute(_id, params) {
|
|
473
|
+
await ensureAuth();
|
|
474
|
+
const { id, ...input } = params;
|
|
475
|
+
return toolResult(await service.updatePeopleRelationship(id, input));
|
|
476
|
+
},
|
|
477
|
+
});
|
|
478
|
+
api.registerTool({
|
|
479
|
+
name: "kanvas_delete_people_relationship",
|
|
480
|
+
label: "Delete People Relationship",
|
|
481
|
+
description: "Delete a relationship type.",
|
|
482
|
+
parameters: Type.Object({
|
|
483
|
+
id: Type.String({ description: "Relationship ID" }),
|
|
484
|
+
}),
|
|
485
|
+
async execute(_id, params) {
|
|
486
|
+
await ensureAuth();
|
|
487
|
+
return toolResult(await service.deletePeopleRelationship(params.id));
|
|
488
|
+
},
|
|
489
|
+
});
|
|
450
490
|
api.registerTool({
|
|
451
491
|
name: "kanvas_list_contact_types",
|
|
452
492
|
label: "List Contact Types",
|
package/package.json
CHANGED