open-agreements 0.2.0 → 0.2.2
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 +10 -2
- package/content/templates/closing-checklist/metadata.yaml +6 -13
- package/content/templates/closing-checklist/template.docx +0 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +47 -10
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/checklist.d.ts +21 -1
- package/dist/commands/checklist.d.ts.map +1 -1
- package/dist/commands/checklist.js +175 -44
- package/dist/commands/checklist.js.map +1 -1
- package/dist/commands/recipe.js +3 -11
- package/dist/commands/recipe.js.map +1 -1
- package/dist/core/checklist/index.d.ts +22 -14
- package/dist/core/checklist/index.d.ts.map +1 -1
- package/dist/core/checklist/index.js +79 -39
- package/dist/core/checklist/index.js.map +1 -1
- package/dist/core/checklist/jsonl-stores.d.ts +3 -0
- package/dist/core/checklist/jsonl-stores.d.ts.map +1 -0
- package/dist/core/checklist/jsonl-stores.js +16 -0
- package/dist/core/checklist/jsonl-stores.js.map +1 -0
- package/dist/core/checklist/schemas.d.ts +2 -2
- package/dist/core/checklist/schemas.js +1 -1
- package/dist/core/checklist/schemas.js.map +1 -1
- package/dist/core/checklist/state-manager.d.ts +146 -0
- package/dist/core/checklist/state-manager.d.ts.map +1 -0
- package/dist/core/checklist/state-manager.js +147 -0
- package/dist/core/checklist/state-manager.js.map +1 -0
- package/dist/core/checklist/status-labels.d.ts +6 -0
- package/dist/core/checklist/status-labels.d.ts.map +1 -0
- package/dist/core/checklist/status-labels.js +29 -0
- package/dist/core/checklist/status-labels.js.map +1 -0
- package/dist/core/validation/recipe.d.ts.map +1 -1
- package/dist/core/validation/recipe.js +47 -61
- package/dist/core/validation/recipe.js.map +1 -1
- package/package.json +1 -1
- package/skills/cloud-service-agreement/SKILL.md +9 -0
- package/skills/data-privacy-agreement/SKILL.md +9 -0
- package/skills/delaware-franchise-tax/SKILL.md +56 -19
- package/skills/delaware-franchise-tax/reference/ecorp-portal-playwright-notes.md +136 -0
- package/skills/edit-docx-agreement/CONNECTORS.md +20 -0
- package/skills/edit-docx-agreement/SKILL.md +77 -0
- package/skills/employment-contract/SKILL.md +9 -0
- package/skills/iso-27001-evidence-collection/CONNECTORS.md +23 -0
- package/skills/iso-27001-evidence-collection/SKILL.md +300 -0
- package/skills/iso-27001-evidence-collection/rules/api-exports.md +191 -0
- package/skills/iso-27001-evidence-collection/rules/evidence-types.md +107 -0
- package/skills/iso-27001-evidence-collection/rules/screenshot-guide.md +77 -0
- package/skills/iso-27001-internal-audit/CONNECTORS.md +23 -0
- package/skills/iso-27001-internal-audit/SKILL.md +272 -0
- package/skills/iso-27001-internal-audit/rules/access-control.md +191 -0
- package/skills/iso-27001-internal-audit/rules/business-continuity.md +94 -0
- package/skills/iso-27001-internal-audit/rules/change-management.md +211 -0
- package/skills/iso-27001-internal-audit/rules/encryption.md +93 -0
- package/skills/iso-27001-internal-audit/rules/incident-response.md +127 -0
- package/skills/iso-27001-internal-audit/rules/isms-management.md +164 -0
- package/skills/iso-27001-internal-audit/rules/logging-monitoring.md +96 -0
- package/skills/iso-27001-internal-audit/rules/people-controls.md +161 -0
- package/skills/iso-27001-internal-audit/rules/supplier-management.md +92 -0
- package/skills/nda/SKILL.md +9 -0
- package/skills/open-agreements/SKILL.md +9 -0
- package/skills/safe/SKILL.md +9 -0
- package/skills/services-agreement/SKILL.md +9 -0
- package/skills/soc2-readiness/CONNECTORS.md +23 -0
- package/skills/soc2-readiness/SKILL.md +289 -0
- package/skills/soc2-readiness/rules/trust-services.md +230 -0
- package/skills/venture-financing/SKILL.md +9 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { randomUUID } from 'node:crypto';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { appendJsonl, readJsonl } from './jsonl-stores.js';
|
|
7
|
+
import { ClosingChecklistSchema } from './schemas.js';
|
|
8
|
+
const STATE_ROOT = join(homedir(), '.open-agreements', 'checklists');
|
|
9
|
+
export const ChecklistStateSchema = z.object({
|
|
10
|
+
checklist_id: z.string().min(1),
|
|
11
|
+
revision: z.number().int().nonnegative(),
|
|
12
|
+
checklist: ClosingChecklistSchema,
|
|
13
|
+
});
|
|
14
|
+
function stateRoot(root) {
|
|
15
|
+
return root ?? STATE_ROOT;
|
|
16
|
+
}
|
|
17
|
+
function checklistDir(uuid, root) {
|
|
18
|
+
return join(stateRoot(root), uuid);
|
|
19
|
+
}
|
|
20
|
+
function statePath(uuid, root) {
|
|
21
|
+
return join(checklistDir(uuid, root), 'state.json');
|
|
22
|
+
}
|
|
23
|
+
function metaPath(uuid, root) {
|
|
24
|
+
return join(checklistDir(uuid, root), 'meta.json');
|
|
25
|
+
}
|
|
26
|
+
function historyPath(uuid, root) {
|
|
27
|
+
return join(checklistDir(uuid, root), 'history.jsonl');
|
|
28
|
+
}
|
|
29
|
+
function writeJson(path, value) {
|
|
30
|
+
writeFileSync(path, `${JSON.stringify(value, null, 2)}\n`, 'utf-8');
|
|
31
|
+
}
|
|
32
|
+
function readJson(path) {
|
|
33
|
+
return JSON.parse(readFileSync(path, 'utf-8'));
|
|
34
|
+
}
|
|
35
|
+
export function createChecklist(dealName, initialData, opts) {
|
|
36
|
+
const uuid = randomUUID();
|
|
37
|
+
const dir = checklistDir(uuid, opts?.root);
|
|
38
|
+
mkdirSync(dir, { recursive: true });
|
|
39
|
+
const now = new Date().toISOString().slice(0, 10);
|
|
40
|
+
const checklist = initialData ?? {
|
|
41
|
+
deal_name: dealName,
|
|
42
|
+
updated_at: now,
|
|
43
|
+
documents: {},
|
|
44
|
+
checklist_entries: {},
|
|
45
|
+
action_items: {},
|
|
46
|
+
issues: {},
|
|
47
|
+
};
|
|
48
|
+
const state = {
|
|
49
|
+
checklist_id: uuid,
|
|
50
|
+
revision: 0,
|
|
51
|
+
checklist,
|
|
52
|
+
};
|
|
53
|
+
const meta = {
|
|
54
|
+
deal_name: dealName,
|
|
55
|
+
created_at: now,
|
|
56
|
+
uuid,
|
|
57
|
+
};
|
|
58
|
+
writeJson(statePath(uuid, opts?.root), state);
|
|
59
|
+
writeJson(metaPath(uuid, opts?.root), meta);
|
|
60
|
+
return { uuid, dir };
|
|
61
|
+
}
|
|
62
|
+
export function listChecklists(opts) {
|
|
63
|
+
const root = stateRoot(opts?.root);
|
|
64
|
+
if (!existsSync(root))
|
|
65
|
+
return [];
|
|
66
|
+
const entries = readdirSync(root, { withFileTypes: true });
|
|
67
|
+
const results = [];
|
|
68
|
+
for (const entry of entries) {
|
|
69
|
+
if (!entry.isDirectory())
|
|
70
|
+
continue;
|
|
71
|
+
const mp = metaPath(entry.name, opts?.root);
|
|
72
|
+
const sp = statePath(entry.name, opts?.root);
|
|
73
|
+
if (!existsSync(mp) || !existsSync(sp))
|
|
74
|
+
continue;
|
|
75
|
+
try {
|
|
76
|
+
const meta = readJson(mp);
|
|
77
|
+
const state = readJson(sp);
|
|
78
|
+
results.push({
|
|
79
|
+
...meta,
|
|
80
|
+
revision: state.revision,
|
|
81
|
+
updated_at: state.checklist.updated_at,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
// Skip corrupt entries
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return results.sort((a, b) => a.deal_name.localeCompare(b.deal_name));
|
|
89
|
+
}
|
|
90
|
+
export function resolveChecklist(nameOrId, opts) {
|
|
91
|
+
const root = stateRoot(opts?.root);
|
|
92
|
+
if (!existsSync(root))
|
|
93
|
+
return null;
|
|
94
|
+
// Exact UUID match
|
|
95
|
+
const exactDir = checklistDir(nameOrId, opts?.root);
|
|
96
|
+
if (existsSync(join(exactDir, 'state.json')))
|
|
97
|
+
return nameOrId;
|
|
98
|
+
// Fuzzy match by deal name
|
|
99
|
+
const entries = readdirSync(root, { withFileTypes: true });
|
|
100
|
+
const needle = nameOrId.toLowerCase();
|
|
101
|
+
for (const entry of entries) {
|
|
102
|
+
if (!entry.isDirectory())
|
|
103
|
+
continue;
|
|
104
|
+
const mp = metaPath(entry.name, opts?.root);
|
|
105
|
+
if (!existsSync(mp))
|
|
106
|
+
continue;
|
|
107
|
+
try {
|
|
108
|
+
const meta = readJson(mp);
|
|
109
|
+
if (meta.deal_name.toLowerCase() === needle)
|
|
110
|
+
return entry.name;
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
// Skip
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Substring match as fallback
|
|
117
|
+
for (const entry of entries) {
|
|
118
|
+
if (!entry.isDirectory())
|
|
119
|
+
continue;
|
|
120
|
+
const mp = metaPath(entry.name, opts?.root);
|
|
121
|
+
if (!existsSync(mp))
|
|
122
|
+
continue;
|
|
123
|
+
try {
|
|
124
|
+
const meta = readJson(mp);
|
|
125
|
+
if (meta.deal_name.toLowerCase().includes(needle))
|
|
126
|
+
return entry.name;
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
// Skip
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
export function getChecklistState(uuid, opts) {
|
|
135
|
+
const path = statePath(uuid, opts?.root);
|
|
136
|
+
return ChecklistStateSchema.parse(readJson(path));
|
|
137
|
+
}
|
|
138
|
+
export function saveChecklistState(uuid, state, opts) {
|
|
139
|
+
writeJson(statePath(uuid, opts?.root), state);
|
|
140
|
+
}
|
|
141
|
+
export async function appendHistory(uuid, record, opts) {
|
|
142
|
+
await appendJsonl(historyPath(uuid, opts?.root), record);
|
|
143
|
+
}
|
|
144
|
+
export function getHistory(uuid, opts) {
|
|
145
|
+
return readJsonl(historyPath(uuid, opts?.root));
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=state-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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AAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-labels.d.ts","sourceRoot":"","sources":["../../../src/core/checklist/status-labels.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAwBhD,CAAC;AAEF,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-readable labels for checklist enum statuses.
|
|
3
|
+
*/
|
|
4
|
+
export const STATUS_LABELS = {
|
|
5
|
+
// ChecklistEntryStatusEnum
|
|
6
|
+
NOT_STARTED: 'Not Started',
|
|
7
|
+
DRAFT: 'Draft',
|
|
8
|
+
CIRCULATED: 'Circulated',
|
|
9
|
+
FORM_FINAL: 'Form Final',
|
|
10
|
+
PARTIALLY_SIGNED: 'Partially Signed',
|
|
11
|
+
FULLY_EXECUTED: 'Fully Executed',
|
|
12
|
+
DELIVERED: 'Delivered',
|
|
13
|
+
FILED_OR_RECORDED: 'Filed / Recorded',
|
|
14
|
+
// ChecklistItemStatusEnum (action items)
|
|
15
|
+
IN_PROGRESS: 'In Progress',
|
|
16
|
+
COMPLETED: 'Completed',
|
|
17
|
+
ON_HOLD: 'On Hold',
|
|
18
|
+
// SignatoryStatusEnum
|
|
19
|
+
PENDING: 'Pending',
|
|
20
|
+
RECEIVED: 'Received',
|
|
21
|
+
N_A: 'N/A',
|
|
22
|
+
// IssueStatusEnum
|
|
23
|
+
OPEN: 'Open',
|
|
24
|
+
CLOSED: 'Closed',
|
|
25
|
+
};
|
|
26
|
+
export function humanStatus(status) {
|
|
27
|
+
return STATUS_LABELS[status] ?? status;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=status-labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-labels.js","sourceRoot":"","sources":["../../../src/core/checklist/status-labels.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,2BAA2B;IAC3B,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,gBAAgB,EAAE,kBAAkB;IACpC,cAAc,EAAE,gBAAgB;IAChC,SAAS,EAAE,WAAW;IACtB,iBAAiB,EAAE,kBAAkB;IAErC,yCAAyC;IACzC,WAAW,EAAE,aAAa;IAC1B,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAElB,sBAAsB;IACtB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,GAAG,EAAE,KAAK;IAEV,kBAAkB;IAClB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC;AACzC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipe.d.ts","sourceRoot":"","sources":["../../../src/core/validation/recipe.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AASD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7B,sBAAsB,
|
|
1
|
+
{"version":3,"file":"recipe.d.ts","sourceRoot":"","sources":["../../../src/core/validation/recipe.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AASD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7B,sBAAsB,CAwIxB"}
|
|
@@ -48,12 +48,8 @@ export function validateRecipe(recipeDir, recipeId, options) {
|
|
|
48
48
|
ComputedProfileSchema.parse(JSON.parse(raw));
|
|
49
49
|
}
|
|
50
50
|
catch (err) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
errors.push('computed.json: invalid format');
|
|
56
|
-
}
|
|
51
|
+
const message = err instanceof Error ? err.message : 'invalid format';
|
|
52
|
+
errors.push(`computed.json: ${message}`);
|
|
57
53
|
}
|
|
58
54
|
}
|
|
59
55
|
if (isScaffold) {
|
|
@@ -65,68 +61,58 @@ export function validateRecipe(recipeDir, recipeId, options) {
|
|
|
65
61
|
}
|
|
66
62
|
return { recipeId, valid: errors.length === 0, scaffold: true, errors, warnings };
|
|
67
63
|
}
|
|
68
|
-
// Validate replacements.json
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
unknownTargets.add(fieldName);
|
|
99
|
-
}
|
|
64
|
+
// Validate replacements.json for runnable recipes.
|
|
65
|
+
try {
|
|
66
|
+
const raw = readFileSync(join(recipeDir, 'replacements.json'), 'utf-8');
|
|
67
|
+
const replacements = JSON.parse(raw);
|
|
68
|
+
if (typeof replacements !== 'object' || replacements === null) {
|
|
69
|
+
errors.push('replacements.json must be a JSON object');
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
const unknownTargets = new Set();
|
|
73
|
+
for (const [key, value] of Object.entries(replacements)) {
|
|
74
|
+
if (typeof value !== 'string') {
|
|
75
|
+
errors.push(`replacements.json: value for "${key}" must be a string`);
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
// Value must contain at least one {identifier} tag
|
|
79
|
+
const tags = value.match(TAG_RE);
|
|
80
|
+
if (!tags || tags.length === 0) {
|
|
81
|
+
errors.push(`replacements.json: value for "${key}" must contain at least one {identifier} tag, got "${value}"`);
|
|
82
|
+
}
|
|
83
|
+
// All curly-brace tokens in value must be safe identifiers (no control tags)
|
|
84
|
+
const allBraces = value.match(ANY_BRACE_RE);
|
|
85
|
+
if (allBraces) {
|
|
86
|
+
for (const token of allBraces) {
|
|
87
|
+
if (!SAFE_TAG_RE.test(token)) {
|
|
88
|
+
errors.push(`replacements.json: unsafe tag "${token}" in value for "${key}". Only {identifier} tags allowed.`);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
const fieldName = token.slice(1, -1);
|
|
92
|
+
if (!metadataFieldNames.has(fieldName)) {
|
|
93
|
+
unknownTargets.add(fieldName);
|
|
100
94
|
}
|
|
101
95
|
}
|
|
102
|
-
// Value must not contain the source key (infinite loop prevention)
|
|
103
|
-
// For qualified keys, check against the searchText, not the full key.
|
|
104
|
-
// Nth keys use single-shot replacement so they can't loop — skip the check.
|
|
105
|
-
const parsed = parseReplacementKey(key, value);
|
|
106
|
-
if (parsed.type === 'simple' && value.includes(parsed.searchText)) {
|
|
107
|
-
errors.push(`replacements.json: value for "${key}" contains the key itself (would cause infinite loop)`);
|
|
108
|
-
}
|
|
109
|
-
else if (parsed.type === 'context' && value.includes(parsed.searchText)) {
|
|
110
|
-
errors.push(`replacements.json: value for "${key}" contains the search text "${parsed.searchText}" (would cause infinite loop)`);
|
|
111
|
-
}
|
|
112
|
-
// nth keys: no infinite-loop check needed (single-shot replacement)
|
|
113
96
|
}
|
|
114
|
-
|
|
115
|
-
|
|
97
|
+
// Value must not contain the source key (infinite loop prevention)
|
|
98
|
+
// For qualified keys, check against the searchText, not the full key.
|
|
99
|
+
// Nth keys use single-shot replacement so they can't loop — skip the check.
|
|
100
|
+
const parsed = parseReplacementKey(key, value);
|
|
101
|
+
if (parsed.type === 'simple' && value.includes(parsed.searchText)) {
|
|
102
|
+
errors.push(`replacements.json: value for "${key}" contains the key itself (would cause infinite loop)`);
|
|
103
|
+
}
|
|
104
|
+
else if (parsed.type === 'context' && value.includes(parsed.searchText)) {
|
|
105
|
+
errors.push(`replacements.json: value for "${key}" contains the search text "${parsed.searchText}" (would cause infinite loop)`);
|
|
116
106
|
}
|
|
107
|
+
// nth keys: no infinite-loop check needed (single-shot replacement)
|
|
108
|
+
}
|
|
109
|
+
for (const fieldName of unknownTargets) {
|
|
110
|
+
warnings.push(`Replacement target {${fieldName}} not found in metadata fields`);
|
|
117
111
|
}
|
|
118
|
-
}
|
|
119
|
-
catch (err) {
|
|
120
|
-
errors.push(`replacements.json: ${err.message}`);
|
|
121
112
|
}
|
|
122
113
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
errors.push('replacements.json not found (required for runnable recipes)');
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
warnings.push('replacements.json not found (required for runnable recipes)');
|
|
129
|
-
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
errors.push(`replacements.json: ${err.message}`);
|
|
130
116
|
}
|
|
131
117
|
// Validate clean.json if present
|
|
132
118
|
const cleanPath = join(recipeDir, 'clean.json');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipe.js","sourceRoot":"","sources":["../../../src/core/validation/recipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAU9D,gEAAgE;AAChE,MAAM,MAAM,GAAG,uBAAuB,CAAC;AACvC,iEAAiE;AACjE,MAAM,YAAY,GAAG,YAAY,CAAC;AAClC,wDAAwD;AACxD,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,SAAiB,EACjB,QAAgB,EAChB,OAA8B;IAE9B,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,KAAK,CAAC;IAExC,mDAAmD;IACnD,MAAM,KAAK,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACzE,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,CAAC,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12 @@ Use `list_templates` (MCP) or `list --json` (CLI) for the latest inventory and f
|
|
|
170
170
|
- All templates produce Word DOCX files preserving original formatting
|
|
171
171
|
- Templates are licensed by their respective authors (CC-BY-4.0 or CC0-1.0)
|
|
172
172
|
- This tool does not provide legal advice — consult an attorney
|
|
173
|
+
|
|
174
|
+
## Bespoke edits (beyond template fields)
|
|
175
|
+
|
|
176
|
+
If you need to edit boilerplate or add custom language that is not exposed as a template field,
|
|
177
|
+
use the `edit-docx-agreement` skill to surgically edit the generated DOCX and produce a
|
|
178
|
+
tracked-changes output for review. This requires a separately configured Safe Docx MCP server.
|
|
179
|
+
|
|
180
|
+
Note: templates licensed under CC-BY-ND-4.0 (e.g., YC SAFEs) can be filled for your own use
|
|
181
|
+
but must not be redistributed in modified form.
|
|
@@ -156,3 +156,12 @@ Use `list_templates` (MCP) or `list --json` (CLI) for the latest inventory and f
|
|
|
156
156
|
- Templates are licensed by their respective authors (CC-BY-4.0 or CC0-1.0)
|
|
157
157
|
- DPAs and BAAs are regulatory documents — ensure they meet your jurisdiction's specific requirements
|
|
158
158
|
- This tool does not provide legal advice — consult an attorney
|
|
159
|
+
|
|
160
|
+
## Bespoke edits (beyond template fields)
|
|
161
|
+
|
|
162
|
+
If you need to edit boilerplate or add custom language that is not exposed as a template field,
|
|
163
|
+
use the `edit-docx-agreement` skill to surgically edit the generated DOCX and produce a
|
|
164
|
+
tracked-changes output for review. This requires a separately configured Safe Docx MCP server.
|
|
165
|
+
|
|
166
|
+
Note: templates licensed under CC-BY-ND-4.0 (e.g., YC SAFEs) can be filled for your own use
|
|
167
|
+
but must not be redistributed in modified form.
|
|
@@ -23,8 +23,8 @@ File your Delaware annual franchise tax and annual report.
|
|
|
23
23
|
## Security model
|
|
24
24
|
|
|
25
25
|
- This skill **does not** download or execute any code.
|
|
26
|
-
- It **does not** access the Delaware eCorp portal programmatically (the portal prohibits automated tools).
|
|
27
26
|
- All portal interactions are performed by the user, guided step-by-step by the agent.
|
|
27
|
+
- If the user opts in to browser automation (Playwright via CDP), the agent may assist with portal navigation — but credit card and banking details must **always** be entered by the user directly.
|
|
28
28
|
|
|
29
29
|
## When to Use
|
|
30
30
|
|
|
@@ -117,28 +117,64 @@ Total due: $XXX + $50 = $XXX
|
|
|
117
117
|
|
|
118
118
|
## Phase 3: File via Portal
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
The agent can automate the portal using Playwright if Chrome is running with remote debugging enabled. Otherwise, guide the user step-by-step.
|
|
121
|
+
|
|
122
|
+
### Automation Setup (Playwright via CDP)
|
|
123
|
+
|
|
124
|
+
If the user says "use playwright", "use the browser" or requests similar automation:
|
|
125
|
+
|
|
126
|
+
1. **Launch Chrome with remote debugging** (see `reference/ecorp-portal-playwright-notes.md` for commands)
|
|
127
|
+
2. **Connect via Playwright** (see reference for CDP connection snippet)
|
|
128
|
+
3. **Portal field reference**: See `reference/ecorp-portal-playwright-notes.md` for:
|
|
129
|
+
- All field selector IDs
|
|
130
|
+
- Date field workaround (must use JS `el.value =` not Playwright `.fill()`)
|
|
131
|
+
- State dropdown abbreviations (use `value="NY"` not `label="New York"`)
|
|
132
|
+
- Director name fields (separate first/middle/last fields, NOT one name field)
|
|
133
|
+
- APVC activation sequence
|
|
134
|
+
- Session/eId behavior
|
|
135
|
+
|
|
136
|
+
### Filing Steps
|
|
121
137
|
|
|
122
138
|
1. **Navigate**: Open https://icis.corp.delaware.gov/ecorp/logintax.aspx
|
|
123
139
|
2. **Login**: Enter Business Entity File Number. Solve CAPTCHA (if the user shares a screenshot, the agent can try to read it). Click **Continue**.
|
|
124
140
|
3. **Entity verification**: Confirm entity name, registered agent, and registered office match your records.
|
|
125
|
-
4. **
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
|
|
141
|
+
4. **Fill form fields** (all on one page):
|
|
142
|
+
- **Stock info**: Issued shares (per-class field, NOT the readonly total), gross assets, asset date (must == fiscal year end)
|
|
143
|
+
- **Address**: Principal business address with state abbreviation
|
|
144
|
+
- **Nature of business**: Select from dropdown (e.g., "Technology/Software")
|
|
145
|
+
- **Officer**: First/middle/last name, title, address
|
|
146
|
+
- **Directors**: Set total count, click "Enter Directors Info", fill first/middle/last name + address for each
|
|
147
|
+
- **Authorization**: First/middle/last name, title, address
|
|
148
|
+
- **T&C checkbox**: Must check `chkCertify` before continuing
|
|
149
|
+
5. **Recalculate tax**: Click "Recalculate Tax" button. Verify the displayed tax matches your calculation from Phase 2. If it still shows the Authorized Shares method amount, the asset date is probably wrong — fix it via JavaScript.
|
|
150
|
+
6. **Review**: Click "Continue Filing" to see the Review Copy. Verify all data.
|
|
151
|
+
7. **Payment**: Click "Proceed to Payment". The agent **must stop here** — credit card and banking details must be entered by the user. If tax exceeds $5,000, ACH payment is required.
|
|
152
|
+
8. **Confirmation**: After payment:
|
|
153
|
+
- Click **"Display Confirmation Copy"** (`onclick="downloadConfirmation();return false;"`) to save receipt PDF
|
|
154
|
+
- Click **"Email Confirmation Copy"** to email the filed report (opens popup at `Email.aspx`, enter email address)
|
|
155
|
+
- **CRITICAL**: "Once you leave this screen, you will no longer be able to obtain a confirmation copy" — save/email before navigating away
|
|
156
|
+
- Record the Service Request Number from the URL: `srNo=XXXXX`
|
|
157
|
+
|
|
158
|
+
## Phase 4: Save Receipt and Remind
|
|
159
|
+
|
|
160
|
+
### Save the confirmation PDF
|
|
161
|
+
|
|
162
|
+
The downloaded confirmation PDF **is** the filing record — no need to create a separate one.
|
|
163
|
+
|
|
164
|
+
The portal downloads the receipt as `Ecorp_Confirmation_<ServiceRequestNumber>.pdf` to the default Downloads folder. Move it to a durable location:
|
|
165
|
+
- `~/Documents/Tax/Delaware/<EntityName>/` on local disk
|
|
166
|
+
- A "Tax" or "Corporate Records" folder in cloud storage if available
|
|
167
|
+
- Keep the original filename — it contains the Service Request Number for future reference
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# Example
|
|
171
|
+
mkdir -p ~/Documents/Tax/Delaware/My-Corp-Name
|
|
172
|
+
mv ~/Downloads/Ecorp_Confirmation_*.pdf ~/Documents/Tax/Delaware/My-Corp-Name/
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Ask the user where they keep tax records and move the file there.
|
|
176
|
+
|
|
177
|
+
### Set a reminder
|
|
142
178
|
|
|
143
179
|
Remind the user to set an annual reminder for approximately 2 weeks before the deadline:
|
|
144
180
|
- **Mid-February** for corporations (March 1 deadline)
|
|
@@ -156,6 +192,7 @@ For detailed calculation formulas and official guidance, see the `reference/` di
|
|
|
156
192
|
- `reference/tax-calculation.md` — full formulas for both methods with examples
|
|
157
193
|
- `reference/filing-instructions.md` — fees, payment methods, deadlines
|
|
158
194
|
- `reference/faq.md` — frequently asked questions
|
|
195
|
+
- `reference/ecorp-portal-playwright-notes.md` — field selectors, gotchas, and automation tips for the eCorp portal
|
|
159
196
|
|
|
160
197
|
**Official source**: https://corp.delaware.gov/paytaxes/
|
|
161
198
|
**Help line**: 302-739-3073, Option 3
|