@lazyingart/agintiflow 0.20.138 → 0.20.140

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazyingart/agintiflow",
3
- "version": "0.20.138",
3
+ "version": "0.20.140",
4
4
  "type": "module",
5
5
  "description": "AgInTiFlow is a project-aware agent workspace for hybrid wet-dry R&D, hardware-aware intelligence, software automation, and industrial workflows.",
6
6
  "license": "Apache-2.0",
@@ -1038,7 +1038,9 @@ try {
1038
1038
  content: [
1039
1039
  "import os",
1040
1040
  "from openai import OpenAI",
1041
- 'api_key = os.environ.get("DEEPSEEK_API_KEY")',
1041
+ "def load_api_key():",
1042
+ ' return os.environ.get("DEEPSEEK_API_KEY")',
1043
+ "api_key = load_api_key()",
1042
1044
  'client = OpenAI(api_key=api_key, base_url="https://api.deepseek.com")',
1043
1045
  "print(client)",
1044
1046
  "",
@@ -0,0 +1,45 @@
1
+ ---
2
+ id: bilingual-interlinear-book
3
+ label: Bilingual Interlinear Book Pipeline
4
+ description: Build Chinese/Japanese or other paired-language pocket books with Markdown extraction, chunk manifests, ruby/pinyin JSON, grammar roles, monitoring, and LaTeX PDF outputs.
5
+ triggers:
6
+ - interlinear
7
+ - bilingual book
8
+ - paired language
9
+ - furigana
10
+ - pinyin
11
+ - ruby
12
+ - xelatex
13
+ - pocket book
14
+ - grammar roles
15
+ tools:
16
+ - read_file
17
+ - write_file
18
+ - run_command
19
+ - tmux_start_session
20
+ - tmux_capture_pane
21
+ ---
22
+ # Bilingual Interlinear Book Pipeline
23
+
24
+ Use this skill when the task asks for a paired-language book, ruby/furigana/pinyin, Chinese/Japanese interlinear layout, grammar-role color, or pocket-size LaTeX output.
25
+
26
+ ## Required Workflow
27
+
28
+ 1. Inspect repository instructions, existing scripts, book plans, and ignored paths before editing.
29
+ 2. Keep original PDFs/EPUBs in source folders and do not commit large source media unless the repository explicitly tracks them.
30
+ 3. Convert source books to durable Markdown first. Keep raw and cleaned Markdown separate when OCR or EPUB extraction is noisy.
31
+ 4. Split cleaned Markdown into stable paragraph- or chapter-scoped chunks with `manifest.json` and `chunks.jsonl`. Use source paragraph IDs that survive reruns.
32
+ 5. Write resumable per-chunk JSON artifacts. Never overwrite a valid reviewed chunk unless a validator or prompt version requires regeneration; move stale chunks out of the compile path.
33
+ 6. Generate or repair annotations with a provider worker loop, not a monolithic prompt. Each chunk should validate independently before promotion.
34
+ 7. Compile preview PDFs periodically and at the end. For paired-language books, compile both directions when renderers exist, plus color and blackwhite variants when color is supported.
35
+ 8. Run the writer and monitor in observable tmux sessions with status files, logs, retry/backoff for provider limits, and clear resume commands.
36
+
37
+ ## JSON Quality Gates
38
+
39
+ Every promoted chunk must preserve source text exactly. Chinese Hanzi tokens are one character each with pinyin. Japanese kanji tokens are one character each with furigana. Nontrivial Japanese lines must use normal mixed kanji/kana, not kana-only placeholders.
40
+
41
+ For grammar coloring, assign `g` using only: `subject`, `predicate`, `object`, `attributive`, `adverbial`, `complement`, `topic`, `function`. Color PDFs depend on these fields: every Chinese Hanzi token and every Japanese kanji token should carry `g`. Blackwhite builds should force all grammar colors to black through the renderer, not by deleting `g`.
42
+
43
+ ## Completion Evidence
44
+
45
+ Report chunk totals, valid/reviewed count, failed or stale count, first missing chunk, latest PDF paths, and the exact resume command. Verify PDFs exist on disk and that generated TeX contains grammar color macros for color builds. Commit tracked scripts, templates, plans, and stable JSON checkpoints after meaningful edits.
@@ -210,6 +210,8 @@ function secretContentPolicy(content) {
210
210
  function stripSafeCredentialReferences(content) {
211
211
  let text = String(content ?? "");
212
212
  const keyName = String.raw`(?:api[_-]?key|token|secret|password|passwd|npm_token|_authToken|grsai|venice_api_key)`;
213
+ const codeKeyName = String.raw`(?:api[_-]?key|apiKey|token|secret|password|passwd|npmToken|authToken|grsai|veniceApiKey|venice_api_key)`;
214
+ const codeExpression = String.raw`[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\([^"'\n]*\))?`;
213
215
  const envName = String.raw`[A-Z][A-Z0-9_]*(?:API[_-]?KEY|TOKEN|SECRET|PASSWORD|PASSWD|GRSAI|VENICE)[A-Z0-9_]*`;
214
216
 
215
217
  text = text.replace(
@@ -228,6 +230,10 @@ function stripSafeCredentialReferences(content) {
228
230
  new RegExp(String.raw`([,(]\s*)${keyName}\s*=\s*[A-Za-z_$][\w$]*(?=\s*[,)\n])`, "gi"),
229
231
  "$1safe_credential_ref=[VAR_REF]"
230
232
  );
233
+ text = text.replace(
234
+ new RegExp(String.raw`\b${codeKeyName}\s*=\s*${codeExpression}(?=\s*[,;)\n])`, "g"),
235
+ "safe_credential_ref=[EXPR_REF]"
236
+ );
231
237
  text = text.replace(
232
238
  new RegExp(String.raw`([,{]\s*)${keyName}\s*:\s*[A-Za-z_$][\w$]*(?=\s*[,}\n])`, "gi"),
233
239
  "$1safe_credential_ref=[VAR_REF]"