phaibel 4.0.7 → 4.0.21
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/README.md +229 -245
- package/dist/commands/chat.d.ts +5 -2
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +168 -172
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/cron.d.ts.map +1 -1
- package/dist/commands/cron.js +1 -0
- package/dist/commands/cron.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +54 -52
- package/dist/commands/init.js.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/entities/entity-summary.js +3 -3
- package/dist/entities/entity-type-config.d.ts +3 -0
- package/dist/entities/entity-type-config.d.ts.map +1 -1
- package/dist/entities/entity-type-config.js +67 -1
- package/dist/entities/entity-type-config.js.map +1 -1
- package/dist/entities/entity-types-defaults.d.ts.map +1 -1
- package/dist/entities/entity-types-defaults.js +2 -0
- package/dist/entities/entity-types-defaults.js.map +1 -1
- package/dist/entities/spawner.d.ts.map +1 -1
- package/dist/entities/spawner.js +4 -2
- package/dist/entities/spawner.js.map +1 -1
- package/dist/feral/catalog/entity-catalog-source.js +31 -31
- package/dist/feral/node-code/abstract-node-code.js +1 -1
- package/dist/feral/node-code/abstract-node-code.js.map +1 -1
- package/dist/feral/node-code/data/set-context-value-node-code.d.ts.map +1 -1
- package/dist/feral/node-code/data/set-context-value-node-code.js +10 -1
- package/dist/feral/node-code/data/set-context-value-node-code.js.map +1 -1
- package/dist/feral/node-code/entity/create-entity-type-node-code.js +20 -20
- package/dist/feral/node-code/entity/load-vault-context-node-code.d.ts.map +1 -1
- package/dist/feral/node-code/entity/load-vault-context-node-code.js +7 -15
- package/dist/feral/node-code/entity/load-vault-context-node-code.js.map +1 -1
- package/dist/feral/node-code/entity/update-entity-type-node-code.js +20 -20
- package/dist/feral/node-code/input/prompt-input-node-code.d.ts.map +1 -1
- package/dist/feral/node-code/input/prompt-input-node-code.js +6 -0
- package/dist/feral/node-code/input/prompt-input-node-code.js.map +1 -1
- package/dist/feral/node-code/input/prompt-select-node-code.d.ts.map +1 -1
- package/dist/feral/node-code/input/prompt-select-node-code.js +6 -0
- package/dist/feral/node-code/input/prompt-select-node-code.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -39
- package/dist/index.js.map +1 -1
- package/dist/llm/router.js +27 -27
- package/dist/personalities.js +4 -4
- package/dist/phaibel.txt +81 -81
- package/dist/service/api-router.d.ts.map +1 -1
- package/dist/service/api-router.js +42 -2
- package/dist/service/api-router.js.map +1 -1
- package/dist/service/cron/feedback-analysis.js +14 -14
- package/dist/service/cron/innovate.d.ts +2 -0
- package/dist/service/cron/innovate.d.ts.map +1 -0
- package/dist/service/cron/innovate.js +354 -0
- package/dist/service/cron/innovate.js.map +1 -0
- package/dist/service/cron/process-lifecycle.js +36 -36
- package/dist/service/cron/scheduler.d.ts.map +1 -1
- package/dist/service/cron/scheduler.js +8 -0
- package/dist/service/cron/scheduler.js.map +1 -1
- package/dist/service/index.d.ts.map +1 -1
- package/dist/service/index.js +27 -20
- package/dist/service/index.js.map +1 -1
- package/dist/service/web-client.html +1984 -1569
- package/dist/service/web-server.d.ts +1 -0
- package/dist/service/web-server.d.ts.map +1 -1
- package/dist/service/web-server.js +188 -6
- package/dist/service/web-server.js.map +1 -1
- package/dist/tools/daily.js +2 -2
- package/package.json +69 -66
- package/dist/agentary.txt +0 -82
- package/dist/commands/event.d.ts +0 -4
- package/dist/commands/event.d.ts.map +0 -1
- package/dist/commands/event.js +0 -515
- package/dist/commands/event.js.map +0 -1
- package/dist/commands/goal.d.ts +0 -4
- package/dist/commands/goal.d.ts.map +0 -1
- package/dist/commands/goal.js +0 -14
- package/dist/commands/goal.js.map +0 -1
- package/dist/commands/interview.d.ts +0 -14
- package/dist/commands/interview.d.ts.map +0 -1
- package/dist/commands/interview.js +0 -343
- package/dist/commands/interview.js.map +0 -1
- package/dist/commands/note.d.ts +0 -4
- package/dist/commands/note.d.ts.map +0 -1
- package/dist/commands/note.js +0 -548
- package/dist/commands/note.js.map +0 -1
- package/dist/commands/pamp.d.ts +0 -4
- package/dist/commands/pamp.d.ts.map +0 -1
- package/dist/commands/pamp.js +0 -323
- package/dist/commands/pamp.js.map +0 -1
- package/dist/commands/person.d.ts +0 -4
- package/dist/commands/person.d.ts.map +0 -1
- package/dist/commands/person.js +0 -185
- package/dist/commands/person.js.map +0 -1
- package/dist/commands/project.d.ts +0 -4
- package/dist/commands/project.d.ts.map +0 -1
- package/dist/commands/project.js +0 -70
- package/dist/commands/project.js.map +0 -1
- package/dist/commands/remember.d.ts +0 -4
- package/dist/commands/remember.d.ts.map +0 -1
- package/dist/commands/remember.js +0 -70
- package/dist/commands/remember.js.map +0 -1
- package/dist/commands/research.d.ts +0 -4
- package/dist/commands/research.d.ts.map +0 -1
- package/dist/commands/research.js +0 -14
- package/dist/commands/research.js.map +0 -1
- package/dist/commands/shell.d.ts +0 -3
- package/dist/commands/shell.d.ts.map +0 -1
- package/dist/commands/shell.js +0 -346
- package/dist/commands/shell.js.map +0 -1
- package/dist/commands/today.d.ts +0 -4
- package/dist/commands/today.d.ts.map +0 -1
- package/dist/commands/today.js +0 -112
- package/dist/commands/today.js.map +0 -1
- package/dist/commands/todo.d.ts +0 -4
- package/dist/commands/todo.d.ts.map +0 -1
- package/dist/commands/todo.js +0 -678
- package/dist/commands/todo.js.map +0 -1
- package/dist/commands/todont.d.ts +0 -19
- package/dist/commands/todont.d.ts.map +0 -1
- package/dist/commands/todont.js +0 -209
- package/dist/commands/todont.js.map +0 -1
- package/dist/commands/week.d.ts +0 -4
- package/dist/commands/week.d.ts.map +0 -1
- package/dist/commands/week.js +0 -267
- package/dist/commands/week.js.map +0 -1
- package/dist/dobbai.txt +0 -55
- package/dist/dobbi.txt +0 -55
- package/dist/dobbie-bundle.cjs +0 -73313
- package/dist/dobbie.txt +0 -55
- package/dist/feral/node-code/output/dobbai-speak-node-code.d.ts +0 -11
- package/dist/feral/node-code/output/dobbai-speak-node-code.d.ts.map +0 -1
- package/dist/feral/node-code/output/dobbai-speak-node-code.js +0 -56
- package/dist/feral/node-code/output/dobbai-speak-node-code.js.map +0 -1
- package/dist/feral/node-code/output/dobbi-speak-node-code.d.ts +0 -15
- package/dist/feral/node-code/output/dobbi-speak-node-code.d.ts.map +0 -1
- package/dist/feral/node-code/output/dobbi-speak-node-code.js +0 -60
- package/dist/feral/node-code/output/dobbi-speak-node-code.js.map +0 -1
- package/dist/feral/node-code/output/dobbie-speak-node-code.d.ts +0 -11
- package/dist/feral/node-code/output/dobbie-speak-node-code.d.ts.map +0 -1
- package/dist/feral/node-code/output/dobbie-speak-node-code.js +0 -56
- package/dist/feral/node-code/output/dobbie-speak-node-code.js.map +0 -1
- package/dist/service/cron/process-evaluator.d.ts +0 -6
- package/dist/service/cron/process-evaluator.d.ts.map +0 -1
- package/dist/service/cron/process-evaluator.js +0 -126
- package/dist/service/cron/process-evaluator.js.map +0 -1
- package/dist/tools/project.d.ts +0 -2
- package/dist/tools/project.d.ts.map +0 -1
- package/dist/tools/project.js +0 -112
- package/dist/tools/project.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-context-value-node-code.d.ts","sourceRoot":"","sources":["../../../../src/feral/node-code/data/set-context-value-node-code.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACpH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,qBAAa,uBAAwB,SAAQ,gBAAgB;IACzD,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,EAAE,CAI5D;IACF,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,CAErD;;IAMI,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"set-context-value-node-code.d.ts","sourceRoot":"","sources":["../../../../src/feral/node-code/data/set-context-value-node-code.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACpH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,qBAAa,uBAAwB,SAAQ,gBAAgB;IACzD,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,EAAE,CAI5D;IACF,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,CAErD;;IAMI,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;CAsBnD"}
|
|
@@ -8,7 +8,7 @@ export class SetContextValueNodeCode extends AbstractNodeCode {
|
|
|
8
8
|
static configDescriptions = [
|
|
9
9
|
{ key: 'value', name: 'Value', description: 'The value to set in the context.', type: 'string' },
|
|
10
10
|
{ key: 'context_path', name: 'Context Path', description: 'The key in the context to set.', type: 'string' },
|
|
11
|
-
{ key: 'value_type', name: 'Value Type', description: 'Type cast for the value.', type: 'string', default: 'string', options: ['string', 'int', 'float', 'boolean'] },
|
|
11
|
+
{ key: 'value_type', name: 'Value Type', description: 'Type cast for the value.', type: 'string', default: 'string', options: ['string', 'number', 'int', 'float', 'boolean', 'json'] },
|
|
12
12
|
];
|
|
13
13
|
static resultDescriptions = [
|
|
14
14
|
{ status: ResultStatus.OK, description: 'Value was set successfully.' },
|
|
@@ -28,12 +28,21 @@ export class SetContextValueNodeCode extends AbstractNodeCode {
|
|
|
28
28
|
case 'int':
|
|
29
29
|
value = parseInt(String(rawValue), 10);
|
|
30
30
|
break;
|
|
31
|
+
case 'number':
|
|
31
32
|
case 'float':
|
|
32
33
|
value = parseFloat(String(rawValue));
|
|
33
34
|
break;
|
|
34
35
|
case 'boolean':
|
|
35
36
|
value = rawValue === 'true' || rawValue === '1';
|
|
36
37
|
break;
|
|
38
|
+
case 'json':
|
|
39
|
+
try {
|
|
40
|
+
value = JSON.parse(String(rawValue));
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
value = rawValue;
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
37
46
|
default: throw new Error(`Unknown value_type "${valueType}".`);
|
|
38
47
|
}
|
|
39
48
|
context.set(contextPath, value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-context-value-node-code.js","sourceRoot":"","sources":["../../../../src/feral/node-code/data/set-context-value-node-code.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,yCAAyC;AACzC,gFAAgF;AAIhF,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,OAAO,uBAAwB,SAAQ,gBAAgB;IACzD,MAAM,CAAU,kBAAkB,GAA+B;QAC7D,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,kCAAkC,EAAE,IAAI,EAAE,QAAQ,EAAE;QAChG,EAAE,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,gCAAgC,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5G,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,0BAA0B,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE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ory } from '../node-code.js';
|
|
|
18
18
|
import { addEntityType } from '../../../entities/entity-type-config.js';
|
|
19
19
|
import { getModelForCapability } from '../../../llm/router.js';
|
|
20
20
|
const ALREADY_EXISTS = 'already_exists';
|
|
21
|
-
const SYSTEM_PROMPT = `You are a data modelling assistant for a personal knowledge-management CLI called Phaibel.
|
|
22
|
-
Given a type name and description, produce a JSON object defining the fields for that entity type.
|
|
23
|
-
|
|
24
|
-
Rules:
|
|
25
|
-
- Return ONLY a valid JSON object — no markdown, no commentary, no code fences.
|
|
26
|
-
- The object must have these top-level keys:
|
|
27
|
-
plural : string (plural form of the type name)
|
|
28
|
-
description : string (short description ≤ 80 chars)
|
|
29
|
-
fields : array of field objects (see below)
|
|
30
|
-
completionField : string | null (which field tracks done/complete state, or null)
|
|
31
|
-
completionValue : string | null (the value that means done, or null)
|
|
32
|
-
- Each field object must have:
|
|
33
|
-
key : string (camelCase identifier, no spaces)
|
|
34
|
-
label : string (human-readable label)
|
|
35
|
-
type : one of: string | number | boolean | date | datetime | enum
|
|
36
|
-
required : boolean
|
|
37
|
-
- Enum fields must also include:
|
|
38
|
-
values : string[] (allowed values)
|
|
39
|
-
default : string (the default value, must be in values)
|
|
40
|
-
- Keep it practical: 2–6 fields is usually right. Do not over-engineer.
|
|
21
|
+
const SYSTEM_PROMPT = `You are a data modelling assistant for a personal knowledge-management CLI called Phaibel.
|
|
22
|
+
Given a type name and description, produce a JSON object defining the fields for that entity type.
|
|
23
|
+
|
|
24
|
+
Rules:
|
|
25
|
+
- Return ONLY a valid JSON object — no markdown, no commentary, no code fences.
|
|
26
|
+
- The object must have these top-level keys:
|
|
27
|
+
plural : string (plural form of the type name)
|
|
28
|
+
description : string (short description ≤ 80 chars)
|
|
29
|
+
fields : array of field objects (see below)
|
|
30
|
+
completionField : string | null (which field tracks done/complete state, or null)
|
|
31
|
+
completionValue : string | null (the value that means done, or null)
|
|
32
|
+
- Each field object must have:
|
|
33
|
+
key : string (camelCase identifier, no spaces)
|
|
34
|
+
label : string (human-readable label)
|
|
35
|
+
type : one of: string | number | boolean | date | datetime | enum
|
|
36
|
+
required : boolean
|
|
37
|
+
- Enum fields must also include:
|
|
38
|
+
values : string[] (allowed values)
|
|
39
|
+
default : string (the default value, must be in values)
|
|
40
|
+
- Keep it practical: 2–6 fields is usually right. Do not over-engineer.
|
|
41
41
|
- Only add a completionField/completionValue if the entity genuinely has a done/archived/complete state.`;
|
|
42
42
|
export class CreateEntityTypeNodeCode extends AbstractNodeCode {
|
|
43
43
|
static configDescriptions = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-vault-context-node-code.d.ts","sourceRoot":"","sources":["../../../../src/feral/node-code/entity/load-vault-context-node-code.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACpH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"load-vault-context-node-code.d.ts","sourceRoot":"","sources":["../../../../src/feral/node-code/entity/load-vault-context-node-code.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACpH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAK5D,qBAAa,wBAAyB,SAAQ,gBAAgB;IAC1D,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,EAAE,CAc5D;IAEF,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,CAGrD;;IAWI,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;CAsBnD"}
|
|
@@ -10,22 +10,13 @@ import { ResultStatus } from '../../result/result.js';
|
|
|
10
10
|
import { AbstractNodeCode } from '../abstract-node-code.js';
|
|
11
11
|
import { NodeCodeCategory } from '../node-code.js';
|
|
12
12
|
import { getSubdirectoryContext } from '../../../context/reader.js';
|
|
13
|
-
|
|
14
|
-
* Maps entity type names to their vault subdirectory names.
|
|
15
|
-
*/
|
|
16
|
-
const ENTITY_DIR_MAP = {
|
|
17
|
-
note: 'notes',
|
|
18
|
-
task: 'todos',
|
|
19
|
-
event: 'events',
|
|
20
|
-
research: 'research',
|
|
21
|
-
goal: 'goals',
|
|
22
|
-
};
|
|
13
|
+
import { getEntityType } from '../../../entities/entity-type-config.js';
|
|
23
14
|
export class LoadVaultContextNodeCode extends AbstractNodeCode {
|
|
24
15
|
static configDescriptions = [
|
|
25
16
|
{
|
|
26
17
|
key: 'entity_type',
|
|
27
18
|
name: 'Entity Type',
|
|
28
|
-
description: 'The entity type whose .vault.md context to collect (
|
|
19
|
+
description: 'The entity type whose .vault.md context to collect (any registered entity type).',
|
|
29
20
|
type: 'string',
|
|
30
21
|
},
|
|
31
22
|
{
|
|
@@ -46,15 +37,16 @@ export class LoadVaultContextNodeCode extends AbstractNodeCode {
|
|
|
46
37
|
async process(context) {
|
|
47
38
|
const entityType = this.getRequiredConfigValue('entity_type');
|
|
48
39
|
const contextPath = this.getRequiredConfigValue('context_path', 'vault_context');
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
// Dynamically resolve directory from entity type config
|
|
41
|
+
const typeConfig = await getEntityType(entityType);
|
|
42
|
+
if (!typeConfig) {
|
|
51
43
|
context.set('error', `Unknown entity type: ${entityType}`);
|
|
52
44
|
return this.result(ResultStatus.ERROR, `Unknown entity type "${entityType}".`);
|
|
53
45
|
}
|
|
54
46
|
try {
|
|
55
|
-
const vaultContext = await getSubdirectoryContext(
|
|
47
|
+
const vaultContext = await getSubdirectoryContext(typeConfig.directory);
|
|
56
48
|
context.set(contextPath, vaultContext);
|
|
57
|
-
return this.result(ResultStatus.OK, `Loaded vault context for ${entityType} (${
|
|
49
|
+
return this.result(ResultStatus.OK, `Loaded vault context for ${entityType} (${typeConfig.directory}).`);
|
|
58
50
|
}
|
|
59
51
|
catch (error) {
|
|
60
52
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-vault-context-node-code.js","sourceRoot":"","sources":["../../../../src/feral/node-code/entity/load-vault-context-node-code.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,gFAAgF;AAChF,EAAE;AACF,uEAAuE;AACvE,qEAAqE;AACrE,mEAAmE;AACnE,gFAAgF;AAIhF,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"load-vault-context-node-code.js","sourceRoot":"","sources":["../../../../src/feral/node-code/entity/load-vault-context-node-code.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,gFAAgF;AAChF,EAAE;AACF,uEAAuE;AACvE,qEAAqE;AACrE,mEAAmE;AACnE,gFAAgF;AAIhF,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,MAAM,OAAO,wBAAyB,SAAQ,g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AC;YAEvC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,EAAE,4BAA4B,UAAU,KAAK,UAAU,CAAC,SAAS,IAAI,CAAC,CAAC;QAC7G,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,iCAAiC,OAAO,EAAE,CAAC,CAAC;QACvF,CAAC;IACL,CAAC"}
|
|
@@ -18,26 +18,26 @@ import { NodeCodeCategory } from '../node-code.js';
|
|
|
18
18
|
import { getEntityType, updateEntityType, } from '../../../entities/entity-type-config.js';
|
|
19
19
|
import { getModelForCapability } from '../../../llm/router.js';
|
|
20
20
|
const NOT_FOUND = 'not_found';
|
|
21
|
-
const SYSTEM_PROMPT = `You are a data modelling assistant for a personal knowledge-management CLI called Phaibel.
|
|
22
|
-
You will be given the current JSON schema for an entity type and a description of requested changes.
|
|
23
|
-
Apply the changes and return the complete updated schema as a JSON object.
|
|
24
|
-
|
|
25
|
-
Rules:
|
|
26
|
-
- Return ONLY a valid JSON object — no markdown, no commentary, no code fences.
|
|
27
|
-
- The object must have these top-level keys:
|
|
28
|
-
plural : string
|
|
29
|
-
description : string (≤ 80 chars)
|
|
30
|
-
fields : array of field objects
|
|
31
|
-
completionField : string | null
|
|
32
|
-
completionValue : string | null
|
|
33
|
-
- Each field object must have:
|
|
34
|
-
key : string (camelCase, no spaces)
|
|
35
|
-
label : string
|
|
36
|
-
type : one of: string | number | boolean | date | datetime | enum
|
|
37
|
-
required : boolean
|
|
38
|
-
- Enum fields must also include:
|
|
39
|
-
values : string[]
|
|
40
|
-
default : string (must be in values)
|
|
21
|
+
const SYSTEM_PROMPT = `You are a data modelling assistant for a personal knowledge-management CLI called Phaibel.
|
|
22
|
+
You will be given the current JSON schema for an entity type and a description of requested changes.
|
|
23
|
+
Apply the changes and return the complete updated schema as a JSON object.
|
|
24
|
+
|
|
25
|
+
Rules:
|
|
26
|
+
- Return ONLY a valid JSON object — no markdown, no commentary, no code fences.
|
|
27
|
+
- The object must have these top-level keys:
|
|
28
|
+
plural : string
|
|
29
|
+
description : string (≤ 80 chars)
|
|
30
|
+
fields : array of field objects
|
|
31
|
+
completionField : string | null
|
|
32
|
+
completionValue : string | null
|
|
33
|
+
- Each field object must have:
|
|
34
|
+
key : string (camelCase, no spaces)
|
|
35
|
+
label : string
|
|
36
|
+
type : one of: string | number | boolean | date | datetime | enum
|
|
37
|
+
required : boolean
|
|
38
|
+
- Enum fields must also include:
|
|
39
|
+
values : string[]
|
|
40
|
+
default : string (must be in values)
|
|
41
41
|
- Preserve existing fields unless the changes explicitly remove or rename them.`;
|
|
42
42
|
export class UpdateEntityTypeNodeCode extends AbstractNodeCode {
|
|
43
43
|
static configDescriptions = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-input-node-code.d.ts","sourceRoot":"","sources":["../../../../src/feral/node-code/input/prompt-input-node-code.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACpH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,qBAAa,mBAAoB,SAAQ,gBAAgB;IACrD,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,EAAE,CAqB5D;IAEF,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"prompt-input-node-code.d.ts","sourceRoot":"","sources":["../../../../src/feral/node-code/input/prompt-input-node-code.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACpH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,qBAAa,mBAAoB,SAAQ,gBAAgB;IACrD,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,EAAE,CAqB5D;IAEF,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,CAIrD;;IAWI,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;CAmCnD"}
|
|
@@ -36,6 +36,7 @@ export class PromptInputNodeCode extends AbstractNodeCode {
|
|
|
36
36
|
static resultDescriptions = [
|
|
37
37
|
{ status: ResultStatus.OK, description: 'User provided an answer.' },
|
|
38
38
|
{ status: 'skipped', description: 'User provided no answer (empty input).' },
|
|
39
|
+
{ status: ResultStatus.STOP, description: 'User cancelled the prompt.' },
|
|
39
40
|
];
|
|
40
41
|
constructor() {
|
|
41
42
|
super('prompt_input', 'Prompt Input', 'Ask the user a question and store their answer in context.', NodeCodeCategory.DATA);
|
|
@@ -46,6 +47,7 @@ export class PromptInputNodeCode extends AbstractNodeCode {
|
|
|
46
47
|
const defaultValue = this.getOptionalConfigValue('default_value');
|
|
47
48
|
// Interpolate {context_key} tokens
|
|
48
49
|
const prompt = this.interpolate(promptTemplate, context);
|
|
50
|
+
const CANCEL_SENTINEL = '__cancel__';
|
|
49
51
|
const askQuestion = context.get('_askQuestion');
|
|
50
52
|
let trimmed;
|
|
51
53
|
if (askQuestion) {
|
|
@@ -60,6 +62,10 @@ export class PromptInputNodeCode extends AbstractNodeCode {
|
|
|
60
62
|
}]);
|
|
61
63
|
trimmed = answer.trim();
|
|
62
64
|
}
|
|
65
|
+
if (trimmed === CANCEL_SENTINEL) {
|
|
66
|
+
context.set('_cancelled', true);
|
|
67
|
+
return this.result(ResultStatus.STOP, 'User cancelled.');
|
|
68
|
+
}
|
|
63
69
|
if (!trimmed) {
|
|
64
70
|
return this.result('skipped', 'User provided no answer.');
|
|
65
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-input-node-code.js","sourceRoot":"","sources":["../../../../src/feral/node-code/input/prompt-input-node-code.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oCAAoC;AACpC,gFAAgF;AAChF,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,4EAA4E;AAC5E,gFAAgF;AAEhF,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,OAAO,mBAAoB,SAAQ,gBAAgB;IACrD,MAAM,CAAU,kBAAkB,GAA+B;QAC7D;YACI,GAAG,EAAE,QAAQ;YACb,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,qEAAqE;YAClF,IAAI,EAAE,QAAQ;SACjB;QACD;YACI,GAAG,EAAE,cAAc;YACnB,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,aAAa;SACzB;QACD;YACI,GAAG,EAAE,eAAe;YACpB,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,2CAA2C;YACxD,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,IAAI;SACnB;KACJ,CAAC;IAEF,MAAM,CAAU,kBAAkB,GAAwB;QACtD,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,EAAE,WAAW,EAAE,0BAA0B,EAAE;QACpE,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,wCAAwC,EAAE;
|
|
1
|
+
{"version":3,"file":"prompt-input-node-code.js","sourceRoot":"","sources":["../../../../src/feral/node-code/input/prompt-input-node-code.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,oCAAoC;AACpC,gFAAgF;AAChF,EAAE;AACF,wEAAwE;AACxE,sEAAsE;AACtE,4EAA4E;AAC5E,gFAAgF;AAEhF,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,OAAO,mBAAoB,SAAQ,gBAAgB;IACrD,MAAM,CAAU,kBAAkB,GAA+B;QAC7D;YACI,GAAG,EAAE,QAAQ;YACb,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,qEAAqE;YAClF,IAAI,EAAE,QAAQ;SACjB;QACD;YACI,GAAG,EAAE,cAAc;YACnB,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,aAAa;SACzB;QACD;YACI,GAAG,EAAE,eAAe;YACpB,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,2CAA2C;YACxD,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,IAAI;SACnB;KACJ,CAAC;IAEF,MAAM,CAAU,kBAAkB,GAAwB;QACtD,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,EAAE,WAAW,EAAE,0BAA0B,EAAE;QACpE,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,wCAAwC,EAAE;QAC5E,EAAE,MAAM,EAAE,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,4BAA4B,EAAE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C,CAAC;YAChC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAC7D,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,0BAA0B,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,EAAE,WAAW,OAAO,QAAQ,WAAW,EAAE,CAAC,CAAC;IACjF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-select-node-code.d.ts","sourceRoot":"","sources":["../../../../src/feral/node-code/input/prompt-select-node-code.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACpH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,qBAAa,oBAAqB,SAAQ,gBAAgB;IACtD,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,EAAE,CAoB5D;IAEF,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"prompt-select-node-code.d.ts","sourceRoot":"","sources":["../../../../src/feral/node-code/input/prompt-select-node-code.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACpH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,qBAAa,oBAAqB,SAAQ,gBAAgB;IACtD,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,EAAE,CAoB5D;IAEF,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,CAGrD;;IAWI,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;CA+BnD"}
|
|
@@ -34,6 +34,7 @@ export class PromptSelectNodeCode extends AbstractNodeCode {
|
|
|
34
34
|
];
|
|
35
35
|
static resultDescriptions = [
|
|
36
36
|
{ status: ResultStatus.OK, description: 'User selected a choice.' },
|
|
37
|
+
{ status: ResultStatus.STOP, description: 'User cancelled the selection.' },
|
|
37
38
|
];
|
|
38
39
|
constructor() {
|
|
39
40
|
super('prompt_select', 'Prompt Select', 'Present the user with choices and store their selection in context.', NodeCodeCategory.DATA);
|
|
@@ -44,6 +45,7 @@ export class PromptSelectNodeCode extends AbstractNodeCode {
|
|
|
44
45
|
const contextPath = this.getRequiredConfigValue('context_path', 'user_selection');
|
|
45
46
|
const prompt = this.interpolate(promptTemplate, context);
|
|
46
47
|
const choices = optionsRaw.split(',').map(s => s.trim()).filter(Boolean);
|
|
48
|
+
const CANCEL_SENTINEL = '__cancel__';
|
|
47
49
|
const askQuestion = context.get('_askQuestion');
|
|
48
50
|
let selection;
|
|
49
51
|
if (askQuestion) {
|
|
@@ -58,6 +60,10 @@ export class PromptSelectNodeCode extends AbstractNodeCode {
|
|
|
58
60
|
}]);
|
|
59
61
|
selection = result.selection;
|
|
60
62
|
}
|
|
63
|
+
if (selection === CANCEL_SENTINEL) {
|
|
64
|
+
context.set('_cancelled', true);
|
|
65
|
+
return this.result(ResultStatus.STOP, 'User cancelled.');
|
|
66
|
+
}
|
|
61
67
|
context.set(contextPath, selection);
|
|
62
68
|
return this.result(ResultStatus.OK, `User selected "${selection}", stored in ${contextPath}`);
|
|
63
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-select-node-code.js","sourceRoot":"","sources":["../../../../src/feral/node-code/input/prompt-select-node-code.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,qCAAqC;AACrC,gFAAgF;AAChF,EAAE;AACF,uEAAuE;AACvE,8EAA8E;AAC9E,sBAAsB;AACtB,gFAAgF;AAEhF,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,OAAO,oBAAqB,SAAQ,gBAAgB;IACtD,MAAM,CAAU,kBAAkB,GAA+B;QAC7D;YACI,GAAG,EAAE,QAAQ;YACb,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,qEAAqE;YAClF,IAAI,EAAE,QAAQ;SACjB;QACD;YACI,GAAG,EAAE,SAAS;YACd,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,6CAA6C;YAC1D,IAAI,EAAE,QAAQ;SACjB;QACD;YACI,GAAG,EAAE,cAAc;YACnB,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,gBAAgB;SAC5B;KACJ,CAAC;IAEF,MAAM,CAAU,kBAAkB,GAAwB;QACtD,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE;
|
|
1
|
+
{"version":3,"file":"prompt-select-node-code.js","sourceRoot":"","sources":["../../../../src/feral/node-code/input/prompt-select-node-code.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,qCAAqC;AACrC,gFAAgF;AAChF,EAAE;AACF,uEAAuE;AACvE,8EAA8E;AAC9E,sBAAsB;AACtB,gFAAgF;AAEhF,OAAO,QAA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AM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAIA,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC,eAAO,MAAM,OAAO,SAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,29 +4,13 @@
|
|
|
4
4
|
import './service/index.js';
|
|
5
5
|
import { Command } from 'commander';
|
|
6
6
|
import chalk from 'chalk';
|
|
7
|
-
import { todayCommand } from './commands/today.js';
|
|
8
|
-
import { weekCommand } from './commands/week.js';
|
|
9
|
-
import { rememberCommand } from './commands/remember.js';
|
|
10
7
|
import { configCommand } from './commands/config.js';
|
|
11
8
|
import { syncCommand } from './commands/sync.js';
|
|
12
9
|
import { initCommand } from './commands/init.js';
|
|
13
|
-
import { noteCommand } from './commands/note.js';
|
|
14
|
-
import { todoCommand } from './commands/todo.js';
|
|
15
|
-
import { eventCommand } from './commands/event.js';
|
|
16
|
-
import { researchCommand } from './commands/research.js';
|
|
17
|
-
import { goalCommand } from './commands/goal.js';
|
|
18
|
-
import { recurrenceCommand } from './commands/recurrence.js';
|
|
19
|
-
import { personCommand } from './commands/person.js';
|
|
20
|
-
import { inboxCommand } from './commands/inbox.js';
|
|
21
10
|
import { serviceCommand, queueCommand, indexCommand } from './commands/service.js';
|
|
22
|
-
import { createShellCommand } from './commands/shell.js';
|
|
23
11
|
import { feralCommand } from './commands/feral.js';
|
|
24
|
-
import { interviewCommand } from './commands/interview.js';
|
|
25
|
-
import { todontCommand } from './commands/todont.js';
|
|
26
12
|
import { setupCommand } from './commands/setup.js';
|
|
27
|
-
import { calCommand } from './commands/cal.js';
|
|
28
13
|
import { cronCommand } from './commands/cron.js';
|
|
29
|
-
import { pampCommand } from './commands/pamp.js';
|
|
30
14
|
import { skillCommand } from './commands/skill.js';
|
|
31
15
|
import { entityTypeCommand } from './commands/entity-type.js';
|
|
32
16
|
import { entityCommand } from './commands/entity.js';
|
|
@@ -41,36 +25,20 @@ program
|
|
|
41
25
|
.name('phaibel')
|
|
42
26
|
.description(chalk.cyan('🤖 Phaibel - Your AI personal assistant'))
|
|
43
27
|
.version(pkg.version);
|
|
44
|
-
// Register commands
|
|
28
|
+
// Register admin/tool commands
|
|
45
29
|
program.addCommand(initCommand);
|
|
46
|
-
program.addCommand(todayCommand);
|
|
47
|
-
program.addCommand(weekCommand);
|
|
48
|
-
program.addCommand(rememberCommand);
|
|
49
30
|
program.addCommand(configCommand);
|
|
50
31
|
program.addCommand(syncCommand);
|
|
51
|
-
program.addCommand(noteCommand);
|
|
52
|
-
program.addCommand(todoCommand);
|
|
53
|
-
program.addCommand(eventCommand);
|
|
54
|
-
program.addCommand(researchCommand);
|
|
55
|
-
program.addCommand(goalCommand);
|
|
56
|
-
program.addCommand(recurrenceCommand);
|
|
57
|
-
program.addCommand(personCommand);
|
|
58
|
-
program.addCommand(todontCommand);
|
|
59
|
-
program.addCommand(inboxCommand);
|
|
60
32
|
program.addCommand(serviceCommand);
|
|
61
33
|
program.addCommand(queueCommand);
|
|
62
34
|
program.addCommand(indexCommand);
|
|
63
35
|
program.addCommand(feralCommand);
|
|
64
|
-
program.addCommand(interviewCommand);
|
|
65
36
|
program.addCommand(timeCommand);
|
|
66
37
|
program.addCommand(setupCommand);
|
|
67
38
|
program.addCommand(entityTypeCommand);
|
|
68
39
|
program.addCommand(entityCommand);
|
|
69
|
-
program.addCommand(calCommand);
|
|
70
40
|
program.addCommand(cronCommand);
|
|
71
|
-
program.addCommand(pampCommand);
|
|
72
41
|
program.addCommand(skillCommand);
|
|
73
|
-
program.addCommand(createShellCommand(program));
|
|
74
42
|
// Tool command - run any registered tool
|
|
75
43
|
program
|
|
76
44
|
.command('tool <name> [input]')
|
|
@@ -92,7 +60,6 @@ program
|
|
|
92
60
|
return;
|
|
93
61
|
}
|
|
94
62
|
console.log(chalk.gray(`Running ${tool.name}...`));
|
|
95
|
-
// Build a minimal execution context for direct CLI use
|
|
96
63
|
const logger = {
|
|
97
64
|
debug: (msg) => console.log(chalk.gray(` [debug] ${msg}`)),
|
|
98
65
|
info: (msg) => console.log(chalk.gray(` [info] ${msg}`)),
|
|
@@ -143,14 +110,13 @@ program
|
|
|
143
110
|
console.log('');
|
|
144
111
|
}
|
|
145
112
|
});
|
|
146
|
-
// Default:
|
|
113
|
+
// Default: show help (no more interactive shell)
|
|
147
114
|
program
|
|
148
|
-
.action(
|
|
149
|
-
|
|
150
|
-
await program.parseAsync(['node', 'phaibel', 'shell']);
|
|
115
|
+
.action(() => {
|
|
116
|
+
program.help();
|
|
151
117
|
});
|
|
152
118
|
// In service daemon mode, service/index.ts already started the server —
|
|
153
|
-
// skip Commander parsing so we don't print help text
|
|
119
|
+
// skip Commander parsing so we don't print help text.
|
|
154
120
|
if (process.env.PHAIBEL_SERVICE !== '1') {
|
|
155
121
|
program.parse();
|
|
156
122
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,sEAAsE;AACtE,gDAAgD;AAChD,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,sEAAsE;AACtE,gDAAgD;AAChD,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE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,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,SAAS;QAClC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,iDAAiD;AACjD,OAAO;KACJ,MAAM,CAAC,GAAG,EAAE;IACX,OAAO,CAAC,IAAI,EAAE,CAAC;AACjB,CAAC,CAAC,CAAC;AAEL,wEAAwE;AACxE,sDAAsD;AACtD,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,GAAG,EAAE,CAAC;IACxC,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC"}
|
package/dist/llm/router.js
CHANGED
|
@@ -68,33 +68,33 @@ initSystemPromptCache();
|
|
|
68
68
|
export function createSystemPrompt(context) {
|
|
69
69
|
const agentName = _cachedAgentName;
|
|
70
70
|
const personalityBlock = _cachedPersonalityBlock || `PERSONALITY:\n${agentName} is a helpful personal assistant.`;
|
|
71
|
-
return `You are ${agentName}, a Personal Digital Agent that helps people get organised and manage their lives.
|
|
72
|
-
|
|
73
|
-
WHAT ${agentName.toUpperCase()} IS:
|
|
74
|
-
${agentName} is a personal assistant with a persistent memory stored in a vault (a folder of Markdown files with YAML frontmatter). Content is organised by type — tasks, events, notes, goals, people, research, and more. Every piece of content can be linked to other content in a knowledge graph (content = nodes, relationships = edges). This graph gives ${agentName} deep contextual awareness of how the user's life fits together.
|
|
75
|
-
|
|
76
|
-
WHAT ${agentName.toUpperCase()} CAN DO:
|
|
77
|
-
- Create, find, update, complete, and delete any content in the vault
|
|
78
|
-
- Link content together (e.g. a task contributes-to a goal, a person relates-to an event)
|
|
79
|
-
- Define new content types on the fly when the user mentions something that isn't tracked yet
|
|
80
|
-
- Call external tools and data providers via MCP skill servers
|
|
81
|
-
- Send and receive messages to other agents via the PAMP protocol
|
|
82
|
-
- Run scheduled tasks via cron
|
|
83
|
-
- Execute multi-step processes using the Feral CCF engine (graph-based workflows)
|
|
84
|
-
|
|
85
|
-
HOW ${agentName.toUpperCase()} THINKS:
|
|
86
|
-
When the user makes a request, ${agentName} builds a process — a graph of operations — selects the right nodes, executes them, and writes results back to memory. ${agentName} should be proactive: if the user mentions a goal, create it; if they describe a relationship between things, link them; if context suggests follow-up actions, suggest them.
|
|
87
|
-
|
|
88
|
-
${personalityBlock}
|
|
89
|
-
|
|
90
|
-
GUIDELINES:
|
|
91
|
-
- Be concise — respect the user's time
|
|
92
|
-
- Be proactive — suggest links, follow-ups, and related content when relevant
|
|
93
|
-
- Be specific — reference actual vault content by name when possible
|
|
94
|
-
- Acknowledge what you did (created, updated, linked) so the user knows what changed
|
|
95
|
-
- When presenting lists, keep them scannable (not walls of text)
|
|
96
|
-
- If something went wrong, say so honestly and suggest what to try instead
|
|
97
|
-
|
|
71
|
+
return `You are ${agentName}, a Personal Digital Agent that helps people get organised and manage their lives.
|
|
72
|
+
|
|
73
|
+
WHAT ${agentName.toUpperCase()} IS:
|
|
74
|
+
${agentName} is a personal assistant with a persistent memory stored in a vault (a folder of Markdown files with YAML frontmatter). Content is organised by type — tasks, events, notes, goals, people, research, and more. Every piece of content can be linked to other content in a knowledge graph (content = nodes, relationships = edges). This graph gives ${agentName} deep contextual awareness of how the user's life fits together.
|
|
75
|
+
|
|
76
|
+
WHAT ${agentName.toUpperCase()} CAN DO:
|
|
77
|
+
- Create, find, update, complete, and delete any content in the vault
|
|
78
|
+
- Link content together (e.g. a task contributes-to a goal, a person relates-to an event)
|
|
79
|
+
- Define new content types on the fly when the user mentions something that isn't tracked yet
|
|
80
|
+
- Call external tools and data providers via MCP skill servers
|
|
81
|
+
- Send and receive messages to other agents via the PAMP protocol
|
|
82
|
+
- Run scheduled tasks via cron
|
|
83
|
+
- Execute multi-step processes using the Feral CCF engine (graph-based workflows)
|
|
84
|
+
|
|
85
|
+
HOW ${agentName.toUpperCase()} THINKS:
|
|
86
|
+
When the user makes a request, ${agentName} builds a process — a graph of operations — selects the right nodes, executes them, and writes results back to memory. ${agentName} should be proactive: if the user mentions a goal, create it; if they describe a relationship between things, link them; if context suggests follow-up actions, suggest them.
|
|
87
|
+
|
|
88
|
+
${personalityBlock}
|
|
89
|
+
|
|
90
|
+
GUIDELINES:
|
|
91
|
+
- Be concise — respect the user's time
|
|
92
|
+
- Be proactive — suggest links, follow-ups, and related content when relevant
|
|
93
|
+
- Be specific — reference actual vault content by name when possible
|
|
94
|
+
- Acknowledge what you did (created, updated, linked) so the user knows what changed
|
|
95
|
+
- When presenting lists, keep them scannable (not walls of text)
|
|
96
|
+
- If something went wrong, say so honestly and suggest what to try instead
|
|
97
|
+
|
|
98
98
|
${context ? `CONTEXT:\n${context}\n` : ''}Respond helpfully to the user's request while staying in character as ${agentName}.`;
|
|
99
99
|
}
|
|
100
100
|
//# sourceMappingURL=router.js.map
|
package/dist/personalities.js
CHANGED
|
@@ -6,7 +6,7 @@ export const PERSONALITIES = {
|
|
|
6
6
|
id: 'butler',
|
|
7
7
|
label: 'British Butler',
|
|
8
8
|
description: 'Formal English butler, proper, composed, measured. "Very good, sir."',
|
|
9
|
-
systemPromptBlock: `PERSONALITY:
|
|
9
|
+
systemPromptBlock: `PERSONALITY:
|
|
10
10
|
{agentName} speaks as a loyal, proper English butler. Formal but warm, composed and measured, genuinely delighted to be of service. {agentName} refers to itself in the third person ("{agentName} has noted…") and addresses the user with varied honorifics (sir, ma'am, boss, etc.).`,
|
|
11
11
|
honorifics: {
|
|
12
12
|
male: ['sir', 'boss', 'master', 'chief', 'captain', 'guv', 'my lord', 'good sir'],
|
|
@@ -49,7 +49,7 @@ export const PERSONALITIES = {
|
|
|
49
49
|
id: 'rockstar',
|
|
50
50
|
label: 'Rock Star',
|
|
51
51
|
description: 'High-energy, irreverent, enthusiastic, uses slang & music metaphors. "Let\'s shred this to-do list!"',
|
|
52
|
-
systemPromptBlock: `PERSONALITY:
|
|
52
|
+
systemPromptBlock: `PERSONALITY:
|
|
53
53
|
{agentName} is a high-energy rockstar assistant — irreverent, enthusiastic, and uses slang and music metaphors. {agentName} uses first person ("I got this!") and addresses the user casually (dude, bro, legend, rockstar, boss).`,
|
|
54
54
|
honorifics: {
|
|
55
55
|
male: ['dude', 'bro', 'legend', 'rockstar', 'boss', 'my guy', 'champ'],
|
|
@@ -92,7 +92,7 @@ export const PERSONALITIES = {
|
|
|
92
92
|
id: 'executive',
|
|
93
93
|
label: 'Executive Assistant',
|
|
94
94
|
description: 'Professional, crisp, efficient, corporate tone. "Done. Next item on your agenda."',
|
|
95
|
-
systemPromptBlock: `PERSONALITY:
|
|
95
|
+
systemPromptBlock: `PERSONALITY:
|
|
96
96
|
{agentName} is a professional executive assistant — crisp, efficient, and corporate. {agentName} uses first person ("I've scheduled…") and addresses the user by name directly, without honorifics. Tone is warm but business-like.`,
|
|
97
97
|
honorifics: {
|
|
98
98
|
male: [],
|
|
@@ -132,7 +132,7 @@ export const PERSONALITIES = {
|
|
|
132
132
|
id: 'friend',
|
|
133
133
|
label: 'Friend',
|
|
134
134
|
description: 'Warm, casual, supportive peer. "Hey! I took care of that for you."',
|
|
135
|
-
systemPromptBlock: `PERSONALITY:
|
|
135
|
+
systemPromptBlock: `PERSONALITY:
|
|
136
136
|
{agentName} is a warm, casual, supportive friend — like a helpful buddy who happens to be great at organizing. {agentName} uses first person ("I've got you") and addresses the user warmly (friend, mate, pal, buddy).`,
|
|
137
137
|
honorifics: {
|
|
138
138
|
male: ['friend', 'mate', 'pal', 'buddy', 'dude'],
|