agent-sin 0.1.12 → 0.1.15

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.
Files changed (97) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +2 -1
  3. package/builtin-skills/_shared/_todo_lib.py +290 -0
  4. package/builtin-skills/even-g2-setup/main.ts +896 -0
  5. package/builtin-skills/even-g2-setup/skill.yaml +133 -0
  6. package/builtin-skills/memo-delete/main.py +28 -107
  7. package/builtin-skills/memo-delete/skill.yaml +10 -21
  8. package/builtin-skills/memo-index/main.py +96 -64
  9. package/builtin-skills/memo-index/skill.yaml +4 -10
  10. package/builtin-skills/memo-list/main.py +126 -72
  11. package/builtin-skills/memo-list/skill.yaml +8 -14
  12. package/builtin-skills/memo-save/main.py +191 -25
  13. package/builtin-skills/memo-save/skill.yaml +29 -5
  14. package/builtin-skills/memo-search/main.py +38 -18
  15. package/builtin-skills/memo-vector-search/main.py +11 -6
  16. package/builtin-skills/nightly-topic-knowledge/_feedback_lib.py +391 -0
  17. package/builtin-skills/nightly-topic-knowledge/_topics_lib.py +415 -0
  18. package/builtin-skills/nightly-topic-knowledge/main.py +403 -0
  19. package/builtin-skills/nightly-topic-knowledge/skill.yaml +88 -0
  20. package/builtin-skills/schedule-add/main.py +26 -0
  21. package/builtin-skills/service-restart/main.ts +249 -0
  22. package/builtin-skills/service-restart/skill.yaml +49 -0
  23. package/builtin-skills/todo-add/main.py +3 -1
  24. package/builtin-skills/todo-delete/main.py +3 -1
  25. package/builtin-skills/todo-done/main.py +3 -1
  26. package/builtin-skills/todo-list/main.py +4 -1
  27. package/builtin-skills/todo-tick/main.py +3 -1
  28. package/builtin-skills/topic-knowledge-read/main.py +118 -0
  29. package/builtin-skills/topic-knowledge-read/skill.yaml +49 -0
  30. package/dist/builder/build-action-classifier.d.ts +18 -0
  31. package/dist/builder/build-action-classifier.js +82 -1
  32. package/dist/builder/build-flow.d.ts +33 -4
  33. package/dist/builder/build-flow.js +251 -89
  34. package/dist/builder/builder-session.d.ts +1 -1
  35. package/dist/builder/builder-session.js +112 -7
  36. package/dist/builder/conversation-router.d.ts +4 -2
  37. package/dist/builder/conversation-router.js +19 -2
  38. package/dist/cli/index.js +323 -20
  39. package/dist/core/ai-provider.d.ts +1 -0
  40. package/dist/core/ai-provider.js +8 -3
  41. package/dist/core/chat-engine.d.ts +9 -3
  42. package/dist/core/chat-engine.js +1263 -146
  43. package/dist/core/config.d.ts +4 -0
  44. package/dist/core/config.js +82 -0
  45. package/dist/core/daily-memory-promotion.d.ts +7 -0
  46. package/dist/core/daily-memory-promotion.js +568 -14
  47. package/dist/core/image-attachments.d.ts +31 -0
  48. package/dist/core/image-attachments.js +237 -0
  49. package/dist/core/logger.d.ts +2 -1
  50. package/dist/core/logger.js +77 -1
  51. package/dist/core/memo-migration.d.ts +3 -0
  52. package/dist/core/memo-migration.js +422 -0
  53. package/dist/core/native-modules.d.ts +24 -0
  54. package/dist/core/native-modules.js +99 -0
  55. package/dist/core/notifier.d.ts +8 -3
  56. package/dist/core/notifier.js +191 -17
  57. package/dist/core/obsidian-vault.d.ts +19 -0
  58. package/dist/core/obsidian-vault.js +477 -0
  59. package/dist/core/operating-model.d.ts +2 -0
  60. package/dist/core/operating-model.js +15 -0
  61. package/dist/core/output-writer.d.ts +3 -2
  62. package/dist/core/output-writer.js +108 -7
  63. package/dist/core/profile-memory.js +22 -1
  64. package/dist/core/runtime.d.ts +2 -0
  65. package/dist/core/runtime.js +9 -1
  66. package/dist/core/secrets.d.ts +4 -0
  67. package/dist/core/secrets.js +34 -0
  68. package/dist/core/skill-history.d.ts +44 -0
  69. package/dist/core/skill-history.js +329 -0
  70. package/dist/core/skill-registry.d.ts +5 -0
  71. package/dist/core/skill-registry.js +11 -0
  72. package/dist/discord/bot.d.ts +1 -0
  73. package/dist/discord/bot.js +181 -10
  74. package/dist/even-g2/gateway.d.ts +15 -0
  75. package/dist/even-g2/gateway.js +868 -0
  76. package/dist/runtimes/codex-app-server.d.ts +5 -1
  77. package/dist/runtimes/codex-app-server.js +147 -8
  78. package/dist/runtimes/python-runner.js +82 -0
  79. package/dist/runtimes/typescript-runner.js +13 -1
  80. package/dist/skills-sdk/types.d.ts +19 -4
  81. package/dist/telegram/bot.d.ts +1 -0
  82. package/dist/telegram/bot.js +115 -7
  83. package/package.json +3 -1
  84. package/templates/even-g2-agent/README.md +83 -0
  85. package/templates/even-g2-agent/app.json +20 -0
  86. package/templates/even-g2-agent/index.html +31 -0
  87. package/templates/even-g2-agent/package-lock.json +1836 -0
  88. package/templates/even-g2-agent/package.json +22 -0
  89. package/templates/even-g2-agent/scripts/qr-auto.mjs +182 -0
  90. package/templates/even-g2-agent/src/embedded-config.ts +4 -0
  91. package/templates/even-g2-agent/src/main.ts +539 -0
  92. package/templates/even-g2-agent/src/style.css +70 -0
  93. package/templates/even-g2-agent/tsconfig.json +11 -0
  94. package/templates/skill-python/main.py +20 -2
  95. package/templates/skill-python/skill.yaml +9 -0
  96. package/templates/skill-typescript/main.ts +40 -5
  97. package/templates/skill-typescript/skill.yaml +9 -0
@@ -6,11 +6,30 @@
6
6
  // ctx.log.info(msg) / warn / error writes to logs/runs/<run-id>.json and events.jsonl
7
7
  // ctx.memory.get(key) / set(key, v) persists under skill.yaml memory.namespace
8
8
  // ctx.ai.run(step_id, payload) calls an ai_steps entry declared in skill.yaml
9
- // ctx.notify(args) notifies Discord/Telegram/macOS/Mail/Slack/stderr (auto recommended)
9
+ // ctx.notify(args) notifies Discord/Telegram/macOS/Mail/Slack/stderr (auto recommended);
10
+ // pass filePath/filePaths to attach local files on Discord/Telegram
11
+ // ctx.history.append({time?, meta?, content, replace?}) insert/upsert one row in this skill's SQLite log
12
+ // ctx.history.list({from?, to?, limit?}) read past rows as [{time, meta, content}] (date range filter)
13
+ // ctx.history.read({from?, to?}) read past rows as one concatenated string (handy for ai_steps)
10
14
  // ctx.now() current time as an ISO8601 string
11
15
  //
12
16
  // See src/skills-sdk/types.ts for SkillInput / SkillResult.
13
17
  // Runtime handles saving, notifications, and cron; skills should not touch fs directly.
18
+ //
19
+ // If you need to write a user-visible markdown that the runtime's outputs block
20
+ // doesn't fit (free-form filename, rotating log, accumulating list), write it
21
+ // under input.sources.skillOutputDir:
22
+ //
23
+ // import { mkdir, appendFile } from "node:fs/promises";
24
+ // import path from "node:path";
25
+ // const dir = input.sources.skillOutputDir!;
26
+ // await appendFile(path.join(dir, "my-log.md"), "...\n");
27
+ //
28
+ // The runtime creates the dir before invoking the skill. Use a plain filename
29
+ // like "marketing-log.md" — DO NOT create date-based subdirectories like
30
+ // 2026/05/2026-05-22.md. Files placed here surface in Obsidian as
31
+ // "06 Skills/<skill-id>/...". For internal state the user shouldn't see, use
32
+ // ctx.memory or ctx.history, not this dir.
14
33
 
15
34
  interface SkillCtx {
16
35
  log: { info: (m: string) => void; warn: (m: string) => void; error: (m: string) => void };
@@ -20,15 +39,24 @@ interface SkillCtx {
20
39
  set: (key: string, value: unknown) => Promise<boolean>;
21
40
  };
22
41
  ai: { run: (stepId: string, payload: unknown) => Promise<unknown> };
42
+ history: {
43
+ append: (args: { time?: string | Date; meta?: Record<string, unknown>; content: string; replace?: boolean }) => Promise<{ path: string; id: string }>;
44
+ list: (options?: { from?: string | Date; to?: string | Date; limit?: number }) => Promise<Array<{ time: string; meta: Record<string, unknown>; content: string }>>;
45
+ read: (options?: { from?: string | Date; to?: string | Date }) => Promise<string>;
46
+ };
23
47
  notify: (args: {
24
- title: string;
25
- body: string;
48
+ title?: string;
49
+ body?: string;
26
50
  subtitle?: string;
27
51
  sound?: boolean;
28
- channel?: "auto" | "macos" | "discord" | "telegram" | "slack" | "mail" | "stderr";
52
+ channel?: "auto" | "macos" | "discord" | "telegram" | "slack" | "mail" | "g2" | "stderr";
29
53
  to?: string;
30
54
  discordThreadId?: string;
31
55
  telegramThreadId?: string;
56
+ filePath?: string;
57
+ filePaths?: string[];
58
+ imagePath?: string;
59
+ imagePaths?: string[];
32
60
  }) => Promise<{ ok: boolean; channel: string; detail?: string }>;
33
61
  now: () => string;
34
62
  }
@@ -36,7 +64,14 @@ interface SkillCtx {
36
64
  interface SkillInput {
37
65
  args: Record<string, unknown>;
38
66
  trigger: { type: string; id: string; time: string };
39
- sources: Record<string, unknown> & { locale?: string };
67
+ sources: Record<string, unknown> & {
68
+ locale?: string;
69
+ workspace?: string;
70
+ notes_dir?: string;
71
+ memory_dir?: string;
72
+ skill_output_dir?: string;
73
+ skillOutputDir?: string;
74
+ };
40
75
  memory: Record<string, unknown>;
41
76
  }
42
77
 
@@ -36,6 +36,15 @@ memory:
36
36
  read: true
37
37
  write: true
38
38
 
39
+ # Enable history when the skill should accumulate a queryable log (food,
40
+ # weight, training, reviews, etc.). Entries land in ~/.agent-sin/data/<skill-id>.db
41
+ # (SQLite, hidden from the user) and the skill reads them back via
42
+ # ctx.history.list({from, to, limit}). Pair it with an outputs entry below if
43
+ # you also want a human-readable Markdown report under notes/.
44
+ # history:
45
+ # read: true
46
+ # write: true
47
+
39
48
  # Optional: set "raw" only when you want to return the summary directly to users.
40
49
  # By default, the LLM receives the result and formats a natural-language reply.
41
50
  # See https://agent.shingoirie.com/skill-authoring for details.