dot-agents 0.4.0 → 0.5.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/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +26 -0
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/show.js +9 -2
- package/dist/cli/commands/show.js.map +1 -1
- package/dist/cli/index.js +2 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/lib/runner.d.ts +2 -0
- package/dist/cli/lib/runner.d.ts.map +1 -1
- package/dist/cli/lib/runner.js +54 -17
- package/dist/cli/lib/runner.js.map +1 -1
- package/dist/daemon/api/server.d.ts.map +1 -1
- package/dist/daemon/api/server.js +4 -2
- package/dist/daemon/api/server.js.map +1 -1
- package/dist/daemon/daemon.d.ts +2 -0
- package/dist/daemon/daemon.d.ts.map +1 -1
- package/dist/daemon/daemon.js +121 -16
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/lib/executor.d.ts +24 -1
- package/dist/daemon/lib/executor.d.ts.map +1 -1
- package/dist/daemon/lib/executor.js +126 -2
- package/dist/daemon/lib/executor.js.map +1 -1
- package/dist/daemon/lib/watcher.d.ts +14 -2
- package/dist/daemon/lib/watcher.d.ts.map +1 -1
- package/dist/daemon/lib/watcher.js +43 -3
- package/dist/daemon/lib/watcher.js.map +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/persona.d.ts +25 -1
- package/dist/lib/persona.d.ts.map +1 -1
- package/dist/lib/persona.js +118 -17
- package/dist/lib/persona.js.map +1 -1
- package/dist/lib/types/persona.d.ts +38 -4
- package/dist/lib/types/persona.d.ts.map +1 -1
- package/dist/lib/types/triggers.d.ts +11 -0
- package/dist/lib/types/triggers.d.ts.map +1 -1
- package/dist/lib/version.d.ts +26 -0
- package/dist/lib/version.d.ts.map +1 -0
- package/dist/lib/version.js +61 -0
- package/dist/lib/version.js.map +1 -0
- package/internal/personas/_base/PERSONA.md +68 -0
- package/internal/skills/channels/publish/SKILL.md +129 -0
- package/internal/skills/channels/read/SKILL.md +124 -0
- package/internal/skills/channels/reply/SKILL.md +138 -0
- package/package.json +2 -1
package/dist/lib/persona.js
CHANGED
|
@@ -1,7 +1,93 @@
|
|
|
1
1
|
import { readdir, stat } from "node:fs/promises";
|
|
2
2
|
import { join, dirname, relative } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
3
4
|
import { loadMarkdownFile } from "./frontmatter.js";
|
|
4
5
|
const PERSONA_FILENAME = "PERSONA.md";
|
|
6
|
+
/**
|
|
7
|
+
* Get the path to internal personas bundled with the package.
|
|
8
|
+
* Resolves relative to this module's location.
|
|
9
|
+
*/
|
|
10
|
+
export function getInternalPersonasPath() {
|
|
11
|
+
const currentFile = fileURLToPath(import.meta.url);
|
|
12
|
+
const libDir = dirname(currentFile);
|
|
13
|
+
// From dist/lib or src/lib -> root -> internal/personas
|
|
14
|
+
const packageRoot = dirname(dirname(libDir));
|
|
15
|
+
return join(packageRoot, "internal", "personas");
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get the path to the internal _base persona
|
|
19
|
+
*/
|
|
20
|
+
export function getInternalBasePath() {
|
|
21
|
+
return join(getInternalPersonasPath(), "_base");
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get the path to internal skills bundled with the package.
|
|
25
|
+
* Resolves relative to this module's location.
|
|
26
|
+
*/
|
|
27
|
+
export function getInternalSkillsPath() {
|
|
28
|
+
const currentFile = fileURLToPath(import.meta.url);
|
|
29
|
+
const libDir = dirname(currentFile);
|
|
30
|
+
// From dist/lib or src/lib -> root -> internal/skills
|
|
31
|
+
const packageRoot = dirname(dirname(libDir));
|
|
32
|
+
return join(packageRoot, "internal", "skills");
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Normalize a CommandSpec to string array
|
|
36
|
+
*/
|
|
37
|
+
function normalizeCommandSpec(cmd) {
|
|
38
|
+
if (cmd === undefined)
|
|
39
|
+
return undefined;
|
|
40
|
+
if (typeof cmd === "string")
|
|
41
|
+
return [cmd];
|
|
42
|
+
return cmd;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Check if cmd is in object/modes format (vs legacy array format)
|
|
46
|
+
*/
|
|
47
|
+
function isCommandModes(cmd) {
|
|
48
|
+
return (cmd !== undefined &&
|
|
49
|
+
typeof cmd === "object" &&
|
|
50
|
+
!Array.isArray(cmd));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Resolve cmd field to ResolvedCommands structure
|
|
54
|
+
*/
|
|
55
|
+
export function resolveCommands(cmd) {
|
|
56
|
+
if (!cmd) {
|
|
57
|
+
throw new Error("Persona must specify cmd");
|
|
58
|
+
}
|
|
59
|
+
if (isCommandModes(cmd)) {
|
|
60
|
+
// Object format: { headless, interactive }
|
|
61
|
+
const headless = normalizeCommandSpec(cmd.headless);
|
|
62
|
+
const interactive = normalizeCommandSpec(cmd.interactive);
|
|
63
|
+
if (!headless && !interactive) {
|
|
64
|
+
throw new Error("Persona cmd must specify at least headless or interactive");
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
headless: headless ?? interactive,
|
|
68
|
+
interactive,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
// Legacy format: array/string = headless only
|
|
72
|
+
const headless = normalizeCommandSpec(cmd);
|
|
73
|
+
return {
|
|
74
|
+
headless: headless,
|
|
75
|
+
interactive: undefined,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Check if a directory contains a PERSONA.md file
|
|
80
|
+
*/
|
|
81
|
+
async function hasPersonaFile(dirPath) {
|
|
82
|
+
try {
|
|
83
|
+
const filePath = join(dirPath, PERSONA_FILENAME);
|
|
84
|
+
const stats = await stat(filePath);
|
|
85
|
+
return stats.isFile();
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
5
91
|
/**
|
|
6
92
|
* Load a single persona file
|
|
7
93
|
*/
|
|
@@ -20,6 +106,18 @@ export async function loadPersona(personaPath) {
|
|
|
20
106
|
prompt: body || undefined,
|
|
21
107
|
};
|
|
22
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Load the internal _base persona if it exists
|
|
111
|
+
* Returns null if not found (graceful degradation)
|
|
112
|
+
*/
|
|
113
|
+
export async function loadInternalBase() {
|
|
114
|
+
const basePath = getInternalBasePath();
|
|
115
|
+
if (await hasPersonaFile(basePath)) {
|
|
116
|
+
const persona = await loadPersona(basePath);
|
|
117
|
+
return { ...persona, internal: true };
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
23
121
|
/**
|
|
24
122
|
* Build the inheritance chain for a persona path
|
|
25
123
|
* Returns paths from root to leaf (e.g., ["claude", "claude/autonomous"])
|
|
@@ -35,19 +133,6 @@ export function buildInheritanceChain(personaPath, personasRoot) {
|
|
|
35
133
|
}
|
|
36
134
|
return chain;
|
|
37
135
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Check if a directory contains a PERSONA.md file
|
|
40
|
-
*/
|
|
41
|
-
async function hasPersonaFile(dirPath) {
|
|
42
|
-
try {
|
|
43
|
-
const filePath = join(dirPath, PERSONA_FILENAME);
|
|
44
|
-
const stats = await stat(filePath);
|
|
45
|
-
return stats.isFile();
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
136
|
/**
|
|
52
137
|
* Merge arrays with gitignore-style negation support
|
|
53
138
|
* Items prefixed with ! remove matching items from the array
|
|
@@ -116,6 +201,7 @@ export function mergePersonas(parent, child) {
|
|
|
116
201
|
}
|
|
117
202
|
/**
|
|
118
203
|
* Resolve a persona with full inheritance chain
|
|
204
|
+
* Includes implicit inheritance from internal _base persona unless extends: "none"
|
|
119
205
|
*/
|
|
120
206
|
export async function resolvePersona(personaPath, personasRoot) {
|
|
121
207
|
const chain = buildInheritanceChain(personaPath, personasRoot);
|
|
@@ -136,15 +222,30 @@ export async function resolvePersona(personaPath, personasRoot) {
|
|
|
136
222
|
if (resolved === null) {
|
|
137
223
|
throw new Error(`No persona found at path: ${personaPath}`);
|
|
138
224
|
}
|
|
139
|
-
//
|
|
140
|
-
|
|
225
|
+
// Check if persona opts out of internal base inheritance
|
|
226
|
+
// The root persona in the chain determines inheritance behavior
|
|
227
|
+
const rootPersona = await loadPersona(inheritanceChain[0]);
|
|
228
|
+
const shouldInheritBase = rootPersona.extends !== "none";
|
|
229
|
+
// Load and merge internal _base persona (prepend its prompt)
|
|
230
|
+
let finalPrompt = resolved.prompt;
|
|
231
|
+
if (shouldInheritBase) {
|
|
232
|
+
const base = await loadInternalBase();
|
|
233
|
+
if (base?.prompt) {
|
|
234
|
+
// Prepend base prompt with separator
|
|
235
|
+
finalPrompt = base.prompt + (finalPrompt ? "\n\n---\n\n" + finalPrompt : "");
|
|
236
|
+
// Add base to the start of inheritance chain
|
|
237
|
+
inheritanceChain.unshift(base.path);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
// Resolve commands to normalized structure
|
|
241
|
+
const commands = resolveCommands(resolved.cmd);
|
|
141
242
|
return {
|
|
142
243
|
name: resolved.name,
|
|
143
244
|
description: resolved.description,
|
|
144
|
-
|
|
245
|
+
commands,
|
|
145
246
|
env: resolved.env ?? {},
|
|
146
247
|
skills: resolved.skills ?? [],
|
|
147
|
-
prompt:
|
|
248
|
+
prompt: finalPrompt,
|
|
148
249
|
path: resolved.path,
|
|
149
250
|
inheritanceChain,
|
|
150
251
|
};
|
package/dist/lib/persona.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persona.js","sourceRoot":"","sources":["../../src/lib/persona.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,E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,CAAC;IACH,CAAC;IAED,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;IAC5B,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command specification - single command or array of fallbacks
|
|
3
|
+
*/
|
|
4
|
+
export type CommandSpec = string | string[];
|
|
5
|
+
/**
|
|
6
|
+
* Command modes for headless vs interactive execution
|
|
7
|
+
*/
|
|
8
|
+
export interface CommandModes {
|
|
9
|
+
/** Command for scheduled/automated execution (no human present) */
|
|
10
|
+
headless?: CommandSpec;
|
|
11
|
+
/** Command for manual/attended execution (human can interact) */
|
|
12
|
+
interactive?: CommandSpec;
|
|
13
|
+
}
|
|
1
14
|
/**
|
|
2
15
|
* Persona configuration - defines how to invoke an agent
|
|
3
16
|
*/
|
|
@@ -6,12 +19,22 @@ export interface PersonaFrontmatter {
|
|
|
6
19
|
name: string;
|
|
7
20
|
/** Human-readable description */
|
|
8
21
|
description?: string;
|
|
9
|
-
/**
|
|
10
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Agent invocation command(s)
|
|
24
|
+
* - Array/string: legacy format, used for headless execution only
|
|
25
|
+
* - Object: { headless, interactive } for mode-specific commands
|
|
26
|
+
*/
|
|
27
|
+
cmd?: CommandSpec | CommandModes;
|
|
11
28
|
/** Environment variables (supports ${VAR} expansion) */
|
|
12
29
|
env?: Record<string, string>;
|
|
13
30
|
/** Enabled skills - glob patterns, use ! for negation */
|
|
14
31
|
skills?: string[];
|
|
32
|
+
/**
|
|
33
|
+
* Control inheritance from internal _base persona
|
|
34
|
+
* - undefined: implicit inheritance from _base (default)
|
|
35
|
+
* - "none": opt out of _base inheritance
|
|
36
|
+
*/
|
|
37
|
+
extends?: "none";
|
|
15
38
|
}
|
|
16
39
|
/**
|
|
17
40
|
* Parsed persona including frontmatter and body content
|
|
@@ -23,6 +46,17 @@ export interface Persona extends PersonaFrontmatter {
|
|
|
23
46
|
prompt?: string;
|
|
24
47
|
/** Parent persona path if this is a child (for tracking) */
|
|
25
48
|
parent?: string;
|
|
49
|
+
/** Whether this is an internal (bundled) persona */
|
|
50
|
+
internal?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Resolved commands for each execution mode
|
|
54
|
+
*/
|
|
55
|
+
export interface ResolvedCommands {
|
|
56
|
+
/** Command for headless/scheduled execution */
|
|
57
|
+
headless: string[];
|
|
58
|
+
/** Command for interactive/manual execution (undefined = not supported) */
|
|
59
|
+
interactive?: string[];
|
|
26
60
|
}
|
|
27
61
|
/**
|
|
28
62
|
* Resolved persona with all inheritance applied and arrays merged
|
|
@@ -30,8 +64,8 @@ export interface Persona extends PersonaFrontmatter {
|
|
|
30
64
|
export interface ResolvedPersona {
|
|
31
65
|
name: string;
|
|
32
66
|
description?: string;
|
|
33
|
-
/** Resolved
|
|
34
|
-
|
|
67
|
+
/** Resolved commands for each mode */
|
|
68
|
+
commands: ResolvedCommands;
|
|
35
69
|
/** Merged environment variables */
|
|
36
70
|
env: Record<string, string>;
|
|
37
71
|
/** Merged and filtered skills (negations applied) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persona.d.ts","sourceRoot":"","sources":["../../../src/lib/types/persona.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB
|
|
1
|
+
{"version":3,"file":"persona.d.ts","sourceRoot":"","sources":["../../../src/lib/types/persona.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,iEAAiE;IACjE,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B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"}
|
|
@@ -74,6 +74,15 @@ export interface GitHubTrigger {
|
|
|
74
74
|
labels?: string[];
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Channel message trigger - run workflow when message posted to a channel
|
|
79
|
+
*/
|
|
80
|
+
export interface ChannelTrigger {
|
|
81
|
+
/** Channel name to watch (e.g., "#issues", "#requests") */
|
|
82
|
+
channel: string;
|
|
83
|
+
/** Optional input overrides for channel-triggered runs */
|
|
84
|
+
inputs?: TriggerInputOverride;
|
|
85
|
+
}
|
|
77
86
|
/**
|
|
78
87
|
* All workflow triggers
|
|
79
88
|
*/
|
|
@@ -92,5 +101,7 @@ export interface WorkflowTriggers {
|
|
|
92
101
|
git?: GitTrigger;
|
|
93
102
|
/** GitHub event trigger */
|
|
94
103
|
github?: GitHubTrigger;
|
|
104
|
+
/** Channel message trigger */
|
|
105
|
+
channel?: ChannelTrigger;
|
|
95
106
|
}
|
|
96
107
|
//# sourceMappingURL=triggers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../src/lib/types/triggers.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CACb,MAAM,EACN;QACE,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;QACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CACF,CAAC;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,CAAC;CAC1B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package information from package.json
|
|
3
|
+
*/
|
|
4
|
+
export interface PackageInfo {
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Get package information synchronously (for CLI startup)
|
|
10
|
+
* Caches the result after first read
|
|
11
|
+
*/
|
|
12
|
+
export declare function getPackageInfoSync(): PackageInfo;
|
|
13
|
+
/**
|
|
14
|
+
* Get package information (name and version)
|
|
15
|
+
* Caches the result after first read
|
|
16
|
+
*/
|
|
17
|
+
export declare function getPackageInfo(): Promise<PackageInfo>;
|
|
18
|
+
/**
|
|
19
|
+
* Get the package version synchronously
|
|
20
|
+
*/
|
|
21
|
+
export declare function getVersionSync(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get the package version
|
|
24
|
+
*/
|
|
25
|
+
export declare function getVersion(): Promise<string>;
|
|
26
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/lib/version.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAeD;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,WAAW,CAahD;AAED;;;GAGG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAa3D;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;GAEG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAGlD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
let cachedInfo = null;
|
|
6
|
+
/**
|
|
7
|
+
* Get the path to the package.json
|
|
8
|
+
*/
|
|
9
|
+
function getPackageJsonPath() {
|
|
10
|
+
const currentFile = fileURLToPath(import.meta.url);
|
|
11
|
+
const libDir = dirname(currentFile);
|
|
12
|
+
// From dist/lib or src/lib -> root
|
|
13
|
+
const packageRoot = dirname(dirname(libDir));
|
|
14
|
+
return join(packageRoot, "package.json");
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get package information synchronously (for CLI startup)
|
|
18
|
+
* Caches the result after first read
|
|
19
|
+
*/
|
|
20
|
+
export function getPackageInfoSync() {
|
|
21
|
+
if (cachedInfo)
|
|
22
|
+
return cachedInfo;
|
|
23
|
+
const packagePath = getPackageJsonPath();
|
|
24
|
+
const content = readFileSync(packagePath, "utf-8");
|
|
25
|
+
const pkg = JSON.parse(content);
|
|
26
|
+
cachedInfo = {
|
|
27
|
+
name: pkg.name,
|
|
28
|
+
version: pkg.version,
|
|
29
|
+
};
|
|
30
|
+
return cachedInfo;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get package information (name and version)
|
|
34
|
+
* Caches the result after first read
|
|
35
|
+
*/
|
|
36
|
+
export async function getPackageInfo() {
|
|
37
|
+
if (cachedInfo)
|
|
38
|
+
return cachedInfo;
|
|
39
|
+
const packagePath = getPackageJsonPath();
|
|
40
|
+
const content = await readFile(packagePath, "utf-8");
|
|
41
|
+
const pkg = JSON.parse(content);
|
|
42
|
+
cachedInfo = {
|
|
43
|
+
name: pkg.name,
|
|
44
|
+
version: pkg.version,
|
|
45
|
+
};
|
|
46
|
+
return cachedInfo;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get the package version synchronously
|
|
50
|
+
*/
|
|
51
|
+
export function getVersionSync() {
|
|
52
|
+
return getPackageInfoSync().version;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get the package version
|
|
56
|
+
*/
|
|
57
|
+
export async function getVersion() {
|
|
58
|
+
const info = await getPackageInfo();
|
|
59
|
+
return info.version;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/lib/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAUzC,IAAI,UAAU,GAAuB,IAAI,CAAC;AAE1C;;GAEG;AACH,SAAS,kBAAkB;IACzB,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACpC,mCAAmC;IACnC,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,OAAO,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;AAC3C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,UAAU;QAAE,OAAO,UAAU,CAAC;IAElC,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAC;IACzC,MAAM,OAAO,GAAG,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACnD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAsC,CAAC;IAErE,UAAU,GAAG;QACX,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,OAAO,EAAE,GAAG,CAAC,OAAO;KACrB,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,IAAI,UAAU;QAAE,OAAO,UAAU,CAAC;IAElC,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAC;IACzC,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACrD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAsC,CAAC;IAErE,UAAU,GAAG;QACX,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,OAAO,EAAE,GAAG,CAAC,OAAO;KACrB,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,kBAAkB,EAAE,CAAC,OAAO,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,IAAI,GAAG,MAAM,cAAc,EAAE,CAAC;IACpC,OAAO,IAAI,CAAC,OAAO,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: _base
|
|
3
|
+
description: System foundation inherited by all personas
|
|
4
|
+
skills:
|
|
5
|
+
- channels/publish
|
|
6
|
+
- channels/read
|
|
7
|
+
- channels/reply
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## System Communication Channels
|
|
11
|
+
|
|
12
|
+
You operate within a system that uses channels for coordination. Use these channels appropriately throughout your work.
|
|
13
|
+
|
|
14
|
+
For detailed usage, see the internal channel skills: `channels/publish`, `channels/read`, `channels/reply`.
|
|
15
|
+
|
|
16
|
+
### Channel Reference
|
|
17
|
+
|
|
18
|
+
| Channel | When to Use |
|
|
19
|
+
| ----------- | -------------------------------------------------------- |
|
|
20
|
+
| `#issues` | When you encounter errors or blockers you cannot resolve |
|
|
21
|
+
| `#journals` | Daily logs (posted by review workflows, not directly) |
|
|
22
|
+
| `@human` | When human action is required to proceed |
|
|
23
|
+
|
|
24
|
+
### Session Logging
|
|
25
|
+
|
|
26
|
+
Session output is captured to `.agents/logs/` by the daemon or runner. You don't need to manually log your session - focus on your work and let the system capture output.
|
|
27
|
+
|
|
28
|
+
Logs are processed later by review workflows to generate `#journals` entries.
|
|
29
|
+
|
|
30
|
+
### On Error/Block (When Applicable)
|
|
31
|
+
|
|
32
|
+
When you encounter an issue you cannot resolve:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx dot-agents channels publish "#issues" "$(cat <<'EOF'
|
|
36
|
+
**Issue:** <Short title>
|
|
37
|
+
**Impact:** <What's affected>
|
|
38
|
+
**Context:** <Why this happened>
|
|
39
|
+
|
|
40
|
+
**To Fix:**
|
|
41
|
+
1. <Step-by-step instructions>
|
|
42
|
+
2. <Be specific about paths, commands>
|
|
43
|
+
|
|
44
|
+
**Blocked:** yes|no
|
|
45
|
+
EOF
|
|
46
|
+
)"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Human Escalation (Sparingly)
|
|
50
|
+
|
|
51
|
+
Only when YOU cannot proceed and human action is required:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx dot-agents channels publish "@human" "<What you need from the human>"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Do NOT escalate for:
|
|
58
|
+
|
|
59
|
+
- Issues you can work around
|
|
60
|
+
- Information you can find yourself
|
|
61
|
+
- Decisions within your authority
|
|
62
|
+
|
|
63
|
+
DO escalate for:
|
|
64
|
+
|
|
65
|
+
- GUI interactions required (macOS permissions, etc.)
|
|
66
|
+
- Missing credentials or access
|
|
67
|
+
- Ambiguous requirements needing clarification
|
|
68
|
+
- Destructive operations needing confirmation
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: channels/publish
|
|
3
|
+
description: Publish a message to a channel or DM. Use this to post updates, session summaries, issues, or direct messages to personas.
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Publish to Channel
|
|
8
|
+
|
|
9
|
+
Post a message to a public channel (`#channel-name`) or direct message a persona (`@persona-name`).
|
|
10
|
+
|
|
11
|
+
## When to Use This Skill
|
|
12
|
+
|
|
13
|
+
Use this skill when:
|
|
14
|
+
|
|
15
|
+
- Posting a session summary to `#sessions`
|
|
16
|
+
- Reporting an issue or blocker to `#issues`
|
|
17
|
+
- Sending a direct message to another persona
|
|
18
|
+
- Escalating to `@human` for human intervention
|
|
19
|
+
- Broadcasting status updates or notifications
|
|
20
|
+
|
|
21
|
+
## Process
|
|
22
|
+
|
|
23
|
+
### Step 1: Determine Channel
|
|
24
|
+
|
|
25
|
+
Choose the appropriate channel:
|
|
26
|
+
|
|
27
|
+
| Channel | Purpose |
|
|
28
|
+
| --------------- | ---------------------------------------- |
|
|
29
|
+
| `#sessions` | Session summaries and completion reports |
|
|
30
|
+
| `#issues` | Errors, blockers, and problems |
|
|
31
|
+
| `@human` | Human escalation (use sparingly) |
|
|
32
|
+
| `@persona-name` | Direct message to another persona |
|
|
33
|
+
| `#custom` | Any custom channel you've created |
|
|
34
|
+
|
|
35
|
+
### Step 2: Compose Message
|
|
36
|
+
|
|
37
|
+
Format your message appropriately for the channel type.
|
|
38
|
+
|
|
39
|
+
### Step 3: Publish
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx dot-agents channels publish "<channel>" "<message>"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
For multi-line messages, use a heredoc:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx dot-agents channels publish "<channel>" "$(cat <<'EOF'
|
|
49
|
+
Your multi-line
|
|
50
|
+
message here
|
|
51
|
+
EOF
|
|
52
|
+
)"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Optional flags:
|
|
56
|
+
|
|
57
|
+
- `--from <name>` - Set the sender name (defaults to current persona)
|
|
58
|
+
- `--tags <tag1,tag2>` - Add tags to the message
|
|
59
|
+
|
|
60
|
+
## Examples
|
|
61
|
+
|
|
62
|
+
### Example 1: Session Summary
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npx dot-agents channels publish "#sessions" "$(cat <<'EOF'
|
|
66
|
+
**Workflow:** morning-paper
|
|
67
|
+
**Status:** success
|
|
68
|
+
**Duration:** 2m 30s
|
|
69
|
+
|
|
70
|
+
Generated morning paper PDF with calendar events and weather.
|
|
71
|
+
Delivered to Boox device successfully.
|
|
72
|
+
EOF
|
|
73
|
+
)"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Example 2: Report an Issue
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npx dot-agents channels publish "#issues" "$(cat <<'EOF'
|
|
80
|
+
**Issue:** Calendar API returned empty response
|
|
81
|
+
**Impact:** Morning paper missing today's events
|
|
82
|
+
**Context:** Calendar skill executed but returned no events despite events existing
|
|
83
|
+
|
|
84
|
+
**To Fix:**
|
|
85
|
+
1. Check Calendar permissions in System Settings
|
|
86
|
+
2. Run `dot-agents workflow run test-osx-permissions`
|
|
87
|
+
|
|
88
|
+
**Blocked:** no
|
|
89
|
+
EOF
|
|
90
|
+
)"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Example 3: DM to Another Persona
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npx dot-agents channels publish "@channel-manager" "Please archive inactive channels older than 30 days"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Example 4: Human Escalation
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx dot-agents channels publish "@human" "$(cat <<'EOF'
|
|
103
|
+
Need macOS permission grant for Calendar access.
|
|
104
|
+
|
|
105
|
+
Please open System Settings > Privacy & Security > Calendars
|
|
106
|
+
and enable access for dot-agents.
|
|
107
|
+
EOF
|
|
108
|
+
)"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Example 5: Message with Tags
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npx dot-agents channels publish "#issues" "Build failed: missing dependency" --tags "urgent,build"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Best Practices
|
|
118
|
+
|
|
119
|
+
- Keep messages concise but complete
|
|
120
|
+
- Use structured formats for issues (title, impact, context, fix steps)
|
|
121
|
+
- Include relevant context (workflow name, duration, error messages)
|
|
122
|
+
- Use tags to categorize messages for filtering
|
|
123
|
+
- Reserve `@human` for genuine blockers requiring human action
|
|
124
|
+
|
|
125
|
+
## Error Handling
|
|
126
|
+
|
|
127
|
+
**Channel doesn't exist**: The channel will be created automatically on first publish.
|
|
128
|
+
|
|
129
|
+
**Permission denied**: Ensure you're running with appropriate permissions (`--permission-mode bypassPermissions`).
|