agent-sin 0.1.11 → 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.
- package/CHANGELOG.md +79 -0
- package/README.md +2 -1
- package/builtin-skills/_shared/_todo_lib.py +290 -0
- package/builtin-skills/even-g2-setup/main.ts +896 -0
- package/builtin-skills/even-g2-setup/skill.yaml +133 -0
- package/builtin-skills/memo-delete/main.py +28 -107
- package/builtin-skills/memo-delete/skill.yaml +10 -21
- package/builtin-skills/memo-index/main.py +96 -64
- package/builtin-skills/memo-index/skill.yaml +4 -10
- package/builtin-skills/memo-list/main.py +179 -0
- package/builtin-skills/memo-list/skill.yaml +51 -0
- package/builtin-skills/memo-save/main.py +191 -25
- package/builtin-skills/memo-save/skill.yaml +29 -5
- package/builtin-skills/memo-search/main.py +38 -18
- package/builtin-skills/memo-vector-search/main.py +11 -6
- package/builtin-skills/nightly-topic-knowledge/_feedback_lib.py +391 -0
- package/builtin-skills/nightly-topic-knowledge/_topics_lib.py +415 -0
- package/builtin-skills/nightly-topic-knowledge/main.py +403 -0
- package/builtin-skills/nightly-topic-knowledge/skill.yaml +88 -0
- package/builtin-skills/schedule-add/main.py +26 -0
- package/builtin-skills/service-restart/main.ts +249 -0
- package/builtin-skills/service-restart/skill.yaml +49 -0
- package/builtin-skills/todo-add/main.py +3 -1
- package/builtin-skills/todo-delete/main.py +3 -1
- package/builtin-skills/todo-done/main.py +3 -1
- package/builtin-skills/todo-list/main.py +4 -1
- package/builtin-skills/todo-tick/main.py +3 -1
- package/builtin-skills/topic-knowledge-read/main.py +118 -0
- package/builtin-skills/topic-knowledge-read/skill.yaml +49 -0
- package/dist/builder/build-action-classifier.d.ts +18 -0
- package/dist/builder/build-action-classifier.js +82 -1
- package/dist/builder/build-flow.d.ts +33 -4
- package/dist/builder/build-flow.js +251 -89
- package/dist/builder/builder-session.d.ts +1 -1
- package/dist/builder/builder-session.js +112 -7
- package/dist/builder/conversation-router.d.ts +4 -2
- package/dist/builder/conversation-router.js +19 -2
- package/dist/cli/index.js +323 -20
- package/dist/core/ai-provider.d.ts +1 -0
- package/dist/core/ai-provider.js +8 -3
- package/dist/core/chat-engine.d.ts +10 -3
- package/dist/core/chat-engine.js +1563 -197
- package/dist/core/config.d.ts +4 -0
- package/dist/core/config.js +82 -0
- package/dist/core/daily-memory-promotion.d.ts +7 -0
- package/dist/core/daily-memory-promotion.js +568 -14
- package/dist/core/image-attachments.d.ts +31 -0
- package/dist/core/image-attachments.js +237 -0
- package/dist/core/logger.d.ts +2 -1
- package/dist/core/logger.js +77 -1
- package/dist/core/memo-migration.d.ts +3 -0
- package/dist/core/memo-migration.js +422 -0
- package/dist/core/native-modules.d.ts +24 -0
- package/dist/core/native-modules.js +99 -0
- package/dist/core/notifier.d.ts +8 -3
- package/dist/core/notifier.js +191 -17
- package/dist/core/obsidian-vault.d.ts +19 -0
- package/dist/core/obsidian-vault.js +477 -0
- package/dist/core/operating-model.d.ts +2 -0
- package/dist/core/operating-model.js +15 -0
- package/dist/core/output-writer.d.ts +3 -2
- package/dist/core/output-writer.js +108 -7
- package/dist/core/profile-memory.js +22 -1
- package/dist/core/runtime.d.ts +2 -0
- package/dist/core/runtime.js +9 -1
- package/dist/core/secrets.d.ts +4 -0
- package/dist/core/secrets.js +34 -0
- package/dist/core/skill-history.d.ts +44 -0
- package/dist/core/skill-history.js +329 -0
- package/dist/core/skill-registry.d.ts +5 -0
- package/dist/core/skill-registry.js +11 -0
- package/dist/discord/bot.d.ts +13 -0
- package/dist/discord/bot.js +542 -10
- package/dist/even-g2/gateway.d.ts +15 -0
- package/dist/even-g2/gateway.js +868 -0
- package/dist/runtimes/codex-app-server.d.ts +5 -1
- package/dist/runtimes/codex-app-server.js +147 -8
- package/dist/runtimes/python-runner.js +82 -0
- package/dist/runtimes/typescript-runner.js +13 -1
- package/dist/skills-sdk/types.d.ts +19 -4
- package/dist/telegram/bot.d.ts +1 -0
- package/dist/telegram/bot.js +122 -31
- package/package.json +3 -1
- package/templates/even-g2-agent/README.md +83 -0
- package/templates/even-g2-agent/app.json +20 -0
- package/templates/even-g2-agent/index.html +31 -0
- package/templates/even-g2-agent/package-lock.json +1836 -0
- package/templates/even-g2-agent/package.json +22 -0
- package/templates/even-g2-agent/scripts/qr-auto.mjs +182 -0
- package/templates/even-g2-agent/src/embedded-config.ts +4 -0
- package/templates/even-g2-agent/src/main.ts +539 -0
- package/templates/even-g2-agent/src/style.css +70 -0
- package/templates/even-g2-agent/tsconfig.json +11 -0
- package/templates/skill-python/main.py +20 -2
- package/templates/skill-python/skill.yaml +9 -0
- package/templates/skill-typescript/main.ts +40 -5
- 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
|
|
25
|
-
body
|
|
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> & {
|
|
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.
|