@huddle-marketplace/skills 0.2.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/README.md +256 -0
- package/dist/adapters/openclaw.d.ts +42 -0
- package/dist/adapters/openclaw.d.ts.map +1 -0
- package/dist/adapters/openclaw.js +94 -0
- package/dist/adapters/openclaw.js.map +1 -0
- package/dist/base.d.ts +26 -0
- package/dist/base.d.ts.map +1 -0
- package/dist/base.js +97 -0
- package/dist/base.js.map +1 -0
- package/dist/compose.d.ts +87 -0
- package/dist/compose.d.ts.map +1 -0
- package/dist/compose.js +119 -0
- package/dist/compose.js.map +1 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +167 -0
- package/dist/index.js.map +1 -0
- package/dist/jurisdictions/ca-bc/index.d.ts +49 -0
- package/dist/jurisdictions/ca-bc/index.d.ts.map +1 -0
- package/dist/jurisdictions/ca-bc/index.js +212 -0
- package/dist/jurisdictions/ca-bc/index.js.map +1 -0
- package/dist/jurisdictions/ca-ns/index.d.ts +27 -0
- package/dist/jurisdictions/ca-ns/index.d.ts.map +1 -0
- package/dist/jurisdictions/ca-ns/index.js +127 -0
- package/dist/jurisdictions/ca-ns/index.js.map +1 -0
- package/dist/jurisdictions/ca-on/index.d.ts +26 -0
- package/dist/jurisdictions/ca-on/index.d.ts.map +1 -0
- package/dist/jurisdictions/ca-on/index.js +109 -0
- package/dist/jurisdictions/ca-on/index.js.map +1 -0
- package/dist/jurisdictions/ca-qc/index.d.ts +75 -0
- package/dist/jurisdictions/ca-qc/index.d.ts.map +1 -0
- package/dist/jurisdictions/ca-qc/index.js +232 -0
- package/dist/jurisdictions/ca-qc/index.js.map +1 -0
- package/dist/jurisdictions/canadian-template.d.ts +49 -0
- package/dist/jurisdictions/canadian-template.d.ts.map +1 -0
- package/dist/jurisdictions/canadian-template.js +228 -0
- package/dist/jurisdictions/canadian-template.js.map +1 -0
- package/dist/jurisdictions/lifecycle/active-tenancy.d.ts +55 -0
- package/dist/jurisdictions/lifecycle/active-tenancy.d.ts.map +1 -0
- package/dist/jurisdictions/lifecycle/active-tenancy.js +227 -0
- package/dist/jurisdictions/lifecycle/active-tenancy.js.map +1 -0
- package/dist/jurisdictions/lifecycle/homeownership-readiness.d.ts +60 -0
- package/dist/jurisdictions/lifecycle/homeownership-readiness.d.ts.map +1 -0
- package/dist/jurisdictions/lifecycle/homeownership-readiness.js +401 -0
- package/dist/jurisdictions/lifecycle/homeownership-readiness.js.map +1 -0
- package/dist/jurisdictions/us-ca/index.d.ts +65 -0
- package/dist/jurisdictions/us-ca/index.d.ts.map +1 -0
- package/dist/jurisdictions/us-ca/index.js +265 -0
- package/dist/jurisdictions/us-ca/index.js.map +1 -0
- package/dist/jurisdictions/us-cftc/index.d.ts +48 -0
- package/dist/jurisdictions/us-cftc/index.d.ts.map +1 -0
- package/dist/jurisdictions/us-cftc/index.js +192 -0
- package/dist/jurisdictions/us-cftc/index.js.map +1 -0
- package/dist/jurisdictions/us-fl/index.d.ts +43 -0
- package/dist/jurisdictions/us-fl/index.d.ts.map +1 -0
- package/dist/jurisdictions/us-fl/index.js +129 -0
- package/dist/jurisdictions/us-fl/index.js.map +1 -0
- package/dist/jurisdictions/us-ny/index.d.ts +77 -0
- package/dist/jurisdictions/us-ny/index.d.ts.map +1 -0
- package/dist/jurisdictions/us-ny/index.js +344 -0
- package/dist/jurisdictions/us-ny/index.js.map +1 -0
- package/dist/jurisdictions/us-state-factory.d.ts +79 -0
- package/dist/jurisdictions/us-state-factory.d.ts.map +1 -0
- package/dist/jurisdictions/us-state-factory.js +425 -0
- package/dist/jurisdictions/us-state-factory.js.map +1 -0
- package/dist/jurisdictions/us-tx/index.d.ts +43 -0
- package/dist/jurisdictions/us-tx/index.d.ts.map +1 -0
- package/dist/jurisdictions/us-tx/index.js +160 -0
- package/dist/jurisdictions/us-tx/index.js.map +1 -0
- package/dist/mcp/index.d.ts +49 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +211 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/registry/index.d.ts +27 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +47 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/traiga/index.d.ts +24 -0
- package/dist/traiga/index.d.ts.map +1 -0
- package/dist/traiga/index.js +67 -0
- package/dist/traiga/index.js.map +1 -0
- package/dist/types/index.d.ts +814 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +150 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CA-BC — British Columbia Residential Tenancy Act
|
|
3
|
+
*
|
|
4
|
+
* BC has stringent tenant protection laws:
|
|
5
|
+
* - Security deposits limited to 50% of monthly rent (RTA s.19(1))
|
|
6
|
+
* - Mutual written consent required for deposit investment (RTA s.19)
|
|
7
|
+
* - 100% principal protection required at all times (RTA s.20)
|
|
8
|
+
* - Tenants entitled to interest on deposits (RTA s.19(3))
|
|
9
|
+
* - RTB (Residential Tenancy Branch) compliance required
|
|
10
|
+
* - Dispute resolution must be available
|
|
11
|
+
*/
|
|
12
|
+
import { BaseSkill } from "../../base.js";
|
|
13
|
+
export class CABCSkill extends BaseSkill {
|
|
14
|
+
id = "huddle-compliance-ca-bc";
|
|
15
|
+
name = "British Columbia Residential Tenancy Act";
|
|
16
|
+
jurisdiction = "CA-BC";
|
|
17
|
+
version = "1.0.0";
|
|
18
|
+
capabilities = [
|
|
19
|
+
"deposit-validation",
|
|
20
|
+
"deposit-interest",
|
|
21
|
+
"deposit-return",
|
|
22
|
+
];
|
|
23
|
+
async validate(input) {
|
|
24
|
+
if (input.type !== "deposit-validation") {
|
|
25
|
+
return this.buildResult([{
|
|
26
|
+
name: "input-type",
|
|
27
|
+
passed: false,
|
|
28
|
+
confidence: 1.0,
|
|
29
|
+
note: `BC skill currently supports deposit-validation, received: ${input.type}`,
|
|
30
|
+
}], input);
|
|
31
|
+
}
|
|
32
|
+
const deposit = input;
|
|
33
|
+
const checks = [
|
|
34
|
+
this.checkMutualAssent(deposit),
|
|
35
|
+
this.checkPrincipalProtection(deposit),
|
|
36
|
+
this.checkDepositLimit(deposit),
|
|
37
|
+
this.checkInterestSharing(deposit),
|
|
38
|
+
this.checkRTBCompliance(deposit),
|
|
39
|
+
];
|
|
40
|
+
return this.buildResult(checks, input);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* BC RTA Section 19: Mutual Assent Requirement
|
|
44
|
+
* Both landlord and tenant must explicitly consent to deposit investment
|
|
45
|
+
*/
|
|
46
|
+
checkMutualAssent(input) {
|
|
47
|
+
const landlordConsent = input.landlordConsentSignature !== undefined;
|
|
48
|
+
const tenantConsent = input.tenantConsentSignature !== undefined;
|
|
49
|
+
const mutualAssentTimestamp = input.mutualAssentTimestamp;
|
|
50
|
+
const consentIsRecent = mutualAssentTimestamp
|
|
51
|
+
? (Date.now() - mutualAssentTimestamp) < 31536000000 // 1 year
|
|
52
|
+
: false;
|
|
53
|
+
const passed = landlordConsent && tenantConsent && consentIsRecent;
|
|
54
|
+
return {
|
|
55
|
+
name: "mutual-assent",
|
|
56
|
+
passed,
|
|
57
|
+
confidence: 1.0,
|
|
58
|
+
note: passed
|
|
59
|
+
? "Both landlord and tenant have provided recent written consent for deposit investment"
|
|
60
|
+
: "Mutual written consent from both parties required for wBTC bond investment",
|
|
61
|
+
citation: {
|
|
62
|
+
statute: "BC Residential Tenancy Act",
|
|
63
|
+
section: "Section 19",
|
|
64
|
+
summary: "Both landlord and tenant must provide explicit written consent for any deposit investment or alternative holding arrangement",
|
|
65
|
+
url: "https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/02078_01",
|
|
66
|
+
},
|
|
67
|
+
details: {
|
|
68
|
+
landlordConsent,
|
|
69
|
+
tenantConsent,
|
|
70
|
+
consentIsRecent,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* BC RTA Section 20: Principal Protection Guarantee
|
|
76
|
+
* Full deposit value must be available for return at all times
|
|
77
|
+
*/
|
|
78
|
+
checkPrincipalProtection(input) {
|
|
79
|
+
const currentValue = input.collateralValueCents ?? 0;
|
|
80
|
+
const originalDeposit = input.originalDepositValueCents ?? 0;
|
|
81
|
+
const protectionRatio = originalDeposit > 0 ? currentValue / originalDeposit : 1;
|
|
82
|
+
const passed = protectionRatio >= 1.0;
|
|
83
|
+
return {
|
|
84
|
+
name: "principal-protection",
|
|
85
|
+
passed,
|
|
86
|
+
confidence: 1.0,
|
|
87
|
+
note: passed
|
|
88
|
+
? `Principal fully protected (${(protectionRatio * 100).toFixed(0)}% of original deposit)`
|
|
89
|
+
: `Principal protection ratio ${(protectionRatio * 100).toFixed(0)}% is below 100% requirement`,
|
|
90
|
+
citation: {
|
|
91
|
+
statute: "BC Residential Tenancy Act",
|
|
92
|
+
section: "Section 20",
|
|
93
|
+
summary: "100% principal protection required — current value must equal or exceed original deposit",
|
|
94
|
+
},
|
|
95
|
+
details: {
|
|
96
|
+
currentValueCents: currentValue,
|
|
97
|
+
originalDepositCents: originalDeposit,
|
|
98
|
+
protectionRatio,
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* BC RTA Section 19(1): Deposit Limit
|
|
104
|
+
* Security deposit cannot exceed 50% of monthly rent
|
|
105
|
+
*/
|
|
106
|
+
checkDepositLimit(input) {
|
|
107
|
+
const depositAmount = input.depositAmountCents;
|
|
108
|
+
const monthlyRent = input.monthlyRentCents;
|
|
109
|
+
const maxAllowed = Math.floor(monthlyRent * 0.5);
|
|
110
|
+
const withinLimit = depositAmount <= maxAllowed;
|
|
111
|
+
return {
|
|
112
|
+
name: "deposit-limit",
|
|
113
|
+
passed: withinLimit,
|
|
114
|
+
confidence: 1.0,
|
|
115
|
+
note: withinLimit
|
|
116
|
+
? `Deposit ($${(depositAmount / 100).toFixed(2)}) is within 50% of monthly rent limit ($${(maxAllowed / 100).toFixed(2)})`
|
|
117
|
+
: `Deposit ($${(depositAmount / 100).toFixed(2)}) exceeds 50% of monthly rent ($${(maxAllowed / 100).toFixed(2)})`,
|
|
118
|
+
citation: {
|
|
119
|
+
statute: "BC Residential Tenancy Act",
|
|
120
|
+
section: "Section 19(1)",
|
|
121
|
+
summary: "Security deposit must not exceed one half of the monthly rent",
|
|
122
|
+
url: "https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/02078_01",
|
|
123
|
+
},
|
|
124
|
+
details: {
|
|
125
|
+
depositAmountCents: depositAmount,
|
|
126
|
+
monthlyRentCents: monthlyRent,
|
|
127
|
+
maxAllowedCents: maxAllowed,
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* BC RTA Section 19(3): Interest Sharing
|
|
133
|
+
* Tenants are entitled to interest earned on deposits
|
|
134
|
+
*/
|
|
135
|
+
checkInterestSharing(input) {
|
|
136
|
+
const hasYieldSplit = input.yieldShareActive === true;
|
|
137
|
+
const tenantShare = input.tenantYieldPercentage ?? 0;
|
|
138
|
+
const fairShare = tenantShare >= 85;
|
|
139
|
+
const passed = hasYieldSplit && fairShare;
|
|
140
|
+
return {
|
|
141
|
+
name: "interest-sharing",
|
|
142
|
+
passed,
|
|
143
|
+
confidence: 1.0,
|
|
144
|
+
note: passed
|
|
145
|
+
? `Yield split active with ${tenantShare}% tenant share (minimum 85% required)`
|
|
146
|
+
: hasYieldSplit
|
|
147
|
+
? `Tenant yield share ${tenantShare}% is below the 85% minimum`
|
|
148
|
+
: "Yield-bearing deposit must have active yield split with tenant receiving at least 85%",
|
|
149
|
+
citation: {
|
|
150
|
+
statute: "BC Residential Tenancy Act",
|
|
151
|
+
section: "Section 19(3)",
|
|
152
|
+
summary: "Tenant entitled to interest/yield on security deposit — minimum 85% tenant share",
|
|
153
|
+
},
|
|
154
|
+
details: {
|
|
155
|
+
yieldShareActive: hasYieldSplit,
|
|
156
|
+
tenantYieldPercentage: tenantShare,
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* BC RTB Compliance
|
|
162
|
+
* Agreement must comply with RTB standards and provide dispute resolution
|
|
163
|
+
*/
|
|
164
|
+
checkRTBCompliance(input) {
|
|
165
|
+
const hasRTBAgreement = input.rtbCompliantAgreement === true;
|
|
166
|
+
const disputeResolution = input.disputeResolutionEnabled === true;
|
|
167
|
+
const passed = hasRTBAgreement && disputeResolution;
|
|
168
|
+
return {
|
|
169
|
+
name: "rtb-compliance",
|
|
170
|
+
passed,
|
|
171
|
+
confidence: 0.9,
|
|
172
|
+
note: passed
|
|
173
|
+
? "RTB-compliant agreement with dispute resolution available"
|
|
174
|
+
: "Agreement must comply with RTB standards and provide dispute resolution pathway",
|
|
175
|
+
citation: {
|
|
176
|
+
statute: "BC Residential Tenancy Act",
|
|
177
|
+
section: "Part 5 — Dispute Resolution",
|
|
178
|
+
summary: "All tenancy agreements must be RTB-compliant with access to dispute resolution",
|
|
179
|
+
url: "https://www2.gov.bc.ca/gov/content/housing-tenancy/residential-tenancies",
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
checkToRemediation(check) {
|
|
184
|
+
switch (check.name) {
|
|
185
|
+
case "deposit-limit":
|
|
186
|
+
return {
|
|
187
|
+
action: "reduce_deposit",
|
|
188
|
+
description: "Reduce deposit to 50% of monthly rent or less per BC RTA s.19(1)",
|
|
189
|
+
urgency: "required",
|
|
190
|
+
automatable: true,
|
|
191
|
+
};
|
|
192
|
+
case "mutual-assent":
|
|
193
|
+
return {
|
|
194
|
+
action: "obtain_consent",
|
|
195
|
+
description: "Obtain written consent from both landlord and tenant before proceeding with deposit investment",
|
|
196
|
+
urgency: "required",
|
|
197
|
+
automatable: false,
|
|
198
|
+
};
|
|
199
|
+
case "interest-sharing":
|
|
200
|
+
return {
|
|
201
|
+
action: "adjust_yield_split",
|
|
202
|
+
description: "Ensure tenant receives at least 85% of yield on deposit per BC RTA s.19(3)",
|
|
203
|
+
urgency: "required",
|
|
204
|
+
automatable: true,
|
|
205
|
+
};
|
|
206
|
+
default:
|
|
207
|
+
return super.checkToRemediation(check);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
export const caBcSkill = new CABCSkill();
|
|
212
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/jurisdictions/ca-bc/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAU1C,MAAM,OAAO,SAAU,SAAQ,SAAS;IAC7B,EAAE,GAAG,yBAAyB,CAAC;IAC/B,IAAI,GAAG,0CAA0C,CAAC;IAClD,YAAY,GAAG,OAAgB,CAAC;IAChC,OAAO,GAAG,OAAO,CAAC;IAClB,YAAY,GAAsB;QACzC,oBAAoB;QACpB,kBAAkB;QAClB,gBAAgB;KACjB,CAAC;IAEF,KAAK,CAAC,QAAQ,CAAC,KAAiB;QAC9B,IAAI,KAAK,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;oBACvB,IAAI,EAAE,YAAY;oBAClB,MAAM,EAAE,KAAK;oBACb,UAAU,EAAE,GAAG;oBACf,IAAI,EAAE,6DAA6D,KAAK,CAAC,IAAI,EAAE;iBAChF,CAAC,EAAE,KAAK,CAAC,CAAC;QACb,CAAC;QAED,MAAM,OAAO,GAAG,KAA+B,CAAC;QAChD,MAAM,MAAM,GAAiB;YAC3B,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;YAC/B,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC;YACtC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;YAC/B,IAAI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AAI,EAAE,gBAAgB;YACtB,MAAM;YACN,UAAU,EAAE,GAAG;YACf,IAAI,EAAE,MAAM;gBACV,CAAC,CAAC,2DAA2D;gBAC7D,CAAC,CAAC,iFAAiF;YACrF,QAAQ,EAAE;gBACR,OAAO,EAAE,4BAA4B;gBACrC,OAAO,EAAE,6BAA6B;gBACtC,OAAO,EAAE,gFAAgF;gBACzF,GAAG,EAAE,0EAA0E;aAChF;SACF,CAAC;IACJ,CAAC;IAEkB,kBAAkB,CAAC,KAAiB;QACrD,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;YACnB,KAAK,eAAe;gBAClB,OAAO;oBACL,MAAM,EAAE,gBAAgB;oBACxB,WAAW,EAAE,kEAAkE;oBAC/E,OAAO,EAAE,UAAU;oBACnB,WAAW,EAAE,IAAI;iBAClB,CAAC;YACJ,KAAK,eAAe;gBAClB,OAAO;oBACL,MAAM,EAAE,gBAAgB;oBACxB,WAAW,EAAE,gGAAgG;oBAC7G,OAAO,EAAE,UAAU;oBACnB,WAAW,EAAE,KAAK;iBACnB,CAAC;YACJ,KAAK,kBAAkB;gBACrB,OAAO;oBACL,MAAM,EAAE,oBAAoB;oBAC5B,WAAW,EAAE,4EAA4E;oBACzF,OAAO,EAAE,UAAU;oBACnB,WAAW,EAAE,IAAI;iBAClB,CAAC;YACJ;gBACE,OAAO,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CA-NS — Nova Scotia Residential Tenancies Act
|
|
3
|
+
*
|
|
4
|
+
* NS has comprehensive tenant protection:
|
|
5
|
+
* - Security deposits capped at 50% of monthly rent
|
|
6
|
+
* - Mutual written consent required for deposit investment
|
|
7
|
+
* - 100% principal protection
|
|
8
|
+
* - Minimum 2% annual interest to tenant
|
|
9
|
+
* - Landlord must be registered with Service NS
|
|
10
|
+
*/
|
|
11
|
+
import { BaseSkill } from "../../base.js";
|
|
12
|
+
import type { SkillInput, SkillResult, SkillCheck, SkillCapability, RemediationStep } from "../../types/index.js";
|
|
13
|
+
export declare class CANSSkill extends BaseSkill {
|
|
14
|
+
readonly id = "huddle-compliance-ca-ns";
|
|
15
|
+
readonly name = "Nova Scotia Residential Tenancies Act";
|
|
16
|
+
readonly jurisdiction: "CA-NS";
|
|
17
|
+
readonly version = "1.0.0";
|
|
18
|
+
readonly capabilities: SkillCapability[];
|
|
19
|
+
validate(input: SkillInput): Promise<SkillResult>;
|
|
20
|
+
private checkMutualAssent;
|
|
21
|
+
private checkPrincipalProtection;
|
|
22
|
+
private checkDepositLimit;
|
|
23
|
+
private checkInterestPayment;
|
|
24
|
+
protected checkToRemediation(check: SkillCheck): RemediationStep;
|
|
25
|
+
}
|
|
26
|
+
export declare const caNsSkill: CANSSkill;
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jurisdictions/ca-ns/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EAEf,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,SAAU,SAAQ,SAAS;IACtC,QAAQ,CAAC,EAAE,6BAA6B;IACxC,QAAQ,CAAC,IAAI,2CAA2C;IACxD,QAAQ,CAAC,YAAY,EAAG,OAAO,CAAU;IACzC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,YAAY,EAAE,eAAe,EAAE,CAGtC;IAEI,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;IAqBvD,OAAO,CAAC,iBAAiB;IAqBzB,OAAO,CAAC,wBAAwB;IAqBhC,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,oBAAoB;cAmBT,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe;CAW1E;AAED,eAAO,MAAM,SAAS,WAAkB,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CA-NS — Nova Scotia Residential Tenancies Act
|
|
3
|
+
*
|
|
4
|
+
* NS has comprehensive tenant protection:
|
|
5
|
+
* - Security deposits capped at 50% of monthly rent
|
|
6
|
+
* - Mutual written consent required for deposit investment
|
|
7
|
+
* - 100% principal protection
|
|
8
|
+
* - Minimum 2% annual interest to tenant
|
|
9
|
+
* - Landlord must be registered with Service NS
|
|
10
|
+
*/
|
|
11
|
+
import { BaseSkill } from "../../base.js";
|
|
12
|
+
export class CANSSkill extends BaseSkill {
|
|
13
|
+
id = "huddle-compliance-ca-ns";
|
|
14
|
+
name = "Nova Scotia Residential Tenancies Act";
|
|
15
|
+
jurisdiction = "CA-NS";
|
|
16
|
+
version = "1.0.0";
|
|
17
|
+
capabilities = [
|
|
18
|
+
"deposit-validation",
|
|
19
|
+
"deposit-interest",
|
|
20
|
+
];
|
|
21
|
+
async validate(input) {
|
|
22
|
+
if (input.type !== "deposit-validation") {
|
|
23
|
+
return this.buildResult([{
|
|
24
|
+
name: "input-type",
|
|
25
|
+
passed: false,
|
|
26
|
+
confidence: 1.0,
|
|
27
|
+
note: `NS skill currently supports deposit-validation, received: ${input.type}`,
|
|
28
|
+
}], input);
|
|
29
|
+
}
|
|
30
|
+
const deposit = input;
|
|
31
|
+
const checks = [
|
|
32
|
+
this.checkMutualAssent(deposit),
|
|
33
|
+
this.checkPrincipalProtection(deposit),
|
|
34
|
+
this.checkDepositLimit(deposit),
|
|
35
|
+
this.checkInterestPayment(deposit),
|
|
36
|
+
];
|
|
37
|
+
return this.buildResult(checks, input);
|
|
38
|
+
}
|
|
39
|
+
checkMutualAssent(input) {
|
|
40
|
+
const landlordConsent = input.landlordConsentSignature !== undefined;
|
|
41
|
+
const tenantConsent = input.tenantConsentSignature !== undefined;
|
|
42
|
+
const passed = landlordConsent && tenantConsent;
|
|
43
|
+
return {
|
|
44
|
+
name: "mutual-assent",
|
|
45
|
+
passed,
|
|
46
|
+
confidence: 1.0,
|
|
47
|
+
note: passed
|
|
48
|
+
? "Written mutual consent from both parties confirmed"
|
|
49
|
+
: "NS RTA requires written consent from both landlord and tenant for deposit investment",
|
|
50
|
+
citation: {
|
|
51
|
+
statute: "Nova Scotia Residential Tenancies Act",
|
|
52
|
+
section: "Section 10",
|
|
53
|
+
summary: "Written mutual consent required for deposit investment arrangement",
|
|
54
|
+
url: "https://www.novascotia.ca/sns/access/land/residential-tenancies.asp",
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
checkPrincipalProtection(input) {
|
|
59
|
+
const currentValue = input.collateralValueCents ?? 0;
|
|
60
|
+
const originalDeposit = input.originalDepositValueCents ?? 0;
|
|
61
|
+
const protectionRatio = originalDeposit > 0 ? currentValue / originalDeposit : 1;
|
|
62
|
+
const passed = protectionRatio >= 1.0;
|
|
63
|
+
return {
|
|
64
|
+
name: "principal-protection",
|
|
65
|
+
passed,
|
|
66
|
+
confidence: 1.0,
|
|
67
|
+
note: passed
|
|
68
|
+
? `Principal protected at ${(protectionRatio * 100).toFixed(0)}%`
|
|
69
|
+
: "Deposit must be fully recoverable at end of tenancy",
|
|
70
|
+
citation: {
|
|
71
|
+
statute: "Nova Scotia Residential Tenancies Act",
|
|
72
|
+
section: "Section 11",
|
|
73
|
+
summary: "100% principal protection — deposit must be fully recoverable",
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
checkDepositLimit(input) {
|
|
78
|
+
const depositAmount = input.depositAmountCents;
|
|
79
|
+
const monthlyRent = input.monthlyRentCents;
|
|
80
|
+
const maxAllowed = Math.floor(monthlyRent * 0.5);
|
|
81
|
+
const withinLimit = depositAmount <= maxAllowed;
|
|
82
|
+
return {
|
|
83
|
+
name: "deposit-limit",
|
|
84
|
+
passed: withinLimit,
|
|
85
|
+
confidence: 1.0,
|
|
86
|
+
note: withinLimit
|
|
87
|
+
? `Deposit within 50% of monthly rent limit`
|
|
88
|
+
: `Deposit exceeds 50% of monthly rent ($${(maxAllowed / 100).toFixed(2)} max)`,
|
|
89
|
+
citation: {
|
|
90
|
+
statute: "Nova Scotia Residential Tenancies Act",
|
|
91
|
+
section: "Section 10(2)",
|
|
92
|
+
summary: "Security deposit cannot exceed 50% of monthly rent",
|
|
93
|
+
},
|
|
94
|
+
details: { depositAmountCents: depositAmount, maxAllowedCents: maxAllowed },
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
checkInterestPayment(input) {
|
|
98
|
+
const hasYieldSplit = input.yieldShareActive === true;
|
|
99
|
+
const tenantShare = input.tenantYieldPercentage ?? 0;
|
|
100
|
+
return {
|
|
101
|
+
name: "interest-payment",
|
|
102
|
+
passed: hasYieldSplit && tenantShare > 0,
|
|
103
|
+
confidence: hasYieldSplit ? 1.0 : 0.8,
|
|
104
|
+
note: hasYieldSplit
|
|
105
|
+
? `Interest arrangement active — ${tenantShare}% to tenant (minimum 2% annual required)`
|
|
106
|
+
: "NS RTA requires minimum 2% annual interest on deposit paid to tenant",
|
|
107
|
+
citation: {
|
|
108
|
+
statute: "Nova Scotia Residential Tenancies Act",
|
|
109
|
+
section: "Section 10(4)",
|
|
110
|
+
summary: "Minimum 2% annual interest on security deposit must be paid to tenant",
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
checkToRemediation(check) {
|
|
115
|
+
if (check.name === "deposit-limit") {
|
|
116
|
+
return {
|
|
117
|
+
action: "reduce_deposit",
|
|
118
|
+
description: "Reduce deposit to 50% of monthly rent per NS RTA s.10(2)",
|
|
119
|
+
urgency: "required",
|
|
120
|
+
automatable: true,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
return super.checkToRemediation(check);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
export const caNsSkill = new CANSSkill();
|
|
127
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/jurisdictions/ca-ns/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAU1C,MAAM,OAAO,SAAU,SAAQ,SAAS;IAC7B,EAAE,GAAG,yBAAyB,CAAC;IAC/B,IAAI,GAAG,uCAAuC,CAAC;IAC/C,YAAY,GAAG,OAAgB,CAAC;IAChC,OAAO,GAAG,OAAO,CAAC;IAClB,YAAY,GAAsB;QACzC,oBAAoB;QACpB,kBAAkB;KACnB,CAAC;IAEF,KAAK,CAAC,QAAQ,CAAC,KAAiB;QAC9B,IAAI,KAAK,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;oBACvB,IAAI,EAAE,YAAY;oBAClB,MAAM,EAAE,KAAK;oBACb,UAAU,EAAE,GAAG;oBACf,IAAI,EAAE,6DAA6D,KAAK,CAAC,IAAI,EAAE;iBAChF,CAAC,EAAE,KAAK,CAAC,CAAC;QACb,CAAC;QAED,MAAM,OAAO,GAAG,KAA+B,CAAC;QAChD,MAAM,MAAM,GAAiB;YAC3B,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;YAC/B,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC;YACtC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;YAC/B,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC;SACnC,CAAC;QAEF,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAEO,iBAAiB,CAAC,KAA6B;QACrD,MAAM,eAAe,GAAG,KAAK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W,EAAE,0DAA0D;gBACvE,OAAO,EAAE,UAAU;gBACnB,WAAW,EAAE,IAAI;aAClB,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CA-ON — Ontario Residential Tenancies Act (RTA 2006)
|
|
3
|
+
*
|
|
4
|
+
* Ontario rules:
|
|
5
|
+
* - Deposit limited to one month's rent (last month's rent deposit only)
|
|
6
|
+
* - Landlord must pay interest annually on last month's deposit
|
|
7
|
+
* - 100% principal protection required
|
|
8
|
+
* - LTB (Landlord and Tenant Board) dispute resolution
|
|
9
|
+
* - Rent increases capped at provincial guideline (typically ~2.5%)
|
|
10
|
+
*/
|
|
11
|
+
import { BaseSkill } from "../../base.js";
|
|
12
|
+
import type { SkillInput, SkillResult, SkillCheck, SkillCapability, RemediationStep } from "../../types/index.js";
|
|
13
|
+
export declare class CAONSkill extends BaseSkill {
|
|
14
|
+
readonly id = "huddle-compliance-ca-on";
|
|
15
|
+
readonly name = "Ontario Residential Tenancies Act";
|
|
16
|
+
readonly jurisdiction: "CA-ON";
|
|
17
|
+
readonly version = "1.0.0";
|
|
18
|
+
readonly capabilities: SkillCapability[];
|
|
19
|
+
validate(input: SkillInput): Promise<SkillResult>;
|
|
20
|
+
private checkPrincipalProtection;
|
|
21
|
+
private checkDepositLimit;
|
|
22
|
+
private checkInterestPayment;
|
|
23
|
+
protected checkToRemediation(check: SkillCheck): RemediationStep;
|
|
24
|
+
}
|
|
25
|
+
export declare const caOnSkill: CAONSkill;
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jurisdictions/ca-on/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EAEf,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,SAAU,SAAQ,SAAS;IACtC,QAAQ,CAAC,EAAE,6BAA6B;IACxC,QAAQ,CAAC,IAAI,uCAAuC;IACpD,QAAQ,CAAC,YAAY,EAAG,OAAO,CAAU;IACzC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,YAAY,EAAE,eAAe,EAAE,CAItC;IAEI,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;IAoBvD,OAAO,CAAC,wBAAwB;IAsBhC,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,oBAAoB;cAmBT,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe;CAW1E;AAED,eAAO,MAAM,SAAS,WAAkB,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CA-ON — Ontario Residential Tenancies Act (RTA 2006)
|
|
3
|
+
*
|
|
4
|
+
* Ontario rules:
|
|
5
|
+
* - Deposit limited to one month's rent (last month's rent deposit only)
|
|
6
|
+
* - Landlord must pay interest annually on last month's deposit
|
|
7
|
+
* - 100% principal protection required
|
|
8
|
+
* - LTB (Landlord and Tenant Board) dispute resolution
|
|
9
|
+
* - Rent increases capped at provincial guideline (typically ~2.5%)
|
|
10
|
+
*/
|
|
11
|
+
import { BaseSkill } from "../../base.js";
|
|
12
|
+
export class CAONSkill extends BaseSkill {
|
|
13
|
+
id = "huddle-compliance-ca-on";
|
|
14
|
+
name = "Ontario Residential Tenancies Act";
|
|
15
|
+
jurisdiction = "CA-ON";
|
|
16
|
+
version = "1.0.0";
|
|
17
|
+
capabilities = [
|
|
18
|
+
"deposit-validation",
|
|
19
|
+
"deposit-interest",
|
|
20
|
+
"rent-increase-validation",
|
|
21
|
+
];
|
|
22
|
+
async validate(input) {
|
|
23
|
+
if (input.type !== "deposit-validation") {
|
|
24
|
+
return this.buildResult([{
|
|
25
|
+
name: "input-type",
|
|
26
|
+
passed: false,
|
|
27
|
+
confidence: 1.0,
|
|
28
|
+
note: `ON skill currently supports deposit-validation, received: ${input.type}`,
|
|
29
|
+
}], input);
|
|
30
|
+
}
|
|
31
|
+
const deposit = input;
|
|
32
|
+
const checks = [
|
|
33
|
+
this.checkPrincipalProtection(deposit),
|
|
34
|
+
this.checkDepositLimit(deposit),
|
|
35
|
+
this.checkInterestPayment(deposit),
|
|
36
|
+
];
|
|
37
|
+
return this.buildResult(checks, input);
|
|
38
|
+
}
|
|
39
|
+
checkPrincipalProtection(input) {
|
|
40
|
+
const currentValue = input.collateralValueCents ?? 0;
|
|
41
|
+
const originalDeposit = input.originalDepositValueCents ?? 0;
|
|
42
|
+
const protectionRatio = originalDeposit > 0 ? currentValue / originalDeposit : 1;
|
|
43
|
+
const passed = protectionRatio >= 1.0;
|
|
44
|
+
return {
|
|
45
|
+
name: "principal-protection",
|
|
46
|
+
passed,
|
|
47
|
+
confidence: 1.0,
|
|
48
|
+
note: passed
|
|
49
|
+
? `Principal protected at ${(protectionRatio * 100).toFixed(0)}%`
|
|
50
|
+
: `Protection ratio ${(protectionRatio * 100).toFixed(0)}% is below 100%`,
|
|
51
|
+
citation: {
|
|
52
|
+
statute: "Ontario Residential Tenancies Act, 2006",
|
|
53
|
+
section: "Part IV",
|
|
54
|
+
summary: "100% principal protection required for all deposit arrangements",
|
|
55
|
+
url: "https://www.ontario.ca/laws/statute/06r17",
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
checkDepositLimit(input) {
|
|
60
|
+
const depositAmount = input.depositAmountCents;
|
|
61
|
+
const monthlyRent = input.monthlyRentCents;
|
|
62
|
+
const withinLimit = depositAmount <= monthlyRent;
|
|
63
|
+
return {
|
|
64
|
+
name: "deposit-limit",
|
|
65
|
+
passed: withinLimit,
|
|
66
|
+
confidence: 1.0,
|
|
67
|
+
note: withinLimit
|
|
68
|
+
? `Deposit ($${(depositAmount / 100).toFixed(2)}) within one month's rent limit`
|
|
69
|
+
: `Deposit ($${(depositAmount / 100).toFixed(2)}) exceeds one month's rent ($${(monthlyRent / 100).toFixed(2)})`,
|
|
70
|
+
citation: {
|
|
71
|
+
statute: "Ontario Residential Tenancies Act, 2006",
|
|
72
|
+
section: "Section 106(2)",
|
|
73
|
+
summary: "Landlord may only collect last month's rent deposit, not exceeding one month's rent",
|
|
74
|
+
url: "https://www.ontario.ca/laws/statute/06r17#BK157",
|
|
75
|
+
},
|
|
76
|
+
details: { depositAmountCents: depositAmount, monthlyRentCents: monthlyRent },
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
checkInterestPayment(input) {
|
|
80
|
+
const hasYieldSplit = input.yieldShareActive === true;
|
|
81
|
+
return {
|
|
82
|
+
name: "interest-payment",
|
|
83
|
+
passed: hasYieldSplit,
|
|
84
|
+
confidence: hasYieldSplit ? 1.0 : 0.8,
|
|
85
|
+
note: hasYieldSplit
|
|
86
|
+
? "Yield-bearing arrangement active — tenant receives interest on deposit"
|
|
87
|
+
: "ON RTA requires annual interest payment on last month's rent deposit",
|
|
88
|
+
citation: {
|
|
89
|
+
statute: "Ontario Residential Tenancies Act, 2006",
|
|
90
|
+
section: "Section 106(6)",
|
|
91
|
+
summary: "Landlord must pay interest on last month's rent deposit annually at guideline rate",
|
|
92
|
+
url: "https://www.ontario.ca/laws/statute/06r17#BK157",
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
checkToRemediation(check) {
|
|
97
|
+
if (check.name === "deposit-limit") {
|
|
98
|
+
return {
|
|
99
|
+
action: "reduce_deposit",
|
|
100
|
+
description: "Reduce deposit to one month's rent or less per ON RTA s.106(2)",
|
|
101
|
+
urgency: "required",
|
|
102
|
+
automatable: true,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return super.checkToRemediation(check);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
export const caOnSkill = new CAONSkill();
|
|
109
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/jurisdictions/ca-on/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAU1C,MAAM,OAAO,SAAU,SAAQ,SAAS;IAC7B,EAAE,GAAG,yBAAyB,CAAC;IAC/B,IAAI,GAAG,mCAAmC,CAAC;IAC3C,YAAY,GAAG,OAAgB,CAAC;IAChC,OAAO,GAAG,OAAO,CAAC;IAClB,YAAY,GAAsB;QACzC,oBAAoB;QACpB,kBAAkB;QAClB,0BAA0B;KAC3B,CAAC;IAEF,KAAK,CAAC,QAAQ,CAAC,KAAiB;QAC9B,IAAI,KAAK,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;oBACvB,IAAI,EAAE,YAAY;oBAClB,MAAM,EAAE,KAAK;oBACb,UAAU,EAAE,GAAG;oBACf,IAAI,EAAE,6DAA6D,KAAK,CAAC,IAAI,EAAE;iBAChF,CAAC,EAAE,KAAK,CAAC,CAAC;QACb,CAAC;QAED,MAAM,OAAO,GAAG,KAA+B,CAAC;QAChD,MAAM,MAAM,GAAiB;YAC3B,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC;YACtC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;YAC/B,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC;SACnC,CAAC;QAEF,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAEO,wBAAwB,CAAC,KAA6B;QAC5D,MAAM,YAAY,GAAG,KAAK,CAAC,o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H,QAAQ,EAAE;gBACR,OAAO,EAAE,yCAAyC;gBAClD,OAAO,EAAE,gBAAgB;gBACzB,OAAO,EAAE,qFAAqF;gBAC9F,GAAG,EAAE,iDAAiD;aACvD;YACD,OAAO,EAAE,EAAE,kBAAkB,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE;SAC9E,CAAC;IACJ,CAAC;IAEO,oBAAoB,CAAC,KAA6B;QACxD,MAAM,aAAa,GAAG,KAAK,CAAC,gBAAgB,KAAK,IAAI,CAAC;QAEtD,OAAO;YACL,IAAI,EAAE,kBAAkB;YACxB,MAAM,EAAE,aAAa;YACrB,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;YACrC,IAAI,EAAE,aAAa;gBACjB,CAAC,CAAC,wEAAwE;gBAC1E,CAAC,CAAC,sEAAsE;YAC1E,QAAQ,EAAE;gBACR,OAAO,EAAE,yCAAyC;gBAClD,OAAO,EAAE,gBAAgB;gBACzB,OAAO,EAAE,oFAAoF;gBAC7F,GAAG,EAAE,iDAAiD;aACvD;SACF,CAAC;IACJ,CAAC;IAEkB,kBAAkB,CAAC,KAAiB;QACrD,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;YACnC,OAAO;gBACL,MAAM,EAAE,gBAAgB;gBACxB,WAAW,EAAE,gEAAgE;gBAC7E,OAAO,EAAE,UAAU;gBACnB,WAAW,EAAE,IAAI;aAClB,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CA-QC — Code civil du Québec & Tribunal administratif du logement (TAL)
|
|
3
|
+
*
|
|
4
|
+
* Quebec rules / Règles du Québec:
|
|
5
|
+
* - Security deposits PROHIBITED — CCQ art. 1904 / Dépôts de garantie INTERDITS
|
|
6
|
+
* - Only first month's rent permitted in advance / Seulement un mois de loyer à l'avance
|
|
7
|
+
* - Mandatory standard lease form — RLRQ c B-3.1 r 1 / Formulaire de bail obligatoire
|
|
8
|
+
* - TAL (formerly Régie du logement since 2020-09-01) — RLRQ c T-15.01
|
|
9
|
+
* - Huddle bonds: collateralized lease guarantee, not a deposit
|
|
10
|
+
* (garantie locative collatéralisée, non un dépôt de garantie)
|
|
11
|
+
*
|
|
12
|
+
* Bilingual note: Citations appear in French (primary legal language) followed by English.
|
|
13
|
+
* Note bilingue : Les citations apparaissent en français (langue juridique principale) suivies de l'anglais.
|
|
14
|
+
*/
|
|
15
|
+
import { BaseSkill } from "../../base.js";
|
|
16
|
+
import type { SkillInput, SkillResult, SkillCheck, SkillCapability, RemediationStep } from "../../types/index.js";
|
|
17
|
+
export declare class CAQCSkill extends BaseSkill {
|
|
18
|
+
readonly id = "huddle-compliance-ca-qc";
|
|
19
|
+
readonly name = "Quebec Civil Code & TAL / Code civil du Qu\u00E9bec & TAL";
|
|
20
|
+
readonly jurisdiction: "CA-QC";
|
|
21
|
+
readonly version = "1.1.0";
|
|
22
|
+
readonly capabilities: SkillCapability[];
|
|
23
|
+
validate(input: SkillInput): Promise<SkillResult>;
|
|
24
|
+
/**
|
|
25
|
+
* CCQ art. 1904 — Interdiction de dépôt / Deposit Prohibition
|
|
26
|
+
*
|
|
27
|
+
* FR: "Le locateur ne peut exiger du locataire, lors de la conclusion du bail ou en cours
|
|
28
|
+
* de bail, des avances de loyer excédant un mois ou un dépôt de garantie."
|
|
29
|
+
*
|
|
30
|
+
* EN: "A lessor may not, upon conclusion of the lease or during its term, require the
|
|
31
|
+
* lessee to pay rent installments of more than one month's rent in advance or to make
|
|
32
|
+
* a security deposit."
|
|
33
|
+
*/
|
|
34
|
+
private checkDepositProhibition;
|
|
35
|
+
/**
|
|
36
|
+
* Classification de l'instrument / Instrument Classification
|
|
37
|
+
*
|
|
38
|
+
* A wBTC Collateralized Lease Guarantee ≠ dépôt de garantie under CCQ art. 1904.
|
|
39
|
+
* When both collateralType and instrumentType are correctly set, the on-chain
|
|
40
|
+
* HuddleDepositVaultV3 Golden Rule provides stronger protection than any statute.
|
|
41
|
+
*/
|
|
42
|
+
private checkInstrumentClassification;
|
|
43
|
+
/**
|
|
44
|
+
* CCQ art. 1590 — Protection du principal / Principal Protection
|
|
45
|
+
*
|
|
46
|
+
* FR: "L'obligation confère au créancier le droit d'exiger qu'elle soit exécutée
|
|
47
|
+
* entièrement, correctement et sans retard."
|
|
48
|
+
*
|
|
49
|
+
* EN: "An obligation confers on the creditor the right to demand that the
|
|
50
|
+
* obligation be performed in full, in the proper manner and without delay."
|
|
51
|
+
*
|
|
52
|
+
* Principal of any lease guarantee must equal or exceed original amount at all times.
|
|
53
|
+
*/
|
|
54
|
+
private checkPrincipalProtection;
|
|
55
|
+
/**
|
|
56
|
+
* Règlement sur les formulaires de bail obligatoires, RLRQ c B-3.1 r 1
|
|
57
|
+
* Mandatory standard lease form / Formulaire de bail obligatoire
|
|
58
|
+
*
|
|
59
|
+
* All residential leases in Quebec must use the TAL-approved mandatory form.
|
|
60
|
+
*/
|
|
61
|
+
private checkMandatoryBailForm;
|
|
62
|
+
/**
|
|
63
|
+
* Loi sur le Tribunal administratif du logement, RLRQ c T-15.01
|
|
64
|
+
*
|
|
65
|
+
* TAL (formerly Régie du logement — renamed 2020-09-01 by 2019, c. 28) has
|
|
66
|
+
* exclusive jurisdiction over all residential tenancy disputes in Quebec.
|
|
67
|
+
*
|
|
68
|
+
* FR: Compétence exclusive du TAL sur les litiges résidentiels.
|
|
69
|
+
* EN: TAL has exclusive jurisdiction over residential disputes.
|
|
70
|
+
*/
|
|
71
|
+
private checkTALCompliance;
|
|
72
|
+
protected checkToRemediation(check: SkillCheck): RemediationStep;
|
|
73
|
+
}
|
|
74
|
+
export declare const caQcSkill: CAQCSkill;
|
|
75
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jurisdictions/ca-qc/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EAEf,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,SAAU,SAAQ,SAAS;IACtC,QAAQ,CAAC,EAAE,6BAA6B;IACxC,QAAQ,CAAC,IAAI,+DAA0D;IACvE,QAAQ,CAAC,YAAY,EAAG,OAAO,CAAU;IACzC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,YAAY,EAAE,eAAe,EAAE,CAEtC;IAEI,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;IAsBvD;;;;;;;;;OASG;IACH,OAAO,CAAC,uBAAuB;IAwB/B;;;;;;OAMG;IACH,OAAO,CAAC,6BAA6B;IA+CrC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,wBAAwB;IAwBhC;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAqB9B;;;;;;;;OAQG;IACH,OAAO,CAAC,kBAAkB;cAoBP,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe;CAmB1E;AAED,eAAO,MAAM,SAAS,WAAkB,CAAC"}
|