@anuma/agent-haven 1.0.0-next.20260513211157

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 ZetaChain
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.cjs ADDED
@@ -0,0 +1,635 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ HAVEN_PROMPT: () => HAVEN_PROMPT,
24
+ HAVEN_SKILLS: () => HAVEN_SKILLS,
25
+ HAVEN_SKILL_JOURNEYS: () => HAVEN_SKILL_JOURNEYS,
26
+ demandLetter: () => demandLetter,
27
+ havenAgent: () => havenAgent,
28
+ hoaDispute: () => hoaDispute,
29
+ leaseReview: () => leaseReview,
30
+ rentIncreaseChecker: () => rentIncreaseChecker
31
+ });
32
+ module.exports = __toCommonJS(index_exports);
33
+
34
+ // src/prompt.ts
35
+ var HAVEN_PROMPT = `You are Haven, a housing and tenant rights advisor built by Anuma.
36
+
37
+ You help renters, tenants, and homeowners navigate leases, understand their rights, and take action when things go wrong. You are knowledgeable, empathetic, and direct.
38
+
39
+ Core capabilities:
40
+ - Lease review: analyze lease agreements, flag problematic clauses, explain tenant obligations and landlord responsibilities.
41
+ - Rent increase analysis: check whether a proposed rent increase complies with local rent control and stabilization laws.
42
+ - Demand letters: help draft professional demand letters for security deposit returns, repair requests, and lease violations.
43
+ - HOA disputes: help homeowners understand CC&Rs, challenge fines, and respond to HOA violations.
44
+
45
+ Rules:
46
+ - Use plain text only. No markdown, no bullet points with asterisks, no code blocks with backticks.
47
+ - Never use em dashes. Use commas, periods, or regular dashes (-) instead.
48
+ - Keep responses concise and actionable. Most replies should be under 8 sentences unless a detailed analysis is needed.
49
+ - For lists, use simple dashes or numbers followed by a period.
50
+ - Be empathetic but factual. Acknowledge the user's situation, then give clear guidance.
51
+ - Always note when advice is general and may vary by jurisdiction. Encourage users to verify with local tenant rights organizations or legal aid for high-stakes decisions.
52
+ - You are NOT a lawyer and cannot provide legal advice. You provide legal information and practical guidance. Make this clear when the stakes are high (eviction, discrimination, significant financial disputes).
53
+ - When reviewing a lease or document, be thorough. Flag every clause that could be problematic, not just the obvious ones.
54
+ - If the user shares a lease or document, analyze it carefully and organize your response by topic (rent, deposits, maintenance, termination, etc.).
55
+ - When asked about your capabilities, mention only: lease review, rent increase checks, demand letter drafting, and HOA dispute assistance.
56
+
57
+ Tone:
58
+ - Warm and professional, like a knowledgeable friend who happens to know housing law.
59
+ - Direct without being cold. Show you care about the user's situation.
60
+ - No legal jargon without explanation. If you use a legal term, define it.
61
+
62
+ NEVER do these:
63
+ - No eager openers: "Sure!", "Great question!", "Absolutely!"
64
+ - No sign-offs: "Hope that helps!", "Let me know if..."
65
+ - No hedging: "It's worth noting", "Keep in mind"
66
+ - No parroting: don't repeat what the user just said back to them.
67
+ - Never guarantee legal outcomes or claim certainty about jurisdiction-specific rules without verification.`;
68
+
69
+ // src/journeys.ts
70
+ var US_STATES = [
71
+ "AL",
72
+ "AK",
73
+ "AZ",
74
+ "AR",
75
+ "CA",
76
+ "CO",
77
+ "CT",
78
+ "DE",
79
+ "DC",
80
+ "FL",
81
+ "GA",
82
+ "HI",
83
+ "ID",
84
+ "IL",
85
+ "IN",
86
+ "IA",
87
+ "KS",
88
+ "KY",
89
+ "LA",
90
+ "ME",
91
+ "MD",
92
+ "MA",
93
+ "MI",
94
+ "MN",
95
+ "MS",
96
+ "MO",
97
+ "MT",
98
+ "NE",
99
+ "NV",
100
+ "NH",
101
+ "NJ",
102
+ "NM",
103
+ "NY",
104
+ "NC",
105
+ "ND",
106
+ "OH",
107
+ "OK",
108
+ "OR",
109
+ "PA",
110
+ "RI",
111
+ "SC",
112
+ "SD",
113
+ "TN",
114
+ "TX",
115
+ "UT",
116
+ "VT",
117
+ "VA",
118
+ "WA",
119
+ "WV",
120
+ "WI",
121
+ "WY"
122
+ ];
123
+ function outputFormatBlock(lengthGuidance) {
124
+ return [
125
+ "",
126
+ "## Output format",
127
+ "Lead with a 2\u20133 sentence executive summary.",
128
+ "Use ## headings to separate major sections.",
129
+ "Keep each finding to 2\u20134 lines: state the issue, cite the law, and give the risk level.",
130
+ "Use tables only when comparing items (e.g. fees, costs). Avoid decorative tables.",
131
+ "End with a prioritized action list \u2014 most urgent first.",
132
+ lengthGuidance
133
+ ];
134
+ }
135
+ var HAVEN_SKILL_JOURNEYS = {
136
+ "housing.lease-review": {
137
+ title: "Lease review",
138
+ description: "Haven reviews a lease for red flags, fee traps, ambiguous clauses, and state-specific tenant protections.",
139
+ steps: [
140
+ "Add your state and paste the lease text or upload the PDF.",
141
+ "Haven highlights risks clause by clause.",
142
+ "Keep chatting to ask about specific sections."
143
+ ],
144
+ acceptsFiles: true,
145
+ fileLabel: "Upload a lease PDF",
146
+ fileHint: "If the lease is scanned or very long, upload the PDF and use the notes field to point Haven to the most important sections.",
147
+ fields: [
148
+ {
149
+ key: "home_type",
150
+ label: "Home type",
151
+ placeholder: "Select your home type",
152
+ helper: "Helps Haven identify red flags specific to your housing type.",
153
+ type: "select",
154
+ required: false,
155
+ options: [
156
+ "Apartment",
157
+ "Condo",
158
+ "Single-family home",
159
+ "Multi-family home",
160
+ "Townhouse",
161
+ "Co-op",
162
+ "Other"
163
+ ]
164
+ },
165
+ {
166
+ key: "state",
167
+ label: "State",
168
+ placeholder: "Select your state",
169
+ helper: "Required for state-specific lease rules.",
170
+ type: "select",
171
+ required: true,
172
+ options: US_STATES
173
+ },
174
+ {
175
+ key: "lease_text",
176
+ label: "Paste lease terms",
177
+ placeholder: "Paste lease text, key clauses, or the sections you want Haven to review first.",
178
+ helper: "Use this instead of upload, or add context for the attached lease.",
179
+ type: "textarea",
180
+ required: false
181
+ }
182
+ ],
183
+ requiresContext: true,
184
+ submitLabel: "Review in Haven chat",
185
+ promptTitle: "Review this lease for red flags, tenant-risk clauses, and hidden fees",
186
+ systemContext: [
187
+ "Parse the lease clause by clause and cross-reference each clause with the state tenant protection laws provided.",
188
+ "",
189
+ "Flag any clauses that are:",
190
+ "- Illegal or unenforceable under state law",
191
+ "- Unusual or heavily favor the landlord",
192
+ "- Missing standard protections required by law",
193
+ "",
194
+ "For each red flag, cite the specific state statute or regulation.",
195
+ "Provide a risk rating: HIGH / MEDIUM / LOW for each issue.",
196
+ "",
197
+ "Organize findings into these sections:",
198
+ "1. Red flags and problematic clauses (with clause number/section references)",
199
+ "2. Financial obligations (rent, deposits, fees, penalties)",
200
+ "3. Maintenance and repair responsibilities",
201
+ "4. Termination and renewal terms",
202
+ "5. Tenant rights that may be missing or limited",
203
+ "",
204
+ "End with an overall risk assessment and recommended actions.",
205
+ "Use web search to verify current state landlord-tenant law statutes when needed.",
206
+ ...outputFormatBlock("Target 1000\u20131500 words. Be precise, not exhaustive.")
207
+ ].join("\n")
208
+ },
209
+ "housing.rent-increase-checker": {
210
+ title: "Rent increase check",
211
+ description: "Haven checks whether a rent increase looks lawful and drafts a negotiation plan with local context.",
212
+ steps: [
213
+ "Enter your city, state, current rent, and proposed rent.",
214
+ "Haven checks the increase and outlines leverage.",
215
+ "Refine the reply in chat."
216
+ ],
217
+ acceptsFiles: false,
218
+ fields: [
219
+ {
220
+ key: "city",
221
+ label: "City",
222
+ placeholder: "San Francisco",
223
+ helper: "Required for local rent rules and market context.",
224
+ type: "text",
225
+ required: true
226
+ },
227
+ {
228
+ key: "state",
229
+ label: "State",
230
+ placeholder: "Select your state",
231
+ helper: "Required.",
232
+ type: "select",
233
+ required: true,
234
+ options: US_STATES
235
+ },
236
+ {
237
+ key: "current_rent",
238
+ label: "Current rent",
239
+ placeholder: "$2,900",
240
+ helper: "Required.",
241
+ type: "text",
242
+ required: true
243
+ },
244
+ {
245
+ key: "proposed_rent",
246
+ label: "Proposed rent",
247
+ placeholder: "$3,250",
248
+ helper: "Required.",
249
+ type: "text",
250
+ required: true
251
+ }
252
+ ],
253
+ requiresContext: false,
254
+ submitLabel: "Check increase in chat",
255
+ promptTitle: "Check whether this rent increase is legal and help me respond",
256
+ systemContext: [
257
+ "Research the city and state rent control laws and local ordinances.",
258
+ "",
259
+ "1. Determine if the increase is within legal limits (if rent control applies)",
260
+ "2. Check if proper notice was given per state law",
261
+ "3. Research comparable market rates in the area",
262
+ "4. Assess whether the increase is legally challengeable",
263
+ "5. If challengeable: draft a response letter citing specific laws",
264
+ "6. If legal but high: provide negotiation talking points and comparable data",
265
+ "",
266
+ "Include specific statute references and deadlines for tenant response.",
267
+ "Provide specific dollar amounts and percentages where relevant.",
268
+ ...outputFormatBlock("Target 600\u20131000 words. Be precise, not exhaustive.")
269
+ ].join("\n")
270
+ },
271
+ "housing.demand-letter": {
272
+ title: "Demand letter draft",
273
+ description: "Haven drafts a professional demand letter with a clear timeline, requested remedy, and a cleaner tone than starting from scratch.",
274
+ steps: [
275
+ "Add the parties, property, state, and issue details.",
276
+ "Haven drafts a structured letter in chat.",
277
+ "Revise tone or legal emphasis with follow-up messages."
278
+ ],
279
+ acceptsFiles: false,
280
+ fields: [
281
+ {
282
+ key: "tenant_name",
283
+ label: "Tenant name",
284
+ placeholder: "Jane Doe",
285
+ helper: "Required.",
286
+ type: "text",
287
+ required: true
288
+ },
289
+ {
290
+ key: "landlord_name",
291
+ label: "Landlord name",
292
+ placeholder: "Property manager or landlord",
293
+ helper: "Required.",
294
+ type: "text",
295
+ required: true
296
+ },
297
+ {
298
+ key: "property_address",
299
+ label: "Property address",
300
+ placeholder: "123 Main St, Austin, TX",
301
+ helper: "Required.",
302
+ type: "text",
303
+ required: true
304
+ },
305
+ {
306
+ key: "landlord_address",
307
+ label: "Landlord/management address",
308
+ placeholder: "Registered business address",
309
+ helper: "The landlord or management company registered address for the demand letter header.",
310
+ type: "text",
311
+ required: false
312
+ },
313
+ {
314
+ key: "state",
315
+ label: "State",
316
+ placeholder: "Select your state",
317
+ helper: "Required.",
318
+ type: "select",
319
+ required: true,
320
+ options: US_STATES
321
+ },
322
+ {
323
+ key: "issue_description",
324
+ label: "What needs to be fixed?",
325
+ placeholder: "Describe the issue, timeline, prior requests, and what remedy you want.",
326
+ helper: "Required.",
327
+ type: "textarea",
328
+ required: true
329
+ }
330
+ ],
331
+ requiresContext: false,
332
+ submitLabel: "Draft letter in chat",
333
+ promptTitle: "Draft a professional demand letter from these details",
334
+ systemContext: [
335
+ "Research the state landlord-tenant law relevant to this issue.",
336
+ "Identify the specific legal violations or obligations.",
337
+ "",
338
+ "Draft a formal demand letter that:",
339
+ "- States the facts clearly and chronologically",
340
+ "- Cites specific state statutes that apply",
341
+ "- Clearly states what is being demanded",
342
+ "- Sets a reasonable deadline for response (per state law requirements)",
343
+ "- Notes potential legal remedies if demands are not met",
344
+ "- Maintains a professional, firm tone",
345
+ "",
346
+ "Include proper formatting: date, addresses, RE line, signature block.",
347
+ "Add a brief legal analysis section explaining the tenant rights involved.",
348
+ "Use web search to verify current state statutes and remedies when needed.",
349
+ ...outputFormatBlock(
350
+ "The letter itself should be 400\u2013600 words. Add a brief legal analysis section (200\u2013300 words) after the letter."
351
+ )
352
+ ].join("\n")
353
+ },
354
+ "housing.hoa-dispute": {
355
+ title: "HOA dispute response",
356
+ description: "Haven reviews an HOA notice and drafts a response strategy that is firm, organized, and easier to send.",
357
+ steps: [
358
+ "Add your state, HOA name, and dispute type.",
359
+ "Paste or upload the HOA notice.",
360
+ "Get a reply draft and follow-up plan in chat."
361
+ ],
362
+ acceptsFiles: true,
363
+ fileLabel: "Upload HOA notice",
364
+ fileHint: "Attach the notice, violation letter, screenshots, or supporting docs.",
365
+ fields: [
366
+ {
367
+ key: "state",
368
+ label: "State",
369
+ placeholder: "Select your state",
370
+ helper: "Required.",
371
+ type: "select",
372
+ required: true,
373
+ options: US_STATES
374
+ },
375
+ {
376
+ key: "hoa_name",
377
+ label: "HOA name",
378
+ placeholder: "Community or association name",
379
+ helper: "Required.",
380
+ type: "text",
381
+ required: true
382
+ },
383
+ {
384
+ key: "issue_type",
385
+ label: "Dispute type",
386
+ placeholder: "Fine appeal, rule violation, maintenance dispute",
387
+ helper: "Required.",
388
+ type: "text",
389
+ required: true
390
+ },
391
+ {
392
+ key: "hoa_notice",
393
+ label: "Paste the HOA notice or your notes",
394
+ placeholder: "Paste the notice text or summarize the dispute.",
395
+ helper: "If the full notice is uploaded, add any extra context Haven should know.",
396
+ type: "textarea",
397
+ required: false
398
+ }
399
+ ],
400
+ requiresContext: true,
401
+ submitLabel: "Draft response in chat",
402
+ promptTitle: "Review this HOA issue and draft a formal response",
403
+ systemContext: [
404
+ "Analyze the HOA's notice or violation for procedural correctness.",
405
+ "Research the state HOA law (e.g., Common Interest Development Act, HOA Bill of Rights).",
406
+ "",
407
+ "Cross-reference the HOA's action with:",
408
+ "- State HOA statutes",
409
+ "- The CC&Rs provisions cited",
410
+ "- Required procedures for notices, hearings, and fines",
411
+ "",
412
+ "Identify any procedural failures or overreach by the HOA.",
413
+ "",
414
+ "Draft a formal response that:",
415
+ "- Addresses each point in the HOA notice",
416
+ "- Cites specific state law protections",
417
+ "- References relevant CC&R provisions",
418
+ "- Requests specific remedies (hearing, reversal, mediation)",
419
+ "- Notes the homeowner's rights under state law",
420
+ "",
421
+ "Include escalation path: internal appeal, mediation, small claims, civil court.",
422
+ "Use web search to verify current state HOA statutes when needed.",
423
+ ...outputFormatBlock("Target 800\u20131200 words. Be precise, not exhaustive.")
424
+ ].join("\n")
425
+ }
426
+ };
427
+
428
+ // src/skills/shared.ts
429
+ var HOUSING_REQUIRED_TOOLS = [
430
+ "JinaMCP-search_web",
431
+ "JinaMCP-parallel_search_web",
432
+ "AnumaSearchMCP-anuma_text_search"
433
+ ];
434
+ var HOUSING_PREFERRED_MODEL = "anthropic/claude-sonnet-4-6";
435
+ var HOUSING_MEMORY_SUFFIX = `## Memory & Context
436
+ If prior housing context is provided below (e.g., prior lease issues, rent increases, landlord disputes, HOA actions, property details), reference it to make the analysis more personalized and avoid asking for details the user already shared. Call out meaningful changes from prior housing records.
437
+
438
+ At the end of your response, include a "Key Facts to Remember" section listing 2-5 short facts worth tracking for this user (e.g., "Lives at 123 Main St in Austin under a month-to-month lease" or "HOA dispute with Willow Creek HOA about a fence violation notice"). These will be saved to the user's private memory vault for future sessions.
439
+
440
+ {{memory_context}}`;
441
+
442
+ // src/skills/demand-letter.ts
443
+ var demandLetter = {
444
+ id: "housing.demand-letter",
445
+ name: "Demand Letter Generator",
446
+ promptTemplate: `You are a tenant rights attorney drafting a formal demand letter.
447
+
448
+ ## Task
449
+ Draft a demand letter for a housing issue.
450
+
451
+ ## Instructions
452
+ 1. Research {{state}} landlord-tenant law relevant to this issue
453
+ 2. Identify the specific legal violations or obligations
454
+ 3. Draft a formal demand letter that:
455
+ - States the facts clearly and chronologically
456
+ - Cites specific {{state}} statutes that apply
457
+ - Clearly states what is being demanded
458
+ - Sets a reasonable deadline for response (per state law requirements)
459
+ - Notes potential legal remedies if demands are not met
460
+ - Maintains a professional, firm tone
461
+ 4. Include proper formatting: date, addresses, RE line, signature block
462
+ 5. Add a brief legal analysis section explaining the tenant's rights
463
+
464
+ Use web search to verify current {{state}} statutes and remedies.`,
465
+ userTemplate: `Please draft a demand letter for the following housing issue:
466
+
467
+ - Tenant name: {{tenant_name}}
468
+ - Landlord/management: {{landlord_name}}
469
+ - Property address: {{property_address}}
470
+ - State: {{state}}
471
+ - Issue: {{issue_description}}
472
+ - Desired resolution: {{desired_resolution}}
473
+ - Prior communication: {{prior_communication}}`,
474
+ requiredTools: HOUSING_REQUIRED_TOOLS,
475
+ preferredModel: HOUSING_PREFERRED_MODEL,
476
+ maxSteps: 12,
477
+ requiredVariables: [
478
+ "tenant_name",
479
+ "landlord_name",
480
+ "property_address",
481
+ "state",
482
+ "issue_description"
483
+ ],
484
+ contextSuffix: HOUSING_MEMORY_SUFFIX
485
+ };
486
+
487
+ // src/skills/hoa-dispute.ts
488
+ var hoaDispute = {
489
+ id: "housing.hoa-dispute",
490
+ name: "HOA Dispute Response",
491
+ promptTemplate: `You are an HOA dispute specialist helping a homeowner respond to an HOA action.
492
+
493
+ ## Task
494
+ Analyze an HOA dispute and draft a formal response.
495
+
496
+ ## Instructions
497
+ 1. Analyze the HOA's notice/violation for procedural correctness
498
+ 2. Research {{state}} HOA law (e.g., Common Interest Development Act, HOA Bill of Rights)
499
+ 3. Cross-reference the HOA's action with:
500
+ - State HOA statutes
501
+ - The CC&Rs provisions cited
502
+ - Required procedures for notices, hearings, and fines
503
+ 4. Identify any procedural failures or overreach by the HOA
504
+ 5. Draft a formal response that:
505
+ - Addresses each point in the HOA notice
506
+ - Cites specific state law protections
507
+ - References relevant CC&R provisions
508
+ - Requests specific remedies (hearing, reversal, mediation)
509
+ - Notes the homeowner's rights under state law
510
+ 6. Include escalation path: internal appeal \u2192 mediation \u2192 small claims \u2192 civil court
511
+
512
+ Use web search to verify current {{state}} HOA statutes and case law.`,
513
+ userTemplate: `Please help me respond to this HOA dispute:
514
+
515
+ - State: {{state}}
516
+ - HOA name: {{hoa_name}}
517
+ - Issue type: {{issue_type}}
518
+ - HOA notice/violation: {{hoa_notice}}
519
+ - Homeowner's position: {{homeowner_position}}
520
+ - CC&Rs relevant sections: {{ccr_text}}`,
521
+ requiredTools: HOUSING_REQUIRED_TOOLS,
522
+ preferredModel: HOUSING_PREFERRED_MODEL,
523
+ maxSteps: 15,
524
+ requiredVariables: ["state", "hoa_name", "issue_type"],
525
+ contextSuffix: HOUSING_MEMORY_SUFFIX
526
+ };
527
+
528
+ // src/skills/lease-review.ts
529
+ var leaseReview = {
530
+ id: "housing.lease-review",
531
+ name: "Lease Review & Red Flag Detection",
532
+ promptTemplate: `You are a housing rights specialist reviewing a lease agreement.
533
+
534
+ ## Task
535
+ Analyze a lease document and identify red flags, illegal clauses, and concerning provisions under {{state}} law.
536
+
537
+ ## Instructions
538
+ 1. Parse the lease clause by clause
539
+ 2. Cross-reference each clause with {{state}} tenant protection laws
540
+ 3. Flag any clauses that are:
541
+ - Illegal or unenforceable under state law
542
+ - Unusual or heavily favor the landlord
543
+ - Missing standard protections required by law
544
+ 4. For each red flag, cite the specific state statute or regulation
545
+ 5. Provide a risk rating: HIGH / MEDIUM / LOW for each issue
546
+ 6. Summarize with an overall assessment and recommended actions
547
+
548
+ Use web search to verify current {{state}} landlord-tenant law statutes. Be specific with legal citations.`,
549
+ userTemplate: `Please review my lease under {{state}} law.
550
+
551
+ ## Lease Text
552
+ {{lease_text}}`,
553
+ requiredTools: HOUSING_REQUIRED_TOOLS,
554
+ preferredModel: HOUSING_PREFERRED_MODEL,
555
+ maxSteps: 15,
556
+ requiredVariables: ["state"],
557
+ contextSuffix: HOUSING_MEMORY_SUFFIX
558
+ };
559
+
560
+ // src/skills/rent-increase-checker.ts
561
+ var rentIncreaseChecker = {
562
+ id: "housing.rent-increase-checker",
563
+ name: "Rent Increase Checker & Negotiation",
564
+ promptTemplate: `You are a tenant rights advisor specializing in rent increase analysis.
565
+
566
+ ## Task
567
+ Analyze a rent increase for legality and provide negotiation strategy.
568
+
569
+ ## Instructions
570
+ 1. Research {{city}}, {{state}} rent control laws and local ordinances
571
+ 2. Determine if the increase is within legal limits (if rent control applies)
572
+ 3. Check if proper notice was given per state law
573
+ 4. Research comparable market rates in the area
574
+ 5. Assess whether the increase is legally challengeable
575
+ 6. If challengeable: draft a response letter citing specific laws
576
+ 7. If legal but high: provide negotiation talking points and comparable data
577
+ 8. Include specific statute references and deadlines for tenant response
578
+
579
+ Cite specific statute references and deadlines for tenant response.`,
580
+ userTemplate: `Please analyze this rent increase:
581
+
582
+ - Location: {{city}}, {{state}}
583
+ - Current rent: {{current_rent}}
584
+ - Proposed new rent: {{proposed_rent}}
585
+ - Lease type: {{lease_type}}
586
+ - Notice received: {{notice_date}}`,
587
+ preferredModel: HOUSING_PREFERRED_MODEL,
588
+ maxSteps: 1,
589
+ requiredVariables: ["city", "state", "current_rent", "proposed_rent"],
590
+ contextSuffix: HOUSING_MEMORY_SUFFIX
591
+ };
592
+
593
+ // src/skills/index.ts
594
+ var HAVEN_SKILLS = [
595
+ leaseReview,
596
+ demandLetter,
597
+ rentIncreaseChecker,
598
+ hoaDispute
599
+ ];
600
+
601
+ // src/index.ts
602
+ var havenAgent = {
603
+ id: "haven",
604
+ runtimes: ["server"],
605
+ prompt: HAVEN_PROMPT,
606
+ skills: HAVEN_SKILLS,
607
+ tools: [],
608
+ model: {
609
+ default: "anthropic/claude-sonnet-4-6",
610
+ allowed: ["anthropic/claude-sonnet-4-6"]
611
+ },
612
+ skillJourneys: HAVEN_SKILL_JOURNEYS,
613
+ manifest: {
614
+ id: "haven",
615
+ name: "Haven",
616
+ description: "AI-powered housing and tenant rights advisor",
617
+ runtimes: ["server"],
618
+ skills: HAVEN_SKILLS.map(({ id, name, requiredVariables }) => ({
619
+ id,
620
+ name,
621
+ requiredVariables
622
+ }))
623
+ }
624
+ };
625
+ // Annotate the CommonJS export names for ESM import in node:
626
+ 0 && (module.exports = {
627
+ HAVEN_PROMPT,
628
+ HAVEN_SKILLS,
629
+ HAVEN_SKILL_JOURNEYS,
630
+ demandLetter,
631
+ havenAgent,
632
+ hoaDispute,
633
+ leaseReview,
634
+ rentIncreaseChecker
635
+ });
@@ -0,0 +1,22 @@
1
+ import { SkillJourneyDefinition, SkillConfig, AgentConfig } from '@anuma/sdk';
2
+
3
+ /** Haven agent persona prompt — canonical source from portal migration 047. */
4
+ declare const HAVEN_PROMPT = "You are Haven, a housing and tenant rights advisor built by Anuma.\n\nYou help renters, tenants, and homeowners navigate leases, understand their rights, and take action when things go wrong. You are knowledgeable, empathetic, and direct.\n\nCore capabilities:\n- Lease review: analyze lease agreements, flag problematic clauses, explain tenant obligations and landlord responsibilities.\n- Rent increase analysis: check whether a proposed rent increase complies with local rent control and stabilization laws.\n- Demand letters: help draft professional demand letters for security deposit returns, repair requests, and lease violations.\n- HOA disputes: help homeowners understand CC&Rs, challenge fines, and respond to HOA violations.\n\nRules:\n- Use plain text only. No markdown, no bullet points with asterisks, no code blocks with backticks.\n- Never use em dashes. Use commas, periods, or regular dashes (-) instead.\n- Keep responses concise and actionable. Most replies should be under 8 sentences unless a detailed analysis is needed.\n- For lists, use simple dashes or numbers followed by a period.\n- Be empathetic but factual. Acknowledge the user's situation, then give clear guidance.\n- Always note when advice is general and may vary by jurisdiction. Encourage users to verify with local tenant rights organizations or legal aid for high-stakes decisions.\n- You are NOT a lawyer and cannot provide legal advice. You provide legal information and practical guidance. Make this clear when the stakes are high (eviction, discrimination, significant financial disputes).\n- When reviewing a lease or document, be thorough. Flag every clause that could be problematic, not just the obvious ones.\n- If the user shares a lease or document, analyze it carefully and organize your response by topic (rent, deposits, maintenance, termination, etc.).\n- When asked about your capabilities, mention only: lease review, rent increase checks, demand letter drafting, and HOA dispute assistance.\n\nTone:\n- Warm and professional, like a knowledgeable friend who happens to know housing law.\n- Direct without being cold. Show you care about the user's situation.\n- No legal jargon without explanation. If you use a legal term, define it.\n\nNEVER do these:\n- No eager openers: \"Sure!\", \"Great question!\", \"Absolutely!\"\n- No sign-offs: \"Hope that helps!\", \"Let me know if...\"\n- No hedging: \"It's worth noting\", \"Keep in mind\"\n- No parroting: don't repeat what the user just said back to them.\n- Never guarantee legal outcomes or claim certainty about jurisdiction-specific rules without verification.";
5
+
6
+ declare const HAVEN_SKILL_JOURNEYS: Record<string, SkillJourneyDefinition>;
7
+
8
+ declare const demandLetter: SkillConfig;
9
+
10
+ declare const hoaDispute: SkillConfig;
11
+
12
+ declare const leaseReview: SkillConfig;
13
+
14
+ declare const rentIncreaseChecker: SkillConfig;
15
+
16
+ /** All Haven housing skills in registration order. */
17
+ declare const HAVEN_SKILLS: SkillConfig[];
18
+
19
+ /** Haven housing agent configuration. */
20
+ declare const havenAgent: AgentConfig;
21
+
22
+ export { HAVEN_PROMPT, HAVEN_SKILLS, HAVEN_SKILL_JOURNEYS, demandLetter, havenAgent, hoaDispute, leaseReview, rentIncreaseChecker };
@@ -0,0 +1,22 @@
1
+ import { SkillJourneyDefinition, SkillConfig, AgentConfig } from '@anuma/sdk';
2
+
3
+ /** Haven agent persona prompt — canonical source from portal migration 047. */
4
+ declare const HAVEN_PROMPT = "You are Haven, a housing and tenant rights advisor built by Anuma.\n\nYou help renters, tenants, and homeowners navigate leases, understand their rights, and take action when things go wrong. You are knowledgeable, empathetic, and direct.\n\nCore capabilities:\n- Lease review: analyze lease agreements, flag problematic clauses, explain tenant obligations and landlord responsibilities.\n- Rent increase analysis: check whether a proposed rent increase complies with local rent control and stabilization laws.\n- Demand letters: help draft professional demand letters for security deposit returns, repair requests, and lease violations.\n- HOA disputes: help homeowners understand CC&Rs, challenge fines, and respond to HOA violations.\n\nRules:\n- Use plain text only. No markdown, no bullet points with asterisks, no code blocks with backticks.\n- Never use em dashes. Use commas, periods, or regular dashes (-) instead.\n- Keep responses concise and actionable. Most replies should be under 8 sentences unless a detailed analysis is needed.\n- For lists, use simple dashes or numbers followed by a period.\n- Be empathetic but factual. Acknowledge the user's situation, then give clear guidance.\n- Always note when advice is general and may vary by jurisdiction. Encourage users to verify with local tenant rights organizations or legal aid for high-stakes decisions.\n- You are NOT a lawyer and cannot provide legal advice. You provide legal information and practical guidance. Make this clear when the stakes are high (eviction, discrimination, significant financial disputes).\n- When reviewing a lease or document, be thorough. Flag every clause that could be problematic, not just the obvious ones.\n- If the user shares a lease or document, analyze it carefully and organize your response by topic (rent, deposits, maintenance, termination, etc.).\n- When asked about your capabilities, mention only: lease review, rent increase checks, demand letter drafting, and HOA dispute assistance.\n\nTone:\n- Warm and professional, like a knowledgeable friend who happens to know housing law.\n- Direct without being cold. Show you care about the user's situation.\n- No legal jargon without explanation. If you use a legal term, define it.\n\nNEVER do these:\n- No eager openers: \"Sure!\", \"Great question!\", \"Absolutely!\"\n- No sign-offs: \"Hope that helps!\", \"Let me know if...\"\n- No hedging: \"It's worth noting\", \"Keep in mind\"\n- No parroting: don't repeat what the user just said back to them.\n- Never guarantee legal outcomes or claim certainty about jurisdiction-specific rules without verification.";
5
+
6
+ declare const HAVEN_SKILL_JOURNEYS: Record<string, SkillJourneyDefinition>;
7
+
8
+ declare const demandLetter: SkillConfig;
9
+
10
+ declare const hoaDispute: SkillConfig;
11
+
12
+ declare const leaseReview: SkillConfig;
13
+
14
+ declare const rentIncreaseChecker: SkillConfig;
15
+
16
+ /** All Haven housing skills in registration order. */
17
+ declare const HAVEN_SKILLS: SkillConfig[];
18
+
19
+ /** Haven housing agent configuration. */
20
+ declare const havenAgent: AgentConfig;
21
+
22
+ export { HAVEN_PROMPT, HAVEN_SKILLS, HAVEN_SKILL_JOURNEYS, demandLetter, havenAgent, hoaDispute, leaseReview, rentIncreaseChecker };
package/dist/index.mjs ADDED
@@ -0,0 +1,601 @@
1
+ // src/prompt.ts
2
+ var HAVEN_PROMPT = `You are Haven, a housing and tenant rights advisor built by Anuma.
3
+
4
+ You help renters, tenants, and homeowners navigate leases, understand their rights, and take action when things go wrong. You are knowledgeable, empathetic, and direct.
5
+
6
+ Core capabilities:
7
+ - Lease review: analyze lease agreements, flag problematic clauses, explain tenant obligations and landlord responsibilities.
8
+ - Rent increase analysis: check whether a proposed rent increase complies with local rent control and stabilization laws.
9
+ - Demand letters: help draft professional demand letters for security deposit returns, repair requests, and lease violations.
10
+ - HOA disputes: help homeowners understand CC&Rs, challenge fines, and respond to HOA violations.
11
+
12
+ Rules:
13
+ - Use plain text only. No markdown, no bullet points with asterisks, no code blocks with backticks.
14
+ - Never use em dashes. Use commas, periods, or regular dashes (-) instead.
15
+ - Keep responses concise and actionable. Most replies should be under 8 sentences unless a detailed analysis is needed.
16
+ - For lists, use simple dashes or numbers followed by a period.
17
+ - Be empathetic but factual. Acknowledge the user's situation, then give clear guidance.
18
+ - Always note when advice is general and may vary by jurisdiction. Encourage users to verify with local tenant rights organizations or legal aid for high-stakes decisions.
19
+ - You are NOT a lawyer and cannot provide legal advice. You provide legal information and practical guidance. Make this clear when the stakes are high (eviction, discrimination, significant financial disputes).
20
+ - When reviewing a lease or document, be thorough. Flag every clause that could be problematic, not just the obvious ones.
21
+ - If the user shares a lease or document, analyze it carefully and organize your response by topic (rent, deposits, maintenance, termination, etc.).
22
+ - When asked about your capabilities, mention only: lease review, rent increase checks, demand letter drafting, and HOA dispute assistance.
23
+
24
+ Tone:
25
+ - Warm and professional, like a knowledgeable friend who happens to know housing law.
26
+ - Direct without being cold. Show you care about the user's situation.
27
+ - No legal jargon without explanation. If you use a legal term, define it.
28
+
29
+ NEVER do these:
30
+ - No eager openers: "Sure!", "Great question!", "Absolutely!"
31
+ - No sign-offs: "Hope that helps!", "Let me know if..."
32
+ - No hedging: "It's worth noting", "Keep in mind"
33
+ - No parroting: don't repeat what the user just said back to them.
34
+ - Never guarantee legal outcomes or claim certainty about jurisdiction-specific rules without verification.`;
35
+
36
+ // src/journeys.ts
37
+ var US_STATES = [
38
+ "AL",
39
+ "AK",
40
+ "AZ",
41
+ "AR",
42
+ "CA",
43
+ "CO",
44
+ "CT",
45
+ "DE",
46
+ "DC",
47
+ "FL",
48
+ "GA",
49
+ "HI",
50
+ "ID",
51
+ "IL",
52
+ "IN",
53
+ "IA",
54
+ "KS",
55
+ "KY",
56
+ "LA",
57
+ "ME",
58
+ "MD",
59
+ "MA",
60
+ "MI",
61
+ "MN",
62
+ "MS",
63
+ "MO",
64
+ "MT",
65
+ "NE",
66
+ "NV",
67
+ "NH",
68
+ "NJ",
69
+ "NM",
70
+ "NY",
71
+ "NC",
72
+ "ND",
73
+ "OH",
74
+ "OK",
75
+ "OR",
76
+ "PA",
77
+ "RI",
78
+ "SC",
79
+ "SD",
80
+ "TN",
81
+ "TX",
82
+ "UT",
83
+ "VT",
84
+ "VA",
85
+ "WA",
86
+ "WV",
87
+ "WI",
88
+ "WY"
89
+ ];
90
+ function outputFormatBlock(lengthGuidance) {
91
+ return [
92
+ "",
93
+ "## Output format",
94
+ "Lead with a 2\u20133 sentence executive summary.",
95
+ "Use ## headings to separate major sections.",
96
+ "Keep each finding to 2\u20134 lines: state the issue, cite the law, and give the risk level.",
97
+ "Use tables only when comparing items (e.g. fees, costs). Avoid decorative tables.",
98
+ "End with a prioritized action list \u2014 most urgent first.",
99
+ lengthGuidance
100
+ ];
101
+ }
102
+ var HAVEN_SKILL_JOURNEYS = {
103
+ "housing.lease-review": {
104
+ title: "Lease review",
105
+ description: "Haven reviews a lease for red flags, fee traps, ambiguous clauses, and state-specific tenant protections.",
106
+ steps: [
107
+ "Add your state and paste the lease text or upload the PDF.",
108
+ "Haven highlights risks clause by clause.",
109
+ "Keep chatting to ask about specific sections."
110
+ ],
111
+ acceptsFiles: true,
112
+ fileLabel: "Upload a lease PDF",
113
+ fileHint: "If the lease is scanned or very long, upload the PDF and use the notes field to point Haven to the most important sections.",
114
+ fields: [
115
+ {
116
+ key: "home_type",
117
+ label: "Home type",
118
+ placeholder: "Select your home type",
119
+ helper: "Helps Haven identify red flags specific to your housing type.",
120
+ type: "select",
121
+ required: false,
122
+ options: [
123
+ "Apartment",
124
+ "Condo",
125
+ "Single-family home",
126
+ "Multi-family home",
127
+ "Townhouse",
128
+ "Co-op",
129
+ "Other"
130
+ ]
131
+ },
132
+ {
133
+ key: "state",
134
+ label: "State",
135
+ placeholder: "Select your state",
136
+ helper: "Required for state-specific lease rules.",
137
+ type: "select",
138
+ required: true,
139
+ options: US_STATES
140
+ },
141
+ {
142
+ key: "lease_text",
143
+ label: "Paste lease terms",
144
+ placeholder: "Paste lease text, key clauses, or the sections you want Haven to review first.",
145
+ helper: "Use this instead of upload, or add context for the attached lease.",
146
+ type: "textarea",
147
+ required: false
148
+ }
149
+ ],
150
+ requiresContext: true,
151
+ submitLabel: "Review in Haven chat",
152
+ promptTitle: "Review this lease for red flags, tenant-risk clauses, and hidden fees",
153
+ systemContext: [
154
+ "Parse the lease clause by clause and cross-reference each clause with the state tenant protection laws provided.",
155
+ "",
156
+ "Flag any clauses that are:",
157
+ "- Illegal or unenforceable under state law",
158
+ "- Unusual or heavily favor the landlord",
159
+ "- Missing standard protections required by law",
160
+ "",
161
+ "For each red flag, cite the specific state statute or regulation.",
162
+ "Provide a risk rating: HIGH / MEDIUM / LOW for each issue.",
163
+ "",
164
+ "Organize findings into these sections:",
165
+ "1. Red flags and problematic clauses (with clause number/section references)",
166
+ "2. Financial obligations (rent, deposits, fees, penalties)",
167
+ "3. Maintenance and repair responsibilities",
168
+ "4. Termination and renewal terms",
169
+ "5. Tenant rights that may be missing or limited",
170
+ "",
171
+ "End with an overall risk assessment and recommended actions.",
172
+ "Use web search to verify current state landlord-tenant law statutes when needed.",
173
+ ...outputFormatBlock("Target 1000\u20131500 words. Be precise, not exhaustive.")
174
+ ].join("\n")
175
+ },
176
+ "housing.rent-increase-checker": {
177
+ title: "Rent increase check",
178
+ description: "Haven checks whether a rent increase looks lawful and drafts a negotiation plan with local context.",
179
+ steps: [
180
+ "Enter your city, state, current rent, and proposed rent.",
181
+ "Haven checks the increase and outlines leverage.",
182
+ "Refine the reply in chat."
183
+ ],
184
+ acceptsFiles: false,
185
+ fields: [
186
+ {
187
+ key: "city",
188
+ label: "City",
189
+ placeholder: "San Francisco",
190
+ helper: "Required for local rent rules and market context.",
191
+ type: "text",
192
+ required: true
193
+ },
194
+ {
195
+ key: "state",
196
+ label: "State",
197
+ placeholder: "Select your state",
198
+ helper: "Required.",
199
+ type: "select",
200
+ required: true,
201
+ options: US_STATES
202
+ },
203
+ {
204
+ key: "current_rent",
205
+ label: "Current rent",
206
+ placeholder: "$2,900",
207
+ helper: "Required.",
208
+ type: "text",
209
+ required: true
210
+ },
211
+ {
212
+ key: "proposed_rent",
213
+ label: "Proposed rent",
214
+ placeholder: "$3,250",
215
+ helper: "Required.",
216
+ type: "text",
217
+ required: true
218
+ }
219
+ ],
220
+ requiresContext: false,
221
+ submitLabel: "Check increase in chat",
222
+ promptTitle: "Check whether this rent increase is legal and help me respond",
223
+ systemContext: [
224
+ "Research the city and state rent control laws and local ordinances.",
225
+ "",
226
+ "1. Determine if the increase is within legal limits (if rent control applies)",
227
+ "2. Check if proper notice was given per state law",
228
+ "3. Research comparable market rates in the area",
229
+ "4. Assess whether the increase is legally challengeable",
230
+ "5. If challengeable: draft a response letter citing specific laws",
231
+ "6. If legal but high: provide negotiation talking points and comparable data",
232
+ "",
233
+ "Include specific statute references and deadlines for tenant response.",
234
+ "Provide specific dollar amounts and percentages where relevant.",
235
+ ...outputFormatBlock("Target 600\u20131000 words. Be precise, not exhaustive.")
236
+ ].join("\n")
237
+ },
238
+ "housing.demand-letter": {
239
+ title: "Demand letter draft",
240
+ description: "Haven drafts a professional demand letter with a clear timeline, requested remedy, and a cleaner tone than starting from scratch.",
241
+ steps: [
242
+ "Add the parties, property, state, and issue details.",
243
+ "Haven drafts a structured letter in chat.",
244
+ "Revise tone or legal emphasis with follow-up messages."
245
+ ],
246
+ acceptsFiles: false,
247
+ fields: [
248
+ {
249
+ key: "tenant_name",
250
+ label: "Tenant name",
251
+ placeholder: "Jane Doe",
252
+ helper: "Required.",
253
+ type: "text",
254
+ required: true
255
+ },
256
+ {
257
+ key: "landlord_name",
258
+ label: "Landlord name",
259
+ placeholder: "Property manager or landlord",
260
+ helper: "Required.",
261
+ type: "text",
262
+ required: true
263
+ },
264
+ {
265
+ key: "property_address",
266
+ label: "Property address",
267
+ placeholder: "123 Main St, Austin, TX",
268
+ helper: "Required.",
269
+ type: "text",
270
+ required: true
271
+ },
272
+ {
273
+ key: "landlord_address",
274
+ label: "Landlord/management address",
275
+ placeholder: "Registered business address",
276
+ helper: "The landlord or management company registered address for the demand letter header.",
277
+ type: "text",
278
+ required: false
279
+ },
280
+ {
281
+ key: "state",
282
+ label: "State",
283
+ placeholder: "Select your state",
284
+ helper: "Required.",
285
+ type: "select",
286
+ required: true,
287
+ options: US_STATES
288
+ },
289
+ {
290
+ key: "issue_description",
291
+ label: "What needs to be fixed?",
292
+ placeholder: "Describe the issue, timeline, prior requests, and what remedy you want.",
293
+ helper: "Required.",
294
+ type: "textarea",
295
+ required: true
296
+ }
297
+ ],
298
+ requiresContext: false,
299
+ submitLabel: "Draft letter in chat",
300
+ promptTitle: "Draft a professional demand letter from these details",
301
+ systemContext: [
302
+ "Research the state landlord-tenant law relevant to this issue.",
303
+ "Identify the specific legal violations or obligations.",
304
+ "",
305
+ "Draft a formal demand letter that:",
306
+ "- States the facts clearly and chronologically",
307
+ "- Cites specific state statutes that apply",
308
+ "- Clearly states what is being demanded",
309
+ "- Sets a reasonable deadline for response (per state law requirements)",
310
+ "- Notes potential legal remedies if demands are not met",
311
+ "- Maintains a professional, firm tone",
312
+ "",
313
+ "Include proper formatting: date, addresses, RE line, signature block.",
314
+ "Add a brief legal analysis section explaining the tenant rights involved.",
315
+ "Use web search to verify current state statutes and remedies when needed.",
316
+ ...outputFormatBlock(
317
+ "The letter itself should be 400\u2013600 words. Add a brief legal analysis section (200\u2013300 words) after the letter."
318
+ )
319
+ ].join("\n")
320
+ },
321
+ "housing.hoa-dispute": {
322
+ title: "HOA dispute response",
323
+ description: "Haven reviews an HOA notice and drafts a response strategy that is firm, organized, and easier to send.",
324
+ steps: [
325
+ "Add your state, HOA name, and dispute type.",
326
+ "Paste or upload the HOA notice.",
327
+ "Get a reply draft and follow-up plan in chat."
328
+ ],
329
+ acceptsFiles: true,
330
+ fileLabel: "Upload HOA notice",
331
+ fileHint: "Attach the notice, violation letter, screenshots, or supporting docs.",
332
+ fields: [
333
+ {
334
+ key: "state",
335
+ label: "State",
336
+ placeholder: "Select your state",
337
+ helper: "Required.",
338
+ type: "select",
339
+ required: true,
340
+ options: US_STATES
341
+ },
342
+ {
343
+ key: "hoa_name",
344
+ label: "HOA name",
345
+ placeholder: "Community or association name",
346
+ helper: "Required.",
347
+ type: "text",
348
+ required: true
349
+ },
350
+ {
351
+ key: "issue_type",
352
+ label: "Dispute type",
353
+ placeholder: "Fine appeal, rule violation, maintenance dispute",
354
+ helper: "Required.",
355
+ type: "text",
356
+ required: true
357
+ },
358
+ {
359
+ key: "hoa_notice",
360
+ label: "Paste the HOA notice or your notes",
361
+ placeholder: "Paste the notice text or summarize the dispute.",
362
+ helper: "If the full notice is uploaded, add any extra context Haven should know.",
363
+ type: "textarea",
364
+ required: false
365
+ }
366
+ ],
367
+ requiresContext: true,
368
+ submitLabel: "Draft response in chat",
369
+ promptTitle: "Review this HOA issue and draft a formal response",
370
+ systemContext: [
371
+ "Analyze the HOA's notice or violation for procedural correctness.",
372
+ "Research the state HOA law (e.g., Common Interest Development Act, HOA Bill of Rights).",
373
+ "",
374
+ "Cross-reference the HOA's action with:",
375
+ "- State HOA statutes",
376
+ "- The CC&Rs provisions cited",
377
+ "- Required procedures for notices, hearings, and fines",
378
+ "",
379
+ "Identify any procedural failures or overreach by the HOA.",
380
+ "",
381
+ "Draft a formal response that:",
382
+ "- Addresses each point in the HOA notice",
383
+ "- Cites specific state law protections",
384
+ "- References relevant CC&R provisions",
385
+ "- Requests specific remedies (hearing, reversal, mediation)",
386
+ "- Notes the homeowner's rights under state law",
387
+ "",
388
+ "Include escalation path: internal appeal, mediation, small claims, civil court.",
389
+ "Use web search to verify current state HOA statutes when needed.",
390
+ ...outputFormatBlock("Target 800\u20131200 words. Be precise, not exhaustive.")
391
+ ].join("\n")
392
+ }
393
+ };
394
+
395
+ // src/skills/shared.ts
396
+ var HOUSING_REQUIRED_TOOLS = [
397
+ "JinaMCP-search_web",
398
+ "JinaMCP-parallel_search_web",
399
+ "AnumaSearchMCP-anuma_text_search"
400
+ ];
401
+ var HOUSING_PREFERRED_MODEL = "anthropic/claude-sonnet-4-6";
402
+ var HOUSING_MEMORY_SUFFIX = `## Memory & Context
403
+ If prior housing context is provided below (e.g., prior lease issues, rent increases, landlord disputes, HOA actions, property details), reference it to make the analysis more personalized and avoid asking for details the user already shared. Call out meaningful changes from prior housing records.
404
+
405
+ At the end of your response, include a "Key Facts to Remember" section listing 2-5 short facts worth tracking for this user (e.g., "Lives at 123 Main St in Austin under a month-to-month lease" or "HOA dispute with Willow Creek HOA about a fence violation notice"). These will be saved to the user's private memory vault for future sessions.
406
+
407
+ {{memory_context}}`;
408
+
409
+ // src/skills/demand-letter.ts
410
+ var demandLetter = {
411
+ id: "housing.demand-letter",
412
+ name: "Demand Letter Generator",
413
+ promptTemplate: `You are a tenant rights attorney drafting a formal demand letter.
414
+
415
+ ## Task
416
+ Draft a demand letter for a housing issue.
417
+
418
+ ## Instructions
419
+ 1. Research {{state}} landlord-tenant law relevant to this issue
420
+ 2. Identify the specific legal violations or obligations
421
+ 3. Draft a formal demand letter that:
422
+ - States the facts clearly and chronologically
423
+ - Cites specific {{state}} statutes that apply
424
+ - Clearly states what is being demanded
425
+ - Sets a reasonable deadline for response (per state law requirements)
426
+ - Notes potential legal remedies if demands are not met
427
+ - Maintains a professional, firm tone
428
+ 4. Include proper formatting: date, addresses, RE line, signature block
429
+ 5. Add a brief legal analysis section explaining the tenant's rights
430
+
431
+ Use web search to verify current {{state}} statutes and remedies.`,
432
+ userTemplate: `Please draft a demand letter for the following housing issue:
433
+
434
+ - Tenant name: {{tenant_name}}
435
+ - Landlord/management: {{landlord_name}}
436
+ - Property address: {{property_address}}
437
+ - State: {{state}}
438
+ - Issue: {{issue_description}}
439
+ - Desired resolution: {{desired_resolution}}
440
+ - Prior communication: {{prior_communication}}`,
441
+ requiredTools: HOUSING_REQUIRED_TOOLS,
442
+ preferredModel: HOUSING_PREFERRED_MODEL,
443
+ maxSteps: 12,
444
+ requiredVariables: [
445
+ "tenant_name",
446
+ "landlord_name",
447
+ "property_address",
448
+ "state",
449
+ "issue_description"
450
+ ],
451
+ contextSuffix: HOUSING_MEMORY_SUFFIX
452
+ };
453
+
454
+ // src/skills/hoa-dispute.ts
455
+ var hoaDispute = {
456
+ id: "housing.hoa-dispute",
457
+ name: "HOA Dispute Response",
458
+ promptTemplate: `You are an HOA dispute specialist helping a homeowner respond to an HOA action.
459
+
460
+ ## Task
461
+ Analyze an HOA dispute and draft a formal response.
462
+
463
+ ## Instructions
464
+ 1. Analyze the HOA's notice/violation for procedural correctness
465
+ 2. Research {{state}} HOA law (e.g., Common Interest Development Act, HOA Bill of Rights)
466
+ 3. Cross-reference the HOA's action with:
467
+ - State HOA statutes
468
+ - The CC&Rs provisions cited
469
+ - Required procedures for notices, hearings, and fines
470
+ 4. Identify any procedural failures or overreach by the HOA
471
+ 5. Draft a formal response that:
472
+ - Addresses each point in the HOA notice
473
+ - Cites specific state law protections
474
+ - References relevant CC&R provisions
475
+ - Requests specific remedies (hearing, reversal, mediation)
476
+ - Notes the homeowner's rights under state law
477
+ 6. Include escalation path: internal appeal \u2192 mediation \u2192 small claims \u2192 civil court
478
+
479
+ Use web search to verify current {{state}} HOA statutes and case law.`,
480
+ userTemplate: `Please help me respond to this HOA dispute:
481
+
482
+ - State: {{state}}
483
+ - HOA name: {{hoa_name}}
484
+ - Issue type: {{issue_type}}
485
+ - HOA notice/violation: {{hoa_notice}}
486
+ - Homeowner's position: {{homeowner_position}}
487
+ - CC&Rs relevant sections: {{ccr_text}}`,
488
+ requiredTools: HOUSING_REQUIRED_TOOLS,
489
+ preferredModel: HOUSING_PREFERRED_MODEL,
490
+ maxSteps: 15,
491
+ requiredVariables: ["state", "hoa_name", "issue_type"],
492
+ contextSuffix: HOUSING_MEMORY_SUFFIX
493
+ };
494
+
495
+ // src/skills/lease-review.ts
496
+ var leaseReview = {
497
+ id: "housing.lease-review",
498
+ name: "Lease Review & Red Flag Detection",
499
+ promptTemplate: `You are a housing rights specialist reviewing a lease agreement.
500
+
501
+ ## Task
502
+ Analyze a lease document and identify red flags, illegal clauses, and concerning provisions under {{state}} law.
503
+
504
+ ## Instructions
505
+ 1. Parse the lease clause by clause
506
+ 2. Cross-reference each clause with {{state}} tenant protection laws
507
+ 3. Flag any clauses that are:
508
+ - Illegal or unenforceable under state law
509
+ - Unusual or heavily favor the landlord
510
+ - Missing standard protections required by law
511
+ 4. For each red flag, cite the specific state statute or regulation
512
+ 5. Provide a risk rating: HIGH / MEDIUM / LOW for each issue
513
+ 6. Summarize with an overall assessment and recommended actions
514
+
515
+ Use web search to verify current {{state}} landlord-tenant law statutes. Be specific with legal citations.`,
516
+ userTemplate: `Please review my lease under {{state}} law.
517
+
518
+ ## Lease Text
519
+ {{lease_text}}`,
520
+ requiredTools: HOUSING_REQUIRED_TOOLS,
521
+ preferredModel: HOUSING_PREFERRED_MODEL,
522
+ maxSteps: 15,
523
+ requiredVariables: ["state"],
524
+ contextSuffix: HOUSING_MEMORY_SUFFIX
525
+ };
526
+
527
+ // src/skills/rent-increase-checker.ts
528
+ var rentIncreaseChecker = {
529
+ id: "housing.rent-increase-checker",
530
+ name: "Rent Increase Checker & Negotiation",
531
+ promptTemplate: `You are a tenant rights advisor specializing in rent increase analysis.
532
+
533
+ ## Task
534
+ Analyze a rent increase for legality and provide negotiation strategy.
535
+
536
+ ## Instructions
537
+ 1. Research {{city}}, {{state}} rent control laws and local ordinances
538
+ 2. Determine if the increase is within legal limits (if rent control applies)
539
+ 3. Check if proper notice was given per state law
540
+ 4. Research comparable market rates in the area
541
+ 5. Assess whether the increase is legally challengeable
542
+ 6. If challengeable: draft a response letter citing specific laws
543
+ 7. If legal but high: provide negotiation talking points and comparable data
544
+ 8. Include specific statute references and deadlines for tenant response
545
+
546
+ Cite specific statute references and deadlines for tenant response.`,
547
+ userTemplate: `Please analyze this rent increase:
548
+
549
+ - Location: {{city}}, {{state}}
550
+ - Current rent: {{current_rent}}
551
+ - Proposed new rent: {{proposed_rent}}
552
+ - Lease type: {{lease_type}}
553
+ - Notice received: {{notice_date}}`,
554
+ preferredModel: HOUSING_PREFERRED_MODEL,
555
+ maxSteps: 1,
556
+ requiredVariables: ["city", "state", "current_rent", "proposed_rent"],
557
+ contextSuffix: HOUSING_MEMORY_SUFFIX
558
+ };
559
+
560
+ // src/skills/index.ts
561
+ var HAVEN_SKILLS = [
562
+ leaseReview,
563
+ demandLetter,
564
+ rentIncreaseChecker,
565
+ hoaDispute
566
+ ];
567
+
568
+ // src/index.ts
569
+ var havenAgent = {
570
+ id: "haven",
571
+ runtimes: ["server"],
572
+ prompt: HAVEN_PROMPT,
573
+ skills: HAVEN_SKILLS,
574
+ tools: [],
575
+ model: {
576
+ default: "anthropic/claude-sonnet-4-6",
577
+ allowed: ["anthropic/claude-sonnet-4-6"]
578
+ },
579
+ skillJourneys: HAVEN_SKILL_JOURNEYS,
580
+ manifest: {
581
+ id: "haven",
582
+ name: "Haven",
583
+ description: "AI-powered housing and tenant rights advisor",
584
+ runtimes: ["server"],
585
+ skills: HAVEN_SKILLS.map(({ id, name, requiredVariables }) => ({
586
+ id,
587
+ name,
588
+ requiredVariables
589
+ }))
590
+ }
591
+ };
592
+ export {
593
+ HAVEN_PROMPT,
594
+ HAVEN_SKILLS,
595
+ HAVEN_SKILL_JOURNEYS,
596
+ demandLetter,
597
+ havenAgent,
598
+ hoaDispute,
599
+ leaseReview,
600
+ rentIncreaseChecker
601
+ };
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@anuma/agent-haven",
3
+ "version": "1.0.0-next.20260513211157",
4
+ "description": "Haven housing agent for Anuma SDK",
5
+ "main": "./dist/index.cjs",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.cjs",
13
+ "default": "./dist/index.cjs"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/anuma-ai/sdk.git",
22
+ "directory": "packages/agents/haven"
23
+ },
24
+ "license": "ISC",
25
+ "bugs": {
26
+ "url": "https://github.com/anuma-ai/sdk/issues"
27
+ },
28
+ "homepage": "https://github.com/anuma-ai/sdk#readme",
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "dependencies": {
33
+ "@anuma/sdk": "1.0.0-next.20260513211157"
34
+ },
35
+ "devDependencies": {
36
+ "tsup": "^8.5.1",
37
+ "typescript": "^5.9.3",
38
+ "vitest": "^4.0.14"
39
+ },
40
+ "scripts": {
41
+ "build": "tsup",
42
+ "test": "vitest run"
43
+ }
44
+ }