Files
plugin-legal-ai/src/manifest.ts
Chaim Marcus 0ca7831c53 feat: adopt SDK 525 features — askUserQuestions + documents.upsert
Two new event types accepted on the existing case-status webhook
(eventType discriminator added; legacy status_change still default):

* **missing_precedent_created** → ``ctx.issues.askUserQuestions``
  with a single-choice question {upload | irrelevant | defer}.
  continuationPolicy=wake_assignee_on_accept routes the chair's
  answer straight back to the CEO heartbeat without an extra hop.

* **export_complete** → ``ctx.issues.documents.upsert`` with a
  markdown "final-decision" doc that links back to the DOCX on
  legal-ai. (The SDK's documents API stores text only — binary
  attachment isn't natively supported here.)

Manifest: +issue.documents.write capability (issue.interactions.create
was already declared in the previous SDK upgrade).

Tested: plugin activates with all 18 capabilities, 8 tools + 3 jobs
+ 1 webhook + 2 event subs registered.
2026-05-26 13:28:43 +00:00

188 lines
5.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export default {
id: "marcusgroup.legal-ai",
apiVersion: 1,
version: "0.1.0",
displayName: "Ezer Mishpati - Legal AI",
description:
"Integration with legal decision drafting system — case management, semantic search, and workflow tracking",
author: "Marcus Group",
categories: ["connector"] as const,
capabilities: [
"events.subscribe",
"issues.read",
"issues.create",
"issues.update",
"issue.comments.read",
"issue.comments.create",
"issue.interactions.create",
"issue.documents.write",
"agent.tools.register",
"agents.invoke",
"http.outbound",
"plugin.state.read",
"plugin.state.write",
"jobs.schedule",
"activity.log.write",
"companies.read",
"projects.read",
"webhooks.receive",
] as const,
entrypoints: {
worker: "dist/worker.js",
},
instanceConfigSchema: {
type: "object" as const,
properties: {
legalApiBaseUrl: {
type: "string" as const,
default: "http://localhost:8085",
description: "Base URL for the Ezer Mishpati API",
},
},
},
tools: [
{
toolKey: "legal_case_list",
name: "legal_case_list",
displayName: "List Legal Cases",
description: "List all appeal cases in the legal system",
parametersSchema: { type: "object" as const, properties: {} },
},
{
toolKey: "legal_case_get",
name: "legal_case_get",
displayName: "Get Legal Case Details",
description: "Get full details of a legal case including documents",
parametersSchema: {
type: "object" as const,
properties: {
case_number: { type: "string" as const, description: "Case number" },
},
required: ["case_number"],
},
},
{
toolKey: "legal_case_create",
name: "legal_case_create",
displayName: "Create Legal Case",
description: "Create a new appeal case with linked Paperclip issue",
parametersSchema: {
type: "object" as const,
properties: {
case_number: { type: "string" as const },
title: { type: "string" as const },
appellants: {
type: "array" as const,
items: { type: "string" as const },
},
respondents: {
type: "array" as const,
items: { type: "string" as const },
},
subject: { type: "string" as const },
property_address: { type: "string" as const },
expected_outcome: { type: "string" as const },
},
required: ["case_number", "title"],
},
},
{
toolKey: "legal_case_update",
name: "legal_case_update",
displayName: "Update Legal Case",
description: "Update a legal case status, title, or outcome",
parametersSchema: {
type: "object" as const,
properties: {
case_number: { type: "string" as const },
status: { type: "string" as const },
title: { type: "string" as const },
expected_outcome: { type: "string" as const },
},
required: ["case_number"],
},
},
{
toolKey: "legal_case_status",
name: "legal_case_status",
displayName: "Get Case Workflow Status",
description: "Get full workflow status: documents, drafts, next steps",
parametersSchema: {
type: "object" as const,
properties: {
case_number: { type: "string" as const },
},
required: ["case_number"],
},
},
{
toolKey: "legal_search",
name: "legal_search",
displayName: "Search Legal Precedents",
description: "Semantic RAG search across previous decisions",
parametersSchema: {
type: "object" as const,
properties: {
query: {
type: "string" as const,
description: "Search query in Hebrew",
},
limit: { type: "number" as const },
section_type: { type: "string" as const },
},
required: ["query"],
},
},
{
toolKey: "legal_case_template",
name: "legal_case_template",
displayName: "Get Decision Template",
description: "Get outcome-aware decision template for 12-block structure",
parametersSchema: {
type: "object" as const,
properties: {
case_number: { type: "string" as const },
},
required: ["case_number"],
},
},
{
toolKey: "legal_processing_status",
name: "legal_processing_status",
displayName: "Get Processing Status",
description: "Get overall system processing status",
parametersSchema: { type: "object" as const, properties: {} },
},
],
jobs: [
{
jobKey: "sync-case-status",
displayName: "Sync Legal Case Status",
description:
"Polls legal-ai for case status changes and updates Paperclip issues",
schedule: "*/15 * * * *",
},
{
jobKey: "stale-case-reminder",
displayName: "תזכורת תיקים תקועים",
description: "מזהה תיקים שלא עודכנו 30+ ימים ומוסיף תגובה ל-issue",
schedule: "0 8 * * *",
},
{
jobKey: "weekly-feedback-analysis",
displayName: "ניתוח פידבק שבועי",
description:
'מסכם פידבק יו"ר מהשבוע האחרון ומעדכן את decision-lessons.md',
schedule: "0 19 * * 0",
},
],
webhooks: [
{
endpointKey: "case-status",
displayName: "עדכון סטטוס תיק",
description:
"מקבל עדכוני סטטוס מ-legal-ai ומפרסם תגובה על ה-issue המקושר",
},
],
};