@caddis/cli 0.4.116 → 0.4.118
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/bundles/antigravity-plugin/plugin.json +1 -1
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_exit.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_file_lock.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_frontmatter.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_redact.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_roadmap.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_rows.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_status.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_tidy.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_todo.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_workstreams.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_worktree_safety.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/caddis_coordinate.py +43 -3
- package/bundles/antigravity-plugin/scripts/caddis_guide.json +2 -2
- package/bundles/antigravity-plugin/scripts/templates/coordinator.md +1 -0
- package/bundles/antigravity-plugin/skills/graph-email/SKILL.md +5 -4
- package/bundles/antigravity-plugin/skills/send-email/SKILL.md +18 -6
- package/bundles/antigravity-plugin/skills/send-email/email.toml.example +4 -0
- package/bundles/antigravity-plugin/skills/send-email/scripts/send_email.py +10 -3
- package/bundles/antigravity-plugin/skills/stories/SKILL.md +6 -0
- package/bundles/codex/.codex/skills/devops/send-email/SKILL.md +18 -6
- package/bundles/codex/.codex/skills/devops/send-email/email.toml.example +4 -0
- package/bundles/codex/.codex/skills/devops/send-email/scripts/send_email.py +10 -3
- package/bundles/manifest.json +2 -2
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bundles/antigravity-plugin/scripts/__pycache__/caddis_worktree_safety.cpython-311.pyc
CHANGED
|
Binary file
|
|
@@ -1130,6 +1130,11 @@ def load_config(repo_root: Path) -> dict:
|
|
|
1130
1130
|
text = path.read_text(encoding="utf-8")
|
|
1131
1131
|
except FileNotFoundError as exc:
|
|
1132
1132
|
raise FileNotFoundError(f"no coordinator config at {path} (run: caddis_coordinate.py config init)") from exc
|
|
1133
|
+
return _parse_config(text)
|
|
1134
|
+
|
|
1135
|
+
|
|
1136
|
+
def _parse_config(text: str) -> dict:
|
|
1137
|
+
"""The checks of `load_config` on the text of a coordinator.md."""
|
|
1133
1138
|
config = _config_block(text)
|
|
1134
1139
|
if not isinstance(config, dict):
|
|
1135
1140
|
raise ValueError("the config json block must be one JSON object")
|
|
@@ -1170,6 +1175,24 @@ def _start_mode_at(repo_root: Path, rev: str) -> str | None:
|
|
|
1170
1175
|
return block["start_mode"] if block["start_mode"] in START_MODES else "invalid"
|
|
1171
1176
|
|
|
1172
1177
|
|
|
1178
|
+
def load_deploy_config(repo_root: Path) -> dict:
|
|
1179
|
+
"""The config deploy-verify uses: `.caddis/coordinator.md` on `origin/<default branch>` after a fetch.
|
|
1180
|
+
|
|
1181
|
+
A coordinator's own work tree can be far behind origin, and then it reads an old `deploy.jobs` (serve-sight,
|
|
1182
|
+
11 Nov 2026). With no `origin/HEAD` (not a clone), read the work tree as `load_config` does. Raise OSError
|
|
1183
|
+
when the fetch fails and FileNotFoundError when origin has no config."""
|
|
1184
|
+
if _origin_default_branch(repo_root) is None:
|
|
1185
|
+
return load_config(repo_root)
|
|
1186
|
+
fetched = _run(["git", "-C", str(repo_root), "fetch", "-q", "origin"])
|
|
1187
|
+
if fetched.returncode != 0:
|
|
1188
|
+
raise OSError(f"git fetch origin failed in {repo_root}: {fetched.stderr.strip()}")
|
|
1189
|
+
branch = _origin_default_branch(repo_root)
|
|
1190
|
+
shown = _run(["git", "-C", str(repo_root), "show", f"origin/{branch}:{_CONFIG_REL}"])
|
|
1191
|
+
if shown.returncode != 0:
|
|
1192
|
+
raise FileNotFoundError(f"no {_CONFIG_REL} on origin/{branch} in {repo_root}")
|
|
1193
|
+
return _parse_config(shown.stdout)
|
|
1194
|
+
|
|
1195
|
+
|
|
1173
1196
|
def _origin_default_branch(repo_root: Path) -> str | None:
|
|
1174
1197
|
"""The default branch from `refs/remotes/origin/HEAD`, never from the work tree (review, 24 Oct 2026)."""
|
|
1175
1198
|
out = _run(["git", "-C", str(repo_root), "symbolic-ref", "--short", "refs/remotes/origin/HEAD"])
|
|
@@ -1459,6 +1482,16 @@ def _call(runner: Callable[[list[str]], subprocess.CompletedProcess[str]], argv:
|
|
|
1459
1482
|
return result
|
|
1460
1483
|
|
|
1461
1484
|
|
|
1485
|
+
# Jobs that may be skipped in a deploy run and still count (`deploy.skippable_jobs` replaces the list). app-ci
|
|
1486
|
+
# skips deploy_uat on every run that does not deploy to UAT.
|
|
1487
|
+
DEFAULT_SKIPPABLE_JOBS = ("deploy_uat",)
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
def _job_short_name(name: object) -> str:
|
|
1491
|
+
"""`ci / deploy_uat` -> `deploy_uat`: a called workflow's jobs carry the caller job's name as a prefix."""
|
|
1492
|
+
return str(name or "").rsplit("/", 1)[-1].strip()
|
|
1493
|
+
|
|
1494
|
+
|
|
1462
1495
|
def deploy_verify(rid: str, cfg: dict, pr: int, merge_sha: str, *, docs_only: bool,
|
|
1463
1496
|
runner: Callable[[list[str]], subprocess.CompletedProcess[str]] | None = None,
|
|
1464
1497
|
env=os.environ, repo_root: Path | None = None) -> dict:
|
|
@@ -1468,7 +1501,8 @@ def deploy_verify(rid: str, cfg: dict, pr: int, merge_sha: str, *, docs_only: bo
|
|
|
1468
1501
|
Checks run in order and stop at the first failure (the rest are `skip`). D2 does not wait: the model waits
|
|
1469
1502
|
with `caddis_lanes.py ci-watch --run` first. Docs-only runs D1, D2 and D5 only, and D2 fails when the run
|
|
1470
1503
|
contradicts the flag (a job named `deploy...` succeeded, or `deploy.jobs` jobs succeeded). A non-docs run needs
|
|
1471
|
-
`deploy.jobs` successful jobs, and every job when it has more
|
|
1504
|
+
`deploy.jobs` successful jobs, and every job when it has more; a skipped job named in `deploy.skippable_jobs`
|
|
1505
|
+
(default `deploy_uat`) counts as done. `deploy.never_health_path` is never requested.
|
|
1472
1506
|
`GH_TOKEN` comes from the inherited environment only. `repo_root` is where the git commands of D3 run.
|
|
1473
1507
|
A run still in progress at D2 records health `pending`, not `failed`.
|
|
1474
1508
|
Raises ValueError, before any network call and with nothing recorded, for a merge SHA that is not a full SHA,
|
|
@@ -1555,15 +1589,21 @@ def deploy_verify(rid: str, cfg: dict, pr: int, merge_sha: str, *, docs_only: bo
|
|
|
1555
1589
|
jobs = None
|
|
1556
1590
|
if not isinstance(jobs, list):
|
|
1557
1591
|
raise _CheckFailed("gh run view did not print a jobs list")
|
|
1592
|
+
skippable = deploy.get("skippable_jobs", list(DEFAULT_SKIPPABLE_JOBS))
|
|
1593
|
+
if not isinstance(skippable, list) or not all(isinstance(n, str) and n for n in skippable):
|
|
1594
|
+
raise _CheckFailed(f"deploy.skippable_jobs must be a list of job names, not {skippable!r}")
|
|
1558
1595
|
succeeded = [j for j in jobs if isinstance(j, dict) and j.get("conclusion") == "success"]
|
|
1596
|
+
allowed = [j for j in jobs if isinstance(j, dict) and j.get("conclusion") == "skipped"
|
|
1597
|
+
and _job_short_name(j.get("name")) in skippable]
|
|
1559
1598
|
done = len(succeeded)
|
|
1560
1599
|
if docs_only: # a docs-only push deploys nothing: a run that deployed contradicts the flag
|
|
1561
1600
|
deployed = any("deploy" in str(j.get("name", "")).lower() for j in succeeded)
|
|
1562
1601
|
if deployed or (want_ok and done >= want):
|
|
1563
1602
|
raise _CheckFailed(f"docs-only flag contradicts the run: {done} jobs succeeded")
|
|
1564
1603
|
return
|
|
1604
|
+
done += len(allowed) # a named job that was skipped (deploy_uat on a PROD-only run) counts as done
|
|
1565
1605
|
others = ", ".join(f"{j.get('name')}={j.get('conclusion')}" for j in jobs
|
|
1566
|
-
if isinstance(j, dict) and j.get("conclusion") != "success")
|
|
1606
|
+
if isinstance(j, dict) and j.get("conclusion") != "success" and j not in allowed)
|
|
1567
1607
|
detail = f" ({others})" if others else ""
|
|
1568
1608
|
if done < want:
|
|
1569
1609
|
raise _CheckFailed(f"run {found['id']}: {done} of {want} jobs succeeded{detail}")
|
|
@@ -1958,7 +1998,7 @@ def _dispatch(args: argparse.Namespace) -> int:
|
|
|
1958
1998
|
return EXIT_OK
|
|
1959
1999
|
if args.command == "deploy-verify":
|
|
1960
2000
|
root = _deploy_root(args.config_path)
|
|
1961
|
-
out = deploy_verify(rid,
|
|
2001
|
+
out = deploy_verify(rid, load_deploy_config(root), args.pr, args.merge_sha, docs_only=args.docs_only,
|
|
1962
2002
|
runner=_deploy_run, repo_root=root)
|
|
1963
2003
|
marks = " ".join(f"{name}={mark}" for name, mark in out["checks"].items())
|
|
1964
2004
|
_emit(args, out, f"{out['health']}: {marks} ({out['reason']})")
|
|
@@ -30,6 +30,7 @@ What the keys mean:
|
|
|
30
30
|
| `peer_ack.ack_file` | Where each peer writes its ack: `{head, acked[], at}`. An ack older than 30 minutes does not count. Only a peer with a stake in the repo must ack: its folder is in the repo or a worktree of it, or the coordinator lists one of its PRs, branches or plan phases, or it sent `ready` or `phase`. A peer with no stake is not warned and is not in `acked[]`. |
|
|
31
31
|
| `deploy.event` | The event that starts the deploy run (for example `push`). |
|
|
32
32
|
| `deploy.jobs` | The number of jobs in the deploy run. |
|
|
33
|
+
| `deploy.skippable_jobs` | Optional. Jobs that may end `skipped` and still count toward `deploy.jobs`, by name after the last `/` (`ci / deploy_uat` is `deploy_uat`). Default `["deploy_uat"]`: app-ci skips it on every run that does not deploy to UAT. Any other skipped job fails D2. |
|
|
33
34
|
| `deploy.tag` | The release tag scheme. With `calver`, the tag must point at the merge SHA. |
|
|
34
35
|
| `deploy.base_url_env` | The environment variable that holds the production base URL on this machine. |
|
|
35
36
|
| `deploy.auth` | How the checks authenticate to production. |
|
|
@@ -10,7 +10,8 @@ Arguments: $ARGUMENTS
|
|
|
10
10
|
1. Read the skill `send-email` first and follow it.
|
|
11
11
|
2. If `~/.caddis/email.toml` is missing, or `--check` fails, tell the owner to type `! caddis email setup` in the prompt, then stop. The `!` runs it in their own terminal, so the secret never enters the chat. Name what is missing (setting names only, never values). Do not guess values and do not ask for a secret in the chat.
|
|
12
12
|
3. The first argument is the Markdown file. If there is none, ask which file, or offer to write one in the project's `comms/` folder.
|
|
13
|
-
4.
|
|
14
|
-
5.
|
|
15
|
-
6.
|
|
16
|
-
7.
|
|
13
|
+
4. Body: write it for its final reader, ready to forward with no edits (`Hi,` or `Hi DBA team,`, never `Hi <owner>, below is...`). Keep it short: the answer, one small table or a few bullets, the ask. Long detail goes in an attachment.
|
|
14
|
+
5. Subject: for a note to the owner alone, `caddis-<app-name> <subject>` (app name from the project folder). For a note to forward to another team, a plain subject with no prefix. If the owner gave subject words, use them.
|
|
15
|
+
6. Sign-off: `Thanks,` on one line, then the `signature` value from `~/.caddis/email.toml` (when unset, the first word of `git config user.name`) on the next line. Never sign as Claude, an agent, a session name or the mailbox.
|
|
16
|
+
7. Recipient: the owner's own address unless `--to` is given. If `--to` is any other address, confirm with the owner before sending.
|
|
17
|
+
8. Run a dry run, check the preview, then send. Report the provider, status, recipient and subject. Keep a copy of the file in `comms/`.
|
|
@@ -37,16 +37,27 @@ For a local test relay only, set `allow_insecure_auth = true` (a boolean) in the
|
|
|
37
37
|
## Steps
|
|
38
38
|
|
|
39
39
|
1. Write the email as a Markdown file in the project's `comms/` folder (a copy stays in the repo).
|
|
40
|
+
- **Write it for its final reader, ready to forward with no edits.** The owner receives it, but a note meant
|
|
41
|
+
for a team is written to that team: `Hi,` or `Hi DBA team,`, never `Hi <owner>, below is the note...`.
|
|
42
|
+
Write to the owner only when the note is for the owner alone.
|
|
43
|
+
- **Keep it short:** the answer first, then one small table or a few bullets, then the ask. Put long detail
|
|
44
|
+
in an attachment (`--attach`), not in the body.
|
|
40
45
|
- Put `<!-- email-start -->` before the greeting and `<!-- email-end -->` after the sign-off. Only that part is sent.
|
|
41
46
|
- Write plain, short sentences. No em dashes, no arrows, no emoji, no check marks.
|
|
42
|
-
- Sign off with the owner's
|
|
43
|
-
|
|
47
|
+
- Sign off with `Thanks,` on one line and the owner's name on the next line. The name is the `signature` value
|
|
48
|
+
in `~/.caddis/email.toml`; when it is not set, the first word of `git config user.name`. Never sign as
|
|
49
|
+
Claude, an agent, a bot, a session name or the sender mailbox.
|
|
44
50
|
- Write a list as `1.` or `-` lines, one item per line. Wrapped lines join into one paragraph. To force a new
|
|
45
51
|
line inside a paragraph, end the line with `\`. The sign-off line keeps its break by itself.
|
|
46
|
-
|
|
52
|
+
- A table needs a header row and a separator row (`|---|---|` or `--- | ---`). Outer pipes are optional.
|
|
53
|
+
Raw HTML is escaped, so write tables in Markdown.
|
|
54
|
+
2. Subject line:
|
|
55
|
+
- A note for the owner alone: `caddis-<app-name> <short subject>`, for example `caddis-myapp Weekly report check`.
|
|
56
|
+
- A note to forward to another team: a plain subject with no prefix, for example `Data request for the weekly report`.
|
|
47
57
|
3. Dry run. It sends nothing, needs no credentials and writes `<file>.preview.html`:
|
|
48
58
|
`python -I scripts/send_email.py --dry-run --to x@example.com --subject t --body-file <file.md>`
|
|
49
|
-
Read the preview, then delete it.
|
|
59
|
+
Read the preview, then delete it. `md_to_html` writes each table on ONE line, so `grep -c "<tr"` counts tables,
|
|
60
|
+
not rows. Count rows with `grep -o "<tr" <file>.preview.html | wc -l`.
|
|
50
61
|
4. Send:
|
|
51
62
|
`python -I scripts/send_email.py --to <address> --subject '<subject>' --body-file <file.md> [--attach <file> ...]`
|
|
52
63
|
`--to` can repeat. Graph HTTP 202 means Graph accepted the mail. An SMTP "accepted" means the server took it.
|
|
@@ -55,8 +66,9 @@ For a local test relay only, set `allow_insecure_auth = true` (a boolean) in the
|
|
|
55
66
|
|
|
56
67
|
## Rules
|
|
57
68
|
|
|
58
|
-
- **Default recipient is the owner's own address.** The owner forwards it
|
|
59
|
-
in this request. Sending to any other address is an
|
|
69
|
+
- **Default recipient is the owner's own address.** The owner forwards it, so the body is written for the final
|
|
70
|
+
reader (Step 1). Send to a team only when the owner says so in this request. Sending to any other address is an
|
|
71
|
+
outward action: confirm first.
|
|
60
72
|
- Never put personal data, secrets, payment data or customer text in the body.
|
|
61
73
|
- Errors show the provider, the HTTP or SMTP status code and the error name. Do not retry in a loop.
|
|
62
74
|
- Exit codes: 0 done, 1 provider error, 2 missing or invalid setting.
|
|
@@ -17,6 +17,10 @@ sender = ""
|
|
|
17
17
|
# Env var: CADDIS_EMAIL_ENV_FILE. Flag: --env-file.
|
|
18
18
|
env_file = ""
|
|
19
19
|
|
|
20
|
+
# The name under "Thanks," at the end of every email, for example "Junaid".
|
|
21
|
+
# Leave empty to use the first word of `git config user.name`. The script does not read it; the skill does.
|
|
22
|
+
signature = ""
|
|
23
|
+
|
|
20
24
|
[graph]
|
|
21
25
|
# The NAMES of the keys in the env file (or environment) that hold the values.
|
|
22
26
|
# These are the defaults. Change them only if your env file uses other names.
|
|
@@ -80,7 +80,14 @@ def md_to_html(md: str) -> str:
|
|
|
80
80
|
para.clear()
|
|
81
81
|
|
|
82
82
|
def cells(row):
|
|
83
|
-
return [c.strip() for c in row.strip("|").split("|")]
|
|
83
|
+
return [c.strip() for c in row.strip().strip("|").split("|")]
|
|
84
|
+
|
|
85
|
+
def is_table_start(n):
|
|
86
|
+
# A header row with a "|", then a separator row such as "|---|:---:|" or "--- | ---" (outer pipes optional).
|
|
87
|
+
if "|" not in lines[n] or n + 1 >= len(lines):
|
|
88
|
+
return False
|
|
89
|
+
sep = lines[n + 1].strip()
|
|
90
|
+
return "|" in sep and re.match(r"^\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?$", sep) is not None
|
|
84
91
|
|
|
85
92
|
while i < len(lines):
|
|
86
93
|
s = lines[i].strip()
|
|
@@ -93,11 +100,11 @@ def md_to_html(md: str) -> str:
|
|
|
93
100
|
flush()
|
|
94
101
|
n = min(len(s) - len(s.lstrip("#")), 4)
|
|
95
102
|
out.append(f"<h{n}>{inline(s.lstrip('#').strip())}</h{n}>")
|
|
96
|
-
elif
|
|
103
|
+
elif is_table_start(i):
|
|
97
104
|
flush()
|
|
98
105
|
rows = [s]
|
|
99
106
|
i += 2
|
|
100
|
-
while i < len(lines) and lines[i].strip()
|
|
107
|
+
while i < len(lines) and "|" in lines[i] and lines[i].strip():
|
|
101
108
|
rows.append(lines[i].strip())
|
|
102
109
|
i += 1
|
|
103
110
|
i -= 1
|
|
@@ -48,3 +48,9 @@ Stop at the first step that does not exit 0, and report its output.
|
|
|
48
48
|
call.
|
|
49
49
|
- A sync rewrites the plan's whole section. A phase removed from the plan leaves the table.
|
|
50
50
|
- When the stored section has the same hash, the sync writes nothing and makes no new page version.
|
|
51
|
+
- On a page another user edited, the dry run prints the CURRENT version. The write bumps it (seen v5 to v6). The
|
|
52
|
+
section markers survive a real Confluence save: the next sync said `ACTION: unchanged`.
|
|
53
|
+
- `plain()` in `scripts/caddis_stories.py` must protect backtick code spans. It once stripped every `(...)` group
|
|
54
|
+
and corrupted SQL such as `SUM(Base)` and `WITH (NOLOCK)` (fixed in #278). It now holds each whole backtick run
|
|
55
|
+
as a placeholder (CommonMark rule). Review found edge cases: code inside links, code inside parentheses, and
|
|
56
|
+
multi-backtick runs. Any text simplifier for published output needs the same protection.
|
|
@@ -37,16 +37,27 @@ For a local test relay only, set `allow_insecure_auth = true` (a boolean) in the
|
|
|
37
37
|
## Steps
|
|
38
38
|
|
|
39
39
|
1. Write the email as a Markdown file in the project's `comms/` folder (a copy stays in the repo).
|
|
40
|
+
- **Write it for its final reader, ready to forward with no edits.** The owner receives it, but a note meant
|
|
41
|
+
for a team is written to that team: `Hi,` or `Hi DBA team,`, never `Hi <owner>, below is the note...`.
|
|
42
|
+
Write to the owner only when the note is for the owner alone.
|
|
43
|
+
- **Keep it short:** the answer first, then one small table or a few bullets, then the ask. Put long detail
|
|
44
|
+
in an attachment (`--attach`), not in the body.
|
|
40
45
|
- Put `<!-- email-start -->` before the greeting and `<!-- email-end -->` after the sign-off. Only that part is sent.
|
|
41
46
|
- Write plain, short sentences. No em dashes, no arrows, no emoji, no check marks.
|
|
42
|
-
- Sign off with the owner's
|
|
43
|
-
|
|
47
|
+
- Sign off with `Thanks,` on one line and the owner's name on the next line. The name is the `signature` value
|
|
48
|
+
in `~/.caddis/email.toml`; when it is not set, the first word of `git config user.name`. Never sign as
|
|
49
|
+
Claude, an agent, a bot, a session name or the sender mailbox.
|
|
44
50
|
- Write a list as `1.` or `-` lines, one item per line. Wrapped lines join into one paragraph. To force a new
|
|
45
51
|
line inside a paragraph, end the line with `\`. The sign-off line keeps its break by itself.
|
|
46
|
-
|
|
52
|
+
- A table needs a header row and a separator row (`|---|---|` or `--- | ---`). Outer pipes are optional.
|
|
53
|
+
Raw HTML is escaped, so write tables in Markdown.
|
|
54
|
+
2. Subject line:
|
|
55
|
+
- A note for the owner alone: `caddis-<app-name> <short subject>`, for example `caddis-myapp Weekly report check`.
|
|
56
|
+
- A note to forward to another team: a plain subject with no prefix, for example `Data request for the weekly report`.
|
|
47
57
|
3. Dry run. It sends nothing, needs no credentials and writes `<file>.preview.html`:
|
|
48
58
|
`python -I scripts/send_email.py --dry-run --to x@example.com --subject t --body-file <file.md>`
|
|
49
|
-
Read the preview, then delete it.
|
|
59
|
+
Read the preview, then delete it. `md_to_html` writes each table on ONE line, so `grep -c "<tr"` counts tables,
|
|
60
|
+
not rows. Count rows with `grep -o "<tr" <file>.preview.html | wc -l`.
|
|
50
61
|
4. Send:
|
|
51
62
|
`python -I scripts/send_email.py --to <address> --subject '<subject>' --body-file <file.md> [--attach <file> ...]`
|
|
52
63
|
`--to` can repeat. Graph HTTP 202 means Graph accepted the mail. An SMTP "accepted" means the server took it.
|
|
@@ -55,8 +66,9 @@ For a local test relay only, set `allow_insecure_auth = true` (a boolean) in the
|
|
|
55
66
|
|
|
56
67
|
## Rules
|
|
57
68
|
|
|
58
|
-
- **Default recipient is the owner's own address.** The owner forwards it
|
|
59
|
-
in this request. Sending to any other address is an
|
|
69
|
+
- **Default recipient is the owner's own address.** The owner forwards it, so the body is written for the final
|
|
70
|
+
reader (Step 1). Send to a team only when the owner says so in this request. Sending to any other address is an
|
|
71
|
+
outward action: confirm first.
|
|
60
72
|
- Never put personal data, secrets, payment data or customer text in the body.
|
|
61
73
|
- Errors show the provider, the HTTP or SMTP status code and the error name. Do not retry in a loop.
|
|
62
74
|
- Exit codes: 0 done, 1 provider error, 2 missing or invalid setting.
|
|
@@ -17,6 +17,10 @@ sender = ""
|
|
|
17
17
|
# Env var: CADDIS_EMAIL_ENV_FILE. Flag: --env-file.
|
|
18
18
|
env_file = ""
|
|
19
19
|
|
|
20
|
+
# The name under "Thanks," at the end of every email, for example "Junaid".
|
|
21
|
+
# Leave empty to use the first word of `git config user.name`. The script does not read it; the skill does.
|
|
22
|
+
signature = ""
|
|
23
|
+
|
|
20
24
|
[graph]
|
|
21
25
|
# The NAMES of the keys in the env file (or environment) that hold the values.
|
|
22
26
|
# These are the defaults. Change them only if your env file uses other names.
|
|
@@ -80,7 +80,14 @@ def md_to_html(md: str) -> str:
|
|
|
80
80
|
para.clear()
|
|
81
81
|
|
|
82
82
|
def cells(row):
|
|
83
|
-
return [c.strip() for c in row.strip("|").split("|")]
|
|
83
|
+
return [c.strip() for c in row.strip().strip("|").split("|")]
|
|
84
|
+
|
|
85
|
+
def is_table_start(n):
|
|
86
|
+
# A header row with a "|", then a separator row such as "|---|:---:|" or "--- | ---" (outer pipes optional).
|
|
87
|
+
if "|" not in lines[n] or n + 1 >= len(lines):
|
|
88
|
+
return False
|
|
89
|
+
sep = lines[n + 1].strip()
|
|
90
|
+
return "|" in sep and re.match(r"^\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?$", sep) is not None
|
|
84
91
|
|
|
85
92
|
while i < len(lines):
|
|
86
93
|
s = lines[i].strip()
|
|
@@ -93,11 +100,11 @@ def md_to_html(md: str) -> str:
|
|
|
93
100
|
flush()
|
|
94
101
|
n = min(len(s) - len(s.lstrip("#")), 4)
|
|
95
102
|
out.append(f"<h{n}>{inline(s.lstrip('#').strip())}</h{n}>")
|
|
96
|
-
elif
|
|
103
|
+
elif is_table_start(i):
|
|
97
104
|
flush()
|
|
98
105
|
rows = [s]
|
|
99
106
|
i += 2
|
|
100
|
-
while i < len(lines) and lines[i].strip()
|
|
107
|
+
while i < len(lines) and "|" in lines[i] and lines[i].strip():
|
|
101
108
|
rows.append(lines[i].strip())
|
|
102
109
|
i += 1
|
|
103
110
|
i -= 1
|
package/bundles/manifest.json
CHANGED
package/package.json
CHANGED