adaria-ai 0.1.0
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/LICENSE +21 -0
- package/README.md +21 -0
- package/apps.example.yaml +65 -0
- package/dist/agent/audit.d.ts +16 -0
- package/dist/agent/audit.d.ts.map +1 -0
- package/dist/agent/audit.js +42 -0
- package/dist/agent/audit.js.map +1 -0
- package/dist/agent/claude.d.ts +62 -0
- package/dist/agent/claude.d.ts.map +1 -0
- package/dist/agent/claude.js +297 -0
- package/dist/agent/claude.js.map +1 -0
- package/dist/agent/conversation-summary.d.ts +29 -0
- package/dist/agent/conversation-summary.d.ts.map +1 -0
- package/dist/agent/conversation-summary.js +221 -0
- package/dist/agent/conversation-summary.js.map +1 -0
- package/dist/agent/core.d.ts +81 -0
- package/dist/agent/core.d.ts.map +1 -0
- package/dist/agent/core.js +527 -0
- package/dist/agent/core.js.map +1 -0
- package/dist/agent/mcp-launcher.d.ts +42 -0
- package/dist/agent/mcp-launcher.d.ts.map +1 -0
- package/dist/agent/mcp-launcher.js +38 -0
- package/dist/agent/mcp-launcher.js.map +1 -0
- package/dist/agent/mcp-manager.d.ts +81 -0
- package/dist/agent/mcp-manager.d.ts.map +1 -0
- package/dist/agent/mcp-manager.js +136 -0
- package/dist/agent/mcp-manager.js.map +1 -0
- package/dist/agent/memory.d.ts +10 -0
- package/dist/agent/memory.d.ts.map +1 -0
- package/dist/agent/memory.js +95 -0
- package/dist/agent/memory.js.map +1 -0
- package/dist/agent/safety.d.ts +45 -0
- package/dist/agent/safety.d.ts.map +1 -0
- package/dist/agent/safety.js +71 -0
- package/dist/agent/safety.js.map +1 -0
- package/dist/agent/session.d.ts +27 -0
- package/dist/agent/session.d.ts.map +1 -0
- package/dist/agent/session.js +124 -0
- package/dist/agent/session.js.map +1 -0
- package/dist/agent/tool-descriptions.d.ts +8 -0
- package/dist/agent/tool-descriptions.d.ts.map +1 -0
- package/dist/agent/tool-descriptions.js +26 -0
- package/dist/agent/tool-descriptions.js.map +1 -0
- package/dist/cli/analyze.d.ts +8 -0
- package/dist/cli/analyze.d.ts.map +1 -0
- package/dist/cli/analyze.js +114 -0
- package/dist/cli/analyze.js.map +1 -0
- package/dist/cli/daemon.d.ts +2 -0
- package/dist/cli/daemon.d.ts.map +1 -0
- package/dist/cli/daemon.js +91 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/cli/doctor.d.ts +2 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +198 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/init.d.ts +3 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +459 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/logs.d.ts +4 -0
- package/dist/cli/logs.d.ts.map +1 -0
- package/dist/cli/logs.js +50 -0
- package/dist/cli/logs.js.map +1 -0
- package/dist/cli/monitor-cmd.d.ts +11 -0
- package/dist/cli/monitor-cmd.d.ts.map +1 -0
- package/dist/cli/monitor-cmd.js +59 -0
- package/dist/cli/monitor-cmd.js.map +1 -0
- package/dist/cli/start.d.ts +11 -0
- package/dist/cli/start.d.ts.map +1 -0
- package/dist/cli/start.js +103 -0
- package/dist/cli/start.js.map +1 -0
- package/dist/cli/status.d.ts +9 -0
- package/dist/cli/status.d.ts.map +1 -0
- package/dist/cli/status.js +49 -0
- package/dist/cli/status.js.map +1 -0
- package/dist/cli/stop.d.ts +2 -0
- package/dist/cli/stop.d.ts.map +1 -0
- package/dist/cli/stop.js +34 -0
- package/dist/cli/stop.js.map +1 -0
- package/dist/collectors/appstore.d.ts +51 -0
- package/dist/collectors/appstore.d.ts.map +1 -0
- package/dist/collectors/appstore.js +166 -0
- package/dist/collectors/appstore.js.map +1 -0
- package/dist/collectors/arden-tts.d.ts +60 -0
- package/dist/collectors/arden-tts.d.ts.map +1 -0
- package/dist/collectors/arden-tts.js +83 -0
- package/dist/collectors/arden-tts.js.map +1 -0
- package/dist/collectors/asomobile.d.ts +37 -0
- package/dist/collectors/asomobile.d.ts.map +1 -0
- package/dist/collectors/asomobile.js +88 -0
- package/dist/collectors/asomobile.js.map +1 -0
- package/dist/collectors/eodin-blog.d.ts +90 -0
- package/dist/collectors/eodin-blog.d.ts.map +1 -0
- package/dist/collectors/eodin-blog.js +238 -0
- package/dist/collectors/eodin-blog.js.map +1 -0
- package/dist/collectors/eodin-sdk.d.ts +60 -0
- package/dist/collectors/eodin-sdk.d.ts.map +1 -0
- package/dist/collectors/eodin-sdk.js +112 -0
- package/dist/collectors/eodin-sdk.js.map +1 -0
- package/dist/collectors/fridgify-recipes.d.ts +65 -0
- package/dist/collectors/fridgify-recipes.d.ts.map +1 -0
- package/dist/collectors/fridgify-recipes.js +111 -0
- package/dist/collectors/fridgify-recipes.js.map +1 -0
- package/dist/collectors/playstore.d.ts +46 -0
- package/dist/collectors/playstore.d.ts.map +1 -0
- package/dist/collectors/playstore.js +140 -0
- package/dist/collectors/playstore.js.map +1 -0
- package/dist/collectors/youtube.d.ts +44 -0
- package/dist/collectors/youtube.d.ts.map +1 -0
- package/dist/collectors/youtube.js +107 -0
- package/dist/collectors/youtube.js.map +1 -0
- package/dist/config/apps-schema.d.ts +94 -0
- package/dist/config/apps-schema.d.ts.map +1 -0
- package/dist/config/apps-schema.js +66 -0
- package/dist/config/apps-schema.js.map +1 -0
- package/dist/config/keychain.d.ts +14 -0
- package/dist/config/keychain.d.ts.map +1 -0
- package/dist/config/keychain.js +89 -0
- package/dist/config/keychain.js.map +1 -0
- package/dist/config/load-apps.d.ts +16 -0
- package/dist/config/load-apps.d.ts.map +1 -0
- package/dist/config/load-apps.js +38 -0
- package/dist/config/load-apps.js.map +1 -0
- package/dist/config/schema.d.ts +306 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +220 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/store.d.ts +38 -0
- package/dist/config/store.d.ts.map +1 -0
- package/dist/config/store.js +180 -0
- package/dist/config/store.js.map +1 -0
- package/dist/db/queries.d.ts +304 -0
- package/dist/db/queries.d.ts.map +1 -0
- package/dist/db/queries.js +327 -0
- package/dist/db/queries.js.map +1 -0
- package/dist/db/schema.d.ts +15 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +252 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +86 -0
- package/dist/index.js.map +1 -0
- package/dist/messenger/adapter.d.ts +63 -0
- package/dist/messenger/adapter.d.ts.map +1 -0
- package/dist/messenger/adapter.js +7 -0
- package/dist/messenger/adapter.js.map +1 -0
- package/dist/messenger/factory.d.ts +12 -0
- package/dist/messenger/factory.d.ts.map +1 -0
- package/dist/messenger/factory.js +9 -0
- package/dist/messenger/factory.js.map +1 -0
- package/dist/messenger/slack.d.ts +30 -0
- package/dist/messenger/slack.d.ts.map +1 -0
- package/dist/messenger/slack.js +309 -0
- package/dist/messenger/slack.js.map +1 -0
- package/dist/messenger/split.d.ts +17 -0
- package/dist/messenger/split.d.ts.map +1 -0
- package/dist/messenger/split.js +56 -0
- package/dist/messenger/split.js.map +1 -0
- package/dist/orchestrator/dashboard.d.ts +67 -0
- package/dist/orchestrator/dashboard.d.ts.map +1 -0
- package/dist/orchestrator/dashboard.js +113 -0
- package/dist/orchestrator/dashboard.js.map +1 -0
- package/dist/orchestrator/monitor.d.ts +37 -0
- package/dist/orchestrator/monitor.d.ts.map +1 -0
- package/dist/orchestrator/monitor.js +236 -0
- package/dist/orchestrator/monitor.js.map +1 -0
- package/dist/orchestrator/types.d.ts +82 -0
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/types.js +12 -0
- package/dist/orchestrator/types.js.map +1 -0
- package/dist/orchestrator/weekly.d.ts +66 -0
- package/dist/orchestrator/weekly.d.ts.map +1 -0
- package/dist/orchestrator/weekly.js +376 -0
- package/dist/orchestrator/weekly.js.map +1 -0
- package/dist/prompts/loader.d.ts +18 -0
- package/dist/prompts/loader.d.ts.map +1 -0
- package/dist/prompts/loader.js +28 -0
- package/dist/prompts/loader.js.map +1 -0
- package/dist/security/auth.d.ts +14 -0
- package/dist/security/auth.d.ts.map +1 -0
- package/dist/security/auth.js +14 -0
- package/dist/security/auth.js.map +1 -0
- package/dist/security/prompt-guard.d.ts +21 -0
- package/dist/security/prompt-guard.d.ts.map +1 -0
- package/dist/security/prompt-guard.js +54 -0
- package/dist/security/prompt-guard.js.map +1 -0
- package/dist/skills/aso.d.ts +60 -0
- package/dist/skills/aso.d.ts.map +1 -0
- package/dist/skills/aso.js +322 -0
- package/dist/skills/aso.js.map +1 -0
- package/dist/skills/content.d.ts +25 -0
- package/dist/skills/content.d.ts.map +1 -0
- package/dist/skills/content.js +90 -0
- package/dist/skills/content.js.map +1 -0
- package/dist/skills/index.d.ts +65 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +90 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/onboarding.d.ts +58 -0
- package/dist/skills/onboarding.d.ts.map +1 -0
- package/dist/skills/onboarding.js +274 -0
- package/dist/skills/onboarding.js.map +1 -0
- package/dist/skills/registry.d.ts +24 -0
- package/dist/skills/registry.d.ts.map +1 -0
- package/dist/skills/registry.js +66 -0
- package/dist/skills/registry.js.map +1 -0
- package/dist/skills/review.d.ts +33 -0
- package/dist/skills/review.d.ts.map +1 -0
- package/dist/skills/review.js +236 -0
- package/dist/skills/review.js.map +1 -0
- package/dist/skills/sdk-request.d.ts +30 -0
- package/dist/skills/sdk-request.d.ts.map +1 -0
- package/dist/skills/sdk-request.js +72 -0
- package/dist/skills/sdk-request.js.map +1 -0
- package/dist/skills/seo-blog.d.ts +64 -0
- package/dist/skills/seo-blog.d.ts.map +1 -0
- package/dist/skills/seo-blog.js +268 -0
- package/dist/skills/seo-blog.js.map +1 -0
- package/dist/skills/short-form.d.ts +28 -0
- package/dist/skills/short-form.d.ts.map +1 -0
- package/dist/skills/short-form.js +121 -0
- package/dist/skills/short-form.js.map +1 -0
- package/dist/skills/social-publish.d.ts +32 -0
- package/dist/skills/social-publish.d.ts.map +1 -0
- package/dist/skills/social-publish.js +133 -0
- package/dist/skills/social-publish.js.map +1 -0
- package/dist/social/base.d.ts +47 -0
- package/dist/social/base.d.ts.map +1 -0
- package/dist/social/base.js +26 -0
- package/dist/social/base.js.map +1 -0
- package/dist/social/facebook.d.ts +27 -0
- package/dist/social/facebook.d.ts.map +1 -0
- package/dist/social/facebook.js +166 -0
- package/dist/social/facebook.js.map +1 -0
- package/dist/social/factory.d.ts +26 -0
- package/dist/social/factory.d.ts.map +1 -0
- package/dist/social/factory.js +32 -0
- package/dist/social/factory.js.map +1 -0
- package/dist/social/linkedin.d.ts +26 -0
- package/dist/social/linkedin.d.ts.map +1 -0
- package/dist/social/linkedin.js +190 -0
- package/dist/social/linkedin.js.map +1 -0
- package/dist/social/threads.d.ts +21 -0
- package/dist/social/threads.d.ts.map +1 -0
- package/dist/social/threads.js +122 -0
- package/dist/social/threads.js.map +1 -0
- package/dist/social/tiktok.d.ts +23 -0
- package/dist/social/tiktok.d.ts.map +1 -0
- package/dist/social/tiktok.js +110 -0
- package/dist/social/tiktok.js.map +1 -0
- package/dist/social/twitter.d.ts +30 -0
- package/dist/social/twitter.d.ts.map +1 -0
- package/dist/social/twitter.js +189 -0
- package/dist/social/twitter.js.map +1 -0
- package/dist/social/youtube.d.ts +21 -0
- package/dist/social/youtube.d.ts.map +1 -0
- package/dist/social/youtube.js +108 -0
- package/dist/social/youtube.js.map +1 -0
- package/dist/tools/app-info.d.ts +7 -0
- package/dist/tools/app-info.d.ts.map +1 -0
- package/dist/tools/app-info.js +53 -0
- package/dist/tools/app-info.js.map +1 -0
- package/dist/tools/collector-fetch.d.ts +11 -0
- package/dist/tools/collector-fetch.d.ts.map +1 -0
- package/dist/tools/collector-fetch.js +101 -0
- package/dist/tools/collector-fetch.js.map +1 -0
- package/dist/tools/db-query.d.ts +29 -0
- package/dist/tools/db-query.d.ts.map +1 -0
- package/dist/tools/db-query.js +159 -0
- package/dist/tools/db-query.js.map +1 -0
- package/dist/tools/skill-result.d.ts +8 -0
- package/dist/tools/skill-result.d.ts.map +1 -0
- package/dist/tools/skill-result.js +63 -0
- package/dist/tools/skill-result.js.map +1 -0
- package/dist/tools/tool-host.d.ts +12 -0
- package/dist/tools/tool-host.d.ts.map +1 -0
- package/dist/tools/tool-host.js +124 -0
- package/dist/tools/tool-host.js.map +1 -0
- package/dist/types/collectors.d.ts +198 -0
- package/dist/types/collectors.d.ts.map +1 -0
- package/dist/types/collectors.js +28 -0
- package/dist/types/collectors.js.map +1 -0
- package/dist/types/skill.d.ts +60 -0
- package/dist/types/skill.d.ts.map +1 -0
- package/dist/types/skill.js +9 -0
- package/dist/types/skill.js.map +1 -0
- package/dist/utils/circuit-breaker.d.ts +26 -0
- package/dist/utils/circuit-breaker.d.ts.map +1 -0
- package/dist/utils/circuit-breaker.js +67 -0
- package/dist/utils/circuit-breaker.js.map +1 -0
- package/dist/utils/errors.d.ts +44 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +75 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/escape.d.ts +11 -0
- package/dist/utils/escape.d.ts.map +1 -0
- package/dist/utils/escape.js +19 -0
- package/dist/utils/escape.js.map +1 -0
- package/dist/utils/logger.d.ts +19 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +93 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/parse-json.d.ts +13 -0
- package/dist/utils/parse-json.d.ts.map +1 -0
- package/dist/utils/parse-json.js +61 -0
- package/dist/utils/parse-json.js.map +1 -0
- package/dist/utils/paths.d.ts +14 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +19 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +20 -0
- package/dist/utils/rate-limiter.d.ts.map +1 -0
- package/dist/utils/rate-limiter.js +47 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/dist/utils/retry.d.ts +26 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +61 -0
- package/dist/utils/retry.js.map +1 -0
- package/launchd/.gitkeep +0 -0
- package/launchd/com.adaria-ai.daemon.plist.template +62 -0
- package/launchd/com.adaria-ai.monitor.plist.template +41 -0
- package/launchd/com.adaria-ai.weekly.plist.template +43 -0
- package/package.json +72 -0
- package/prompts/aso-description.md +44 -0
- package/prompts/aso-inapp-events.md +20 -0
- package/prompts/aso-metadata.md +34 -0
- package/prompts/aso-screenshots.md +20 -0
- package/prompts/onboarding-hypotheses.md +38 -0
- package/prompts/onboarding-review-timing.md +24 -0
- package/prompts/review-clustering.md +19 -0
- package/prompts/review-replies.md +18 -0
- package/prompts/review-sentiment.md +16 -0
- package/prompts/seo-blog-fridgify-recipe.md +116 -0
- package/prompts/seo-blog.md +69 -0
- package/prompts/short-form-ideas.md +50 -0
- package/prompts/social-publish.md +46 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured JSON logger with correlation IDs, log levels, and file output.
|
|
3
|
+
* Writes to $ADARIA_HOME/logs/adaria-YYYY-MM-DD.log.
|
|
4
|
+
*/
|
|
5
|
+
import fs from "node:fs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { LOGS_DIR } from "./paths.js";
|
|
8
|
+
const LEVEL_PRIORITY = {
|
|
9
|
+
debug: 0,
|
|
10
|
+
info: 1,
|
|
11
|
+
warn: 2,
|
|
12
|
+
error: 3,
|
|
13
|
+
};
|
|
14
|
+
let currentCorrelationId;
|
|
15
|
+
let minLevel = "info";
|
|
16
|
+
const metrics = {
|
|
17
|
+
requestCount: 0,
|
|
18
|
+
errorCount: 0,
|
|
19
|
+
totalResponseTimeMs: 0,
|
|
20
|
+
};
|
|
21
|
+
export function setLogLevel(level) {
|
|
22
|
+
minLevel = level;
|
|
23
|
+
}
|
|
24
|
+
export function setCorrelationId(id) {
|
|
25
|
+
currentCorrelationId = id;
|
|
26
|
+
}
|
|
27
|
+
export function generateCorrelationId() {
|
|
28
|
+
const id = `req-${String(Date.now())}-${Math.random().toString(36).slice(2, 8)}`;
|
|
29
|
+
currentCorrelationId = id;
|
|
30
|
+
return id;
|
|
31
|
+
}
|
|
32
|
+
export function getCorrelationId() {
|
|
33
|
+
return currentCorrelationId;
|
|
34
|
+
}
|
|
35
|
+
function getLogFilePath() {
|
|
36
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
37
|
+
return path.join(LOGS_DIR, `adaria-${today}.log`);
|
|
38
|
+
}
|
|
39
|
+
function writeLog(entry) {
|
|
40
|
+
if (LEVEL_PRIORITY[entry.level] < LEVEL_PRIORITY[minLevel])
|
|
41
|
+
return;
|
|
42
|
+
const line = JSON.stringify(entry);
|
|
43
|
+
try {
|
|
44
|
+
fs.mkdirSync(LOGS_DIR, { recursive: true });
|
|
45
|
+
fs.appendFileSync(getLogFilePath(), line + "\n");
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// Best-effort logging — do not crash the caller
|
|
49
|
+
}
|
|
50
|
+
if (entry.level === "error") {
|
|
51
|
+
console.error(`[${entry.timestamp}] ERROR: ${entry.message}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export function log(level, message, extra) {
|
|
55
|
+
writeLog({
|
|
56
|
+
timestamp: new Date().toISOString(),
|
|
57
|
+
level,
|
|
58
|
+
message,
|
|
59
|
+
correlationId: currentCorrelationId,
|
|
60
|
+
...extra,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export function debug(message, extra) {
|
|
64
|
+
log("debug", message, extra);
|
|
65
|
+
}
|
|
66
|
+
export function info(message, extra) {
|
|
67
|
+
log("info", message, extra);
|
|
68
|
+
}
|
|
69
|
+
export function warn(message, extra) {
|
|
70
|
+
log("warn", message, extra);
|
|
71
|
+
}
|
|
72
|
+
export function error(message, extra) {
|
|
73
|
+
log("error", message, extra);
|
|
74
|
+
}
|
|
75
|
+
export function recordRequest() {
|
|
76
|
+
metrics.requestCount++;
|
|
77
|
+
}
|
|
78
|
+
export function recordError() {
|
|
79
|
+
metrics.errorCount++;
|
|
80
|
+
}
|
|
81
|
+
export function recordResponseTime(ms) {
|
|
82
|
+
metrics.totalResponseTimeMs += ms;
|
|
83
|
+
}
|
|
84
|
+
export function getMetrics() {
|
|
85
|
+
return {
|
|
86
|
+
requestCount: metrics.requestCount,
|
|
87
|
+
errorCount: metrics.errorCount,
|
|
88
|
+
avgResponseTimeMs: metrics.requestCount > 0
|
|
89
|
+
? Math.round(metrics.totalResponseTimeMs / metrics.requestCount)
|
|
90
|
+
: 0,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,MAAM,cAAc,GAA6B;IAC/C,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;CACT,CAAC;AAUF,IAAI,oBAAwC,CAAC;AAC7C,IAAI,QAAQ,GAAa,MAAM,CAAC;AAEhC,MAAM,OAAO,GAAG;IACd,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,CAAC;IACb,mBAAmB,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,KAAe;IACzC,QAAQ,GAAG,KAAK,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,EAAsB;IACrD,oBAAoB,GAAG,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,qBAAqB;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text responses.
|
|
3
|
+
* Uses bracket-matching instead of greedy regex to handle nested structures.
|
|
4
|
+
*
|
|
5
|
+
* Returns `unknown` — callers must narrow via type guards or schema validation.
|
|
6
|
+
*
|
|
7
|
+
* Complexity note: the extraction path is O(n * k) where n is text length and
|
|
8
|
+
* k is the cost of rescanning after a failed JSON.parse inside the nested loop.
|
|
9
|
+
* Fine for typical Claude responses (<10KB) but revisit in M1e if we start
|
|
10
|
+
* piping long agent transcripts through this (add max length guard first).
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseJsonResponse(text: string | null | undefined, fallback?: unknown): unknown;
|
|
13
|
+
//# sourceMappingURL=parse-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-json.d.ts","sourceRoot":"","sources":["../../src/utils/parse-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,QAAQ,GAAE,OAAc,GACvB,OAAO,CAoDT"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safely extract and parse JSON from Claude text responses.
|
|
3
|
+
* Uses bracket-matching instead of greedy regex to handle nested structures.
|
|
4
|
+
*
|
|
5
|
+
* Returns `unknown` — callers must narrow via type guards or schema validation.
|
|
6
|
+
*
|
|
7
|
+
* Complexity note: the extraction path is O(n * k) where n is text length and
|
|
8
|
+
* k is the cost of rescanning after a failed JSON.parse inside the nested loop.
|
|
9
|
+
* Fine for typical Claude responses (<10KB) but revisit in M1e if we start
|
|
10
|
+
* piping long agent transcripts through this (add max length guard first).
|
|
11
|
+
*/
|
|
12
|
+
export function parseJsonResponse(text, fallback = null) {
|
|
13
|
+
if (!text)
|
|
14
|
+
return fallback;
|
|
15
|
+
try {
|
|
16
|
+
return JSON.parse(text);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
// Fall through to extraction
|
|
20
|
+
}
|
|
21
|
+
for (let i = 0; i < text.length; i++) {
|
|
22
|
+
const ch = text.charAt(i);
|
|
23
|
+
if (ch !== "{" && ch !== "[")
|
|
24
|
+
continue;
|
|
25
|
+
const endCh = ch === "{" ? "}" : "]";
|
|
26
|
+
let depth = 0;
|
|
27
|
+
let inString = false;
|
|
28
|
+
let escape = false;
|
|
29
|
+
for (let j = i; j < text.length; j++) {
|
|
30
|
+
const c = text.charAt(j);
|
|
31
|
+
if (escape) {
|
|
32
|
+
escape = false;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (c === "\\" && inString) {
|
|
36
|
+
escape = true;
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (c === '"') {
|
|
40
|
+
inString = !inString;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (inString)
|
|
44
|
+
continue;
|
|
45
|
+
if (c === ch)
|
|
46
|
+
depth++;
|
|
47
|
+
if (c === endCh)
|
|
48
|
+
depth--;
|
|
49
|
+
if (depth === 0) {
|
|
50
|
+
try {
|
|
51
|
+
return JSON.parse(text.slice(i, j + 1));
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return fallback;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=parse-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-json.js","sourceRoot":"","sources":["../../src/utils/parse-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAA+B,EAC/B,WAAoB,IAAI;IAExB,IAAI,CAAC,IAAI;QAAE,OAAO,QAAQ,CAAC;IAE3B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,6BAA6B;IAC/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ACrD,CAAC;gBAAC,MAAM,CAAC;oBACP,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const BUNDLED_PROMPTS_DIR: string;
|
|
2
|
+
export declare const BUNDLED_LAUNCHD_DIR: string;
|
|
3
|
+
export declare const PACKAGE_JSON_PATH: string;
|
|
4
|
+
export declare const ADARIA_HOME: string;
|
|
5
|
+
export declare const CONFIG_PATH: string;
|
|
6
|
+
export declare const APPS_PATH: string;
|
|
7
|
+
export declare const SESSIONS_PATH: string;
|
|
8
|
+
export declare const AUDIT_PATH: string;
|
|
9
|
+
export declare const DATA_DIR: string;
|
|
10
|
+
export declare const DB_PATH: string;
|
|
11
|
+
export declare const LOGS_DIR: string;
|
|
12
|
+
export declare const MEMORY_DIR: string;
|
|
13
|
+
export declare const CONVERSATIONS_DIR: string;
|
|
14
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB,QAAoC,CAAC;AACrE,eAAO,MAAM,mBAAmB,QAAoC,CAAC;AACrE,eAAO,MAAM,iBAAiB,QAAyC,CAAC;AAExE,eAAO,MAAM,WAAW,QAC0C,CAAC;AAEnE,eAAO,MAAM,WAAW,QAAwC,CAAC;AACjE,eAAO,MAAM,SAAS,QAAsC,CAAC;AAC7D,eAAO,MAAM,aAAa,QAA0C,CAAC;AACrE,eAAO,MAAM,UAAU,QAAwC,CAAC;AAChE,eAAO,MAAM,QAAQ,QAAiC,CAAC;AACvD,eAAO,MAAM,OAAO,QAAmC,CAAC;AACxD,eAAO,MAAM,QAAQ,QAAiC,CAAC;AACvD,eAAO,MAAM,UAAU,QAAmC,CAAC;AAC3D,eAAO,MAAM,iBAAiB,QAA0C,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
5
|
+
const packageRoot = path.resolve(path.dirname(thisFile), "..", "..");
|
|
6
|
+
export const BUNDLED_PROMPTS_DIR = path.join(packageRoot, "prompts");
|
|
7
|
+
export const BUNDLED_LAUNCHD_DIR = path.join(packageRoot, "launchd");
|
|
8
|
+
export const PACKAGE_JSON_PATH = path.join(packageRoot, "package.json");
|
|
9
|
+
export const ADARIA_HOME = process.env["ADARIA_HOME"] ?? path.join(os.homedir(), ".adaria");
|
|
10
|
+
export const CONFIG_PATH = path.join(ADARIA_HOME, "config.yaml");
|
|
11
|
+
export const APPS_PATH = path.join(ADARIA_HOME, "apps.yaml");
|
|
12
|
+
export const SESSIONS_PATH = path.join(ADARIA_HOME, "sessions.json");
|
|
13
|
+
export const AUDIT_PATH = path.join(ADARIA_HOME, "audit.jsonl");
|
|
14
|
+
export const DATA_DIR = path.join(ADARIA_HOME, "data");
|
|
15
|
+
export const DB_PATH = path.join(DATA_DIR, "adaria.db");
|
|
16
|
+
export const LOGS_DIR = path.join(ADARIA_HOME, "logs");
|
|
17
|
+
export const MEMORY_DIR = path.join(ADARIA_HOME, "memory");
|
|
18
|
+
export const CONVERSATIONS_DIR = path.join(ADARIA_HOME, "conversations");
|
|
19
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AA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,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token bucket rate limiter for outbound message throttling.
|
|
3
|
+
*/
|
|
4
|
+
export declare class RateLimiter {
|
|
5
|
+
private tokens;
|
|
6
|
+
private readonly maxTokens;
|
|
7
|
+
private readonly refillRate;
|
|
8
|
+
private lastRefill;
|
|
9
|
+
/**
|
|
10
|
+
* @param maxTokens Maximum burst capacity
|
|
11
|
+
* @param refillRate Tokens added per second
|
|
12
|
+
*/
|
|
13
|
+
constructor(maxTokens: number, refillRate: number);
|
|
14
|
+
/** Waits until a token is available, then consumes it. */
|
|
15
|
+
acquire(): Promise<void>;
|
|
16
|
+
/** Tries to consume a token without waiting. Returns false if none available. */
|
|
17
|
+
tryAcquire(): boolean;
|
|
18
|
+
private refill;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=rate-limiter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate-limiter.d.ts","sourceRoot":"","sources":["../../src/utils/rate-limiter.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,UAAU,CAAS;IAE3B;;;OAGG;gBACS,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAOjD,0DAA0D;IACpD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAY9B,iFAAiF;IACjF,UAAU,IAAI,OAAO;IASrB,OAAO,CAAC,MAAM;CASf"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token bucket rate limiter for outbound message throttling.
|
|
3
|
+
*/
|
|
4
|
+
export class RateLimiter {
|
|
5
|
+
tokens;
|
|
6
|
+
maxTokens;
|
|
7
|
+
refillRate;
|
|
8
|
+
lastRefill;
|
|
9
|
+
/**
|
|
10
|
+
* @param maxTokens Maximum burst capacity
|
|
11
|
+
* @param refillRate Tokens added per second
|
|
12
|
+
*/
|
|
13
|
+
constructor(maxTokens, refillRate) {
|
|
14
|
+
this.maxTokens = maxTokens;
|
|
15
|
+
this.tokens = maxTokens;
|
|
16
|
+
this.refillRate = refillRate;
|
|
17
|
+
this.lastRefill = Date.now();
|
|
18
|
+
}
|
|
19
|
+
/** Waits until a token is available, then consumes it. */
|
|
20
|
+
async acquire() {
|
|
21
|
+
this.refill();
|
|
22
|
+
if (this.tokens >= 1) {
|
|
23
|
+
this.tokens -= 1;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const waitMs = ((1 - this.tokens) / this.refillRate) * 1000;
|
|
27
|
+
await new Promise((resolve) => setTimeout(resolve, Math.ceil(waitMs)));
|
|
28
|
+
this.refill();
|
|
29
|
+
this.tokens -= 1;
|
|
30
|
+
}
|
|
31
|
+
/** Tries to consume a token without waiting. Returns false if none available. */
|
|
32
|
+
tryAcquire() {
|
|
33
|
+
this.refill();
|
|
34
|
+
if (this.tokens >= 1) {
|
|
35
|
+
this.tokens -= 1;
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
refill() {
|
|
41
|
+
const now = Date.now();
|
|
42
|
+
const elapsed = (now - this.lastRefill) / 1000;
|
|
43
|
+
this.tokens = Math.min(this.maxTokens, this.tokens + elapsed * this.refillRate);
|
|
44
|
+
this.lastRefill = now;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=rate-limiter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate-limiter.js","sourceRoot":"","sources":["../../src/utils/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AAG,CAAC,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CACpB,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,UAAU,CACxC,CAAC;QACF,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface RetryOptions {
|
|
2
|
+
/** Maximum number of attempts (default: 3) */
|
|
3
|
+
maxAttempts?: number;
|
|
4
|
+
/** Base delay in ms (default: 1000) */
|
|
5
|
+
baseDelay?: number;
|
|
6
|
+
/** Maximum delay in ms (default: 30000) */
|
|
7
|
+
maxDelay?: number;
|
|
8
|
+
/** Whether to add jitter (default: true) */
|
|
9
|
+
jitter?: boolean;
|
|
10
|
+
/** Optional predicate to determine if the error is retryable */
|
|
11
|
+
isRetryable?: (error: unknown) => boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Executes a function with retry logic using exponential backoff.
|
|
15
|
+
*/
|
|
16
|
+
export declare function withRetry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
|
|
17
|
+
/**
|
|
18
|
+
* Parse an HTTP `Retry-After` header value into seconds.
|
|
19
|
+
*
|
|
20
|
+
* RFC 7231 allows both a delta-seconds integer ("120") and an HTTP-date
|
|
21
|
+
* ("Fri, 31 Dec 2026 23:59:59 GMT"). The growth-agent JS collectors only
|
|
22
|
+
* handled the former; here we handle both and fall back to the caller's
|
|
23
|
+
* default on anything unparseable or negative.
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseRetryAfter(header: string | null | undefined, fallbackSeconds?: number): number;
|
|
26
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gEAAgE;IAChE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CAC3C;AAUD;;GAEG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAC/B,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,CAAC,CAAC,CAyBZ;AAoBD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,eAAe,SAAK,GACnB,MAAM,CAcR"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const DEFAULT_OPTIONS = {
|
|
2
|
+
maxAttempts: 3,
|
|
3
|
+
baseDelay: 1000,
|
|
4
|
+
maxDelay: 30_000,
|
|
5
|
+
jitter: true,
|
|
6
|
+
isRetryable: () => true,
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Executes a function with retry logic using exponential backoff.
|
|
10
|
+
*/
|
|
11
|
+
export async function withRetry(fn, options) {
|
|
12
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
13
|
+
let lastError;
|
|
14
|
+
for (let attempt = 1; attempt <= opts.maxAttempts; attempt++) {
|
|
15
|
+
try {
|
|
16
|
+
return await fn();
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
lastError = error;
|
|
20
|
+
if (attempt >= opts.maxAttempts || !opts.isRetryable(error)) {
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
const delay = calculateDelay(attempt, opts.baseDelay, opts.maxDelay, opts.jitter);
|
|
24
|
+
await sleep(delay);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
throw lastError;
|
|
28
|
+
}
|
|
29
|
+
function calculateDelay(attempt, baseDelay, maxDelay, jitter) {
|
|
30
|
+
let delay = baseDelay * Math.pow(2, attempt - 1);
|
|
31
|
+
delay = Math.min(delay, maxDelay);
|
|
32
|
+
if (jitter) {
|
|
33
|
+
delay = Math.random() * delay;
|
|
34
|
+
}
|
|
35
|
+
return delay;
|
|
36
|
+
}
|
|
37
|
+
function sleep(ms) {
|
|
38
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Parse an HTTP `Retry-After` header value into seconds.
|
|
42
|
+
*
|
|
43
|
+
* RFC 7231 allows both a delta-seconds integer ("120") and an HTTP-date
|
|
44
|
+
* ("Fri, 31 Dec 2026 23:59:59 GMT"). The growth-agent JS collectors only
|
|
45
|
+
* handled the former; here we handle both and fall back to the caller's
|
|
46
|
+
* default on anything unparseable or negative.
|
|
47
|
+
*/
|
|
48
|
+
export function parseRetryAfter(header, fallbackSeconds = 60) {
|
|
49
|
+
if (!header)
|
|
50
|
+
return fallbackSeconds;
|
|
51
|
+
const asSeconds = Number(header);
|
|
52
|
+
if (Number.isFinite(asSeconds)) {
|
|
53
|
+
return asSeconds >= 0 ? asSeconds : fallbackSeconds;
|
|
54
|
+
}
|
|
55
|
+
const asDateMs = Date.parse(header);
|
|
56
|
+
if (Number.isFinite(asDateMs)) {
|
|
57
|
+
return Math.max(0, Math.ceil((asDateMs - Date.now()) / 1000));
|
|
58
|
+
}
|
|
59
|
+
return fallbackSeconds;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAaA,MAAM,eAAe,GAA2B;IAC9C,WA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CAAC;IAChC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAiC,EACjC,eAAe,GAAG,EAAE;IAEpB,IAAI,CAAC,MAAM;QAAE,OAAO,eAAe,CAAC;IAEpC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACjC,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/B,OAAO,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC;IACtD,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
package/launchd/.gitkeep
ADDED
|
File without changes
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!--
|
|
3
|
+
launchd template for adaria-ai (reactive Slack daemon).
|
|
4
|
+
|
|
5
|
+
Placeholders are substituted by `src/cli/start.ts` at install time:
|
|
6
|
+
__NODE_BIN__ — absolute path to the Node binary running adaria-ai
|
|
7
|
+
__SCRIPT_PATH__ — absolute path to adaria-ai's dist/index.js entry
|
|
8
|
+
__ADARIA_HOME__ — $ADARIA_HOME (defaults to ~/.adaria)
|
|
9
|
+
__LOG_DIR__ — $ADARIA_HOME/logs
|
|
10
|
+
__PATH__ — value to use as $PATH (launchd's default is near-empty)
|
|
11
|
+
|
|
12
|
+
Do NOT edit the installed plist directly — re-run `adaria-ai start`.
|
|
13
|
+
-->
|
|
14
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
15
|
+
<plist version="1.0">
|
|
16
|
+
<dict>
|
|
17
|
+
<key>Label</key>
|
|
18
|
+
<string>com.adaria-ai.daemon</string>
|
|
19
|
+
|
|
20
|
+
<key>ProgramArguments</key>
|
|
21
|
+
<array>
|
|
22
|
+
<string>__NODE_BIN__</string>
|
|
23
|
+
<string>__SCRIPT_PATH__</string>
|
|
24
|
+
<string>daemon</string>
|
|
25
|
+
</array>
|
|
26
|
+
|
|
27
|
+
<key>EnvironmentVariables</key>
|
|
28
|
+
<dict>
|
|
29
|
+
<key>PATH</key>
|
|
30
|
+
<string>__PATH__</string>
|
|
31
|
+
<key>ADARIA_HOME</key>
|
|
32
|
+
<string>__ADARIA_HOME__</string>
|
|
33
|
+
</dict>
|
|
34
|
+
|
|
35
|
+
<key>RunAtLoad</key>
|
|
36
|
+
<true/>
|
|
37
|
+
|
|
38
|
+
<!--
|
|
39
|
+
Respawn only on actual crashes, not on clean exit. When
|
|
40
|
+
`src/cli/daemon.ts` can't load config, it logs the reason and
|
|
41
|
+
exits(0) — `SuccessfulExit=false` keeps launchd from restarting
|
|
42
|
+
the daemon in that case, avoiding a 30-second respawn loop that
|
|
43
|
+
would spam ~/.adaria/logs/daemon.err.log (M1 CLI review HIGH #1).
|
|
44
|
+
-->
|
|
45
|
+
<key>KeepAlive</key>
|
|
46
|
+
<dict>
|
|
47
|
+
<key>SuccessfulExit</key>
|
|
48
|
+
<false/>
|
|
49
|
+
<key>Crashed</key>
|
|
50
|
+
<true/>
|
|
51
|
+
</dict>
|
|
52
|
+
|
|
53
|
+
<key>StandardOutPath</key>
|
|
54
|
+
<string>__LOG_DIR__/daemon.out.log</string>
|
|
55
|
+
|
|
56
|
+
<key>StandardErrorPath</key>
|
|
57
|
+
<string>__LOG_DIR__/daemon.err.log</string>
|
|
58
|
+
|
|
59
|
+
<key>ThrottleInterval</key>
|
|
60
|
+
<integer>30</integer>
|
|
61
|
+
</dict>
|
|
62
|
+
</plist>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>Label</key>
|
|
6
|
+
<string>com.adaria-ai.monitor</string>
|
|
7
|
+
|
|
8
|
+
<key>ProgramArguments</key>
|
|
9
|
+
<array>
|
|
10
|
+
<string>__NODE_BIN__</string>
|
|
11
|
+
<string>__SCRIPT_PATH__</string>
|
|
12
|
+
<string>monitor</string>
|
|
13
|
+
</array>
|
|
14
|
+
|
|
15
|
+
<key>EnvironmentVariables</key>
|
|
16
|
+
<dict>
|
|
17
|
+
<key>ADARIA_HOME</key>
|
|
18
|
+
<string>__ADARIA_HOME__</string>
|
|
19
|
+
<key>PATH</key>
|
|
20
|
+
<string>__PATH__</string>
|
|
21
|
+
</dict>
|
|
22
|
+
|
|
23
|
+
<!-- Daily 23:00 UTC -->
|
|
24
|
+
<key>StartCalendarInterval</key>
|
|
25
|
+
<dict>
|
|
26
|
+
<key>Hour</key>
|
|
27
|
+
<integer>23</integer>
|
|
28
|
+
<key>Minute</key>
|
|
29
|
+
<integer>0</integer>
|
|
30
|
+
</dict>
|
|
31
|
+
|
|
32
|
+
<key>StandardOutPath</key>
|
|
33
|
+
<string>__LOG_DIR__/monitor.out.log</string>
|
|
34
|
+
<key>StandardErrorPath</key>
|
|
35
|
+
<string>__LOG_DIR__/monitor.err.log</string>
|
|
36
|
+
|
|
37
|
+
<!-- One-shot: do NOT restart on exit. -->
|
|
38
|
+
<key>KeepAlive</key>
|
|
39
|
+
<false/>
|
|
40
|
+
</dict>
|
|
41
|
+
</plist>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>Label</key>
|
|
6
|
+
<string>com.adaria-ai.weekly</string>
|
|
7
|
+
|
|
8
|
+
<key>ProgramArguments</key>
|
|
9
|
+
<array>
|
|
10
|
+
<string>__NODE_BIN__</string>
|
|
11
|
+
<string>__SCRIPT_PATH__</string>
|
|
12
|
+
<string>analyze</string>
|
|
13
|
+
</array>
|
|
14
|
+
|
|
15
|
+
<key>EnvironmentVariables</key>
|
|
16
|
+
<dict>
|
|
17
|
+
<key>ADARIA_HOME</key>
|
|
18
|
+
<string>__ADARIA_HOME__</string>
|
|
19
|
+
<key>PATH</key>
|
|
20
|
+
<string>__PATH__</string>
|
|
21
|
+
</dict>
|
|
22
|
+
|
|
23
|
+
<!-- Sunday 23:00 UTC -->
|
|
24
|
+
<key>StartCalendarInterval</key>
|
|
25
|
+
<dict>
|
|
26
|
+
<key>Weekday</key>
|
|
27
|
+
<integer>0</integer>
|
|
28
|
+
<key>Hour</key>
|
|
29
|
+
<integer>23</integer>
|
|
30
|
+
<key>Minute</key>
|
|
31
|
+
<integer>0</integer>
|
|
32
|
+
</dict>
|
|
33
|
+
|
|
34
|
+
<key>StandardOutPath</key>
|
|
35
|
+
<string>__LOG_DIR__/weekly.out.log</string>
|
|
36
|
+
<key>StandardErrorPath</key>
|
|
37
|
+
<string>__LOG_DIR__/weekly.err.log</string>
|
|
38
|
+
|
|
39
|
+
<!-- One-shot: do NOT restart on exit. -->
|
|
40
|
+
<key>KeepAlive</key>
|
|
41
|
+
<false/>
|
|
42
|
+
</dict>
|
|
43
|
+
</plist>
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "adaria-ai",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Single-user marketing operations agent for the Adaria.ai app portfolio, running as a macOS launchd daemon with Slack interface",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"adaria-ai": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/",
|
|
11
|
+
"prompts/",
|
|
12
|
+
"launchd/",
|
|
13
|
+
"apps.example.yaml",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=20"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.build.json",
|
|
22
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
23
|
+
"typecheck": "tsc --noEmit",
|
|
24
|
+
"lint": "eslint src/ tests/ scripts/",
|
|
25
|
+
"test": "vitest run --passWithNoTests",
|
|
26
|
+
"test:watch": "vitest",
|
|
27
|
+
"smoke:collectors": "tsx scripts/smoke-collectors.ts",
|
|
28
|
+
"smoke:collectors:dev": "ADARIA_HOME=$HOME/.adaria-dev tsx scripts/smoke-collectors.ts",
|
|
29
|
+
"smoke:social": "ADARIA_DRY_RUN=1 tsx scripts/smoke-social.ts",
|
|
30
|
+
"smoke:social:dev": "ADARIA_HOME=$HOME/.adaria-dev ADARIA_DRY_RUN=1 tsx scripts/smoke-social.ts",
|
|
31
|
+
"snapshot:briefing": "ADARIA_DRY_RUN=1 tsx scripts/snapshot-briefing.ts",
|
|
32
|
+
"snapshot:briefing:dev": "ADARIA_HOME=$HOME/.adaria-dev ADARIA_DRY_RUN=1 tsx scripts/snapshot-briefing.ts",
|
|
33
|
+
"init:dev": "ADARIA_HOME=$HOME/.adaria-dev tsx src/index.ts init",
|
|
34
|
+
"check:tarball-secrets": "tsx scripts/check-tarball-secrets.ts",
|
|
35
|
+
"prepublishOnly": "npm run build && npm run lint && npm test && npm run check:tarball-secrets"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"marketing",
|
|
39
|
+
"aso",
|
|
40
|
+
"slack",
|
|
41
|
+
"claude",
|
|
42
|
+
"agent",
|
|
43
|
+
"macos"
|
|
44
|
+
],
|
|
45
|
+
"author": "Woojin Ahn",
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "https://github.com/ahnwoojin/adaria-ai.git"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@eslint/js": "^9.39.4",
|
|
53
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
54
|
+
"@types/inquirer": "^9.0.9",
|
|
55
|
+
"@types/js-yaml": "^4.0.9",
|
|
56
|
+
"@types/node": "^25.6.0",
|
|
57
|
+
"eslint": "^9.39.4",
|
|
58
|
+
"tsx": "^4.21.0",
|
|
59
|
+
"typescript": "^6.0.2",
|
|
60
|
+
"typescript-eslint": "^8.58.1",
|
|
61
|
+
"vitest": "^3.2.4"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"@slack/bolt": "^4.7.0",
|
|
65
|
+
"better-sqlite3": "^12.8.0",
|
|
66
|
+
"commander": "^14.0.3",
|
|
67
|
+
"inquirer": "^13.4.1",
|
|
68
|
+
"jose": "^6.2.2",
|
|
69
|
+
"js-yaml": "^4.1.1",
|
|
70
|
+
"zod": "^4.3.6"
|
|
71
|
+
}
|
|
72
|
+
}
|