create-agentfs 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +238 -0
  3. package/dist/cli.d.ts +51 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +246 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/commands/compile.d.ts +48 -0
  8. package/dist/commands/compile.d.ts.map +1 -0
  9. package/dist/commands/compile.js +228 -0
  10. package/dist/commands/compile.js.map +1 -0
  11. package/dist/commands/cron.d.ts +18 -0
  12. package/dist/commands/cron.d.ts.map +1 -0
  13. package/dist/commands/cron.js +95 -0
  14. package/dist/commands/cron.js.map +1 -0
  15. package/dist/commands/doctor.d.ts +11 -0
  16. package/dist/commands/doctor.d.ts.map +1 -0
  17. package/dist/commands/doctor.js +199 -0
  18. package/dist/commands/doctor.js.map +1 -0
  19. package/dist/commands/memory.d.ts +19 -0
  20. package/dist/commands/memory.d.ts.map +1 -0
  21. package/dist/commands/memory.js +213 -0
  22. package/dist/commands/memory.js.map +1 -0
  23. package/dist/commands/onboard.d.ts +31 -0
  24. package/dist/commands/onboard.d.ts.map +1 -0
  25. package/dist/commands/onboard.js +362 -0
  26. package/dist/commands/onboard.js.map +1 -0
  27. package/dist/commands/secret.d.ts +13 -0
  28. package/dist/commands/secret.d.ts.map +1 -0
  29. package/dist/commands/secret.js +109 -0
  30. package/dist/commands/secret.js.map +1 -0
  31. package/dist/commands/security.d.ts +16 -0
  32. package/dist/commands/security.d.ts.map +1 -0
  33. package/dist/commands/security.js +203 -0
  34. package/dist/commands/security.js.map +1 -0
  35. package/dist/commands/sync.d.ts +14 -0
  36. package/dist/commands/sync.d.ts.map +1 -0
  37. package/dist/commands/sync.js +84 -0
  38. package/dist/commands/sync.js.map +1 -0
  39. package/dist/compilers/agent-map.d.ts +34 -0
  40. package/dist/compilers/agent-map.d.ts.map +1 -0
  41. package/dist/compilers/agent-map.js +66 -0
  42. package/dist/compilers/agent-map.js.map +1 -0
  43. package/dist/compilers/base.d.ts +67 -0
  44. package/dist/compilers/base.d.ts.map +1 -0
  45. package/dist/compilers/base.js +183 -0
  46. package/dist/compilers/base.js.map +1 -0
  47. package/dist/compilers/claude.d.ts +26 -0
  48. package/dist/compilers/claude.d.ts.map +1 -0
  49. package/dist/compilers/claude.js +151 -0
  50. package/dist/compilers/claude.js.map +1 -0
  51. package/dist/compilers/cursor.d.ts +11 -0
  52. package/dist/compilers/cursor.d.ts.map +1 -0
  53. package/dist/compilers/cursor.js +52 -0
  54. package/dist/compilers/cursor.js.map +1 -0
  55. package/dist/compilers/index.d.ts +14 -0
  56. package/dist/compilers/index.d.ts.map +1 -0
  57. package/dist/compilers/index.js +14 -0
  58. package/dist/compilers/index.js.map +1 -0
  59. package/dist/compilers/openclaw.d.ts +12 -0
  60. package/dist/compilers/openclaw.d.ts.map +1 -0
  61. package/dist/compilers/openclaw.js +51 -0
  62. package/dist/compilers/openclaw.js.map +1 -0
  63. package/dist/cron/index.d.ts +10 -0
  64. package/dist/cron/index.d.ts.map +1 -0
  65. package/dist/cron/index.js +9 -0
  66. package/dist/cron/index.js.map +1 -0
  67. package/dist/cron/jobs/consolidate.d.ts +16 -0
  68. package/dist/cron/jobs/consolidate.d.ts.map +1 -0
  69. package/dist/cron/jobs/consolidate.js +61 -0
  70. package/dist/cron/jobs/consolidate.js.map +1 -0
  71. package/dist/cron/jobs/heartbeat.d.ts +11 -0
  72. package/dist/cron/jobs/heartbeat.d.ts.map +1 -0
  73. package/dist/cron/jobs/heartbeat.js +66 -0
  74. package/dist/cron/jobs/heartbeat.js.map +1 -0
  75. package/dist/cron/jobs/inbox-triage.d.ts +11 -0
  76. package/dist/cron/jobs/inbox-triage.d.ts.map +1 -0
  77. package/dist/cron/jobs/inbox-triage.js +85 -0
  78. package/dist/cron/jobs/inbox-triage.js.map +1 -0
  79. package/dist/cron/runner.d.ts +32 -0
  80. package/dist/cron/runner.d.ts.map +1 -0
  81. package/dist/cron/runner.js +69 -0
  82. package/dist/cron/runner.js.map +1 -0
  83. package/dist/cron/types.d.ts +21 -0
  84. package/dist/cron/types.d.ts.map +1 -0
  85. package/dist/cron/types.js +6 -0
  86. package/dist/cron/types.js.map +1 -0
  87. package/dist/generators/filesystem.d.ts +52 -0
  88. package/dist/generators/filesystem.d.ts.map +1 -0
  89. package/dist/generators/filesystem.js +155 -0
  90. package/dist/generators/filesystem.js.map +1 -0
  91. package/dist/generators/ignore.d.ts +38 -0
  92. package/dist/generators/ignore.d.ts.map +1 -0
  93. package/dist/generators/ignore.js +154 -0
  94. package/dist/generators/ignore.js.map +1 -0
  95. package/dist/generators/index.d.ts +14 -0
  96. package/dist/generators/index.d.ts.map +1 -0
  97. package/dist/generators/index.js +14 -0
  98. package/dist/generators/index.js.map +1 -0
  99. package/dist/generators/init.d.ts +37 -0
  100. package/dist/generators/init.d.ts.map +1 -0
  101. package/dist/generators/init.js +169 -0
  102. package/dist/generators/init.js.map +1 -0
  103. package/dist/generators/manifest.d.ts +31 -0
  104. package/dist/generators/manifest.d.ts.map +1 -0
  105. package/dist/generators/manifest.js +123 -0
  106. package/dist/generators/manifest.js.map +1 -0
  107. package/dist/generators/memory.d.ts +36 -0
  108. package/dist/generators/memory.d.ts.map +1 -0
  109. package/dist/generators/memory.js +106 -0
  110. package/dist/generators/memory.js.map +1 -0
  111. package/dist/generators/profiles.d.ts +22 -0
  112. package/dist/generators/profiles.d.ts.map +1 -0
  113. package/dist/generators/profiles.js +92 -0
  114. package/dist/generators/profiles.js.map +1 -0
  115. package/dist/generators/prompts.d.ts +24 -0
  116. package/dist/generators/prompts.d.ts.map +1 -0
  117. package/dist/generators/prompts.js +122 -0
  118. package/dist/generators/prompts.js.map +1 -0
  119. package/dist/generators/scaffold.d.ts +29 -0
  120. package/dist/generators/scaffold.d.ts.map +1 -0
  121. package/dist/generators/scaffold.js +90 -0
  122. package/dist/generators/scaffold.js.map +1 -0
  123. package/dist/index.d.ts +14 -0
  124. package/dist/index.d.ts.map +1 -0
  125. package/dist/index.js +13 -0
  126. package/dist/index.js.map +1 -0
  127. package/dist/memory/confidence.d.ts +69 -0
  128. package/dist/memory/confidence.d.ts.map +1 -0
  129. package/dist/memory/confidence.js +125 -0
  130. package/dist/memory/confidence.js.map +1 -0
  131. package/dist/memory/episodic.d.ts +40 -0
  132. package/dist/memory/episodic.d.ts.map +1 -0
  133. package/dist/memory/episodic.js +139 -0
  134. package/dist/memory/episodic.js.map +1 -0
  135. package/dist/memory/index.d.ts +17 -0
  136. package/dist/memory/index.d.ts.map +1 -0
  137. package/dist/memory/index.js +17 -0
  138. package/dist/memory/index.js.map +1 -0
  139. package/dist/memory/parser.d.ts +73 -0
  140. package/dist/memory/parser.d.ts.map +1 -0
  141. package/dist/memory/parser.js +156 -0
  142. package/dist/memory/parser.js.map +1 -0
  143. package/dist/memory/procedural.d.ts +43 -0
  144. package/dist/memory/procedural.d.ts.map +1 -0
  145. package/dist/memory/procedural.js +126 -0
  146. package/dist/memory/procedural.js.map +1 -0
  147. package/dist/secrets/exfil-guard.d.ts +31 -0
  148. package/dist/secrets/exfil-guard.d.ts.map +1 -0
  149. package/dist/secrets/exfil-guard.js +51 -0
  150. package/dist/secrets/exfil-guard.js.map +1 -0
  151. package/dist/secrets/index.d.ts +8 -0
  152. package/dist/secrets/index.d.ts.map +1 -0
  153. package/dist/secrets/index.js +7 -0
  154. package/dist/secrets/index.js.map +1 -0
  155. package/dist/secrets/vault.d.ts +63 -0
  156. package/dist/secrets/vault.d.ts.map +1 -0
  157. package/dist/secrets/vault.js +163 -0
  158. package/dist/secrets/vault.js.map +1 -0
  159. package/dist/security/claude-compiler.d.ts +28 -0
  160. package/dist/security/claude-compiler.d.ts.map +1 -0
  161. package/dist/security/claude-compiler.js +66 -0
  162. package/dist/security/claude-compiler.js.map +1 -0
  163. package/dist/security/index.d.ts +7 -0
  164. package/dist/security/index.d.ts.map +1 -0
  165. package/dist/security/index.js +7 -0
  166. package/dist/security/index.js.map +1 -0
  167. package/dist/security/parser.d.ts +47 -0
  168. package/dist/security/parser.d.ts.map +1 -0
  169. package/dist/security/parser.js +136 -0
  170. package/dist/security/parser.js.map +1 -0
  171. package/dist/sync/index.d.ts +7 -0
  172. package/dist/sync/index.d.ts.map +1 -0
  173. package/dist/sync/index.js +6 -0
  174. package/dist/sync/index.js.map +1 -0
  175. package/dist/sync/sync.d.ts +46 -0
  176. package/dist/sync/sync.d.ts.map +1 -0
  177. package/dist/sync/sync.js +174 -0
  178. package/dist/sync/sync.js.map +1 -0
  179. package/dist/types/compiler.d.ts +81 -0
  180. package/dist/types/compiler.d.ts.map +1 -0
  181. package/dist/types/compiler.js +10 -0
  182. package/dist/types/compiler.js.map +1 -0
  183. package/dist/types/index.d.ts +15 -0
  184. package/dist/types/index.d.ts.map +1 -0
  185. package/dist/types/index.js +10 -0
  186. package/dist/types/index.js.map +1 -0
  187. package/dist/types/manifest.d.ts +112 -0
  188. package/dist/types/manifest.d.ts.map +1 -0
  189. package/dist/types/manifest.js +10 -0
  190. package/dist/types/manifest.js.map +1 -0
  191. package/dist/types/memory.d.ts +85 -0
  192. package/dist/types/memory.d.ts.map +1 -0
  193. package/dist/types/memory.js +20 -0
  194. package/dist/types/memory.js.map +1 -0
  195. package/dist/types/security.d.ts +67 -0
  196. package/dist/types/security.d.ts.map +1 -0
  197. package/dist/types/security.js +10 -0
  198. package/dist/types/security.js.map +1 -0
  199. package/dist/types/setup.d.ts +54 -0
  200. package/dist/types/setup.d.ts.map +1 -0
  201. package/dist/types/setup.js +9 -0
  202. package/dist/types/setup.js.map +1 -0
  203. package/dist/utils/fhs-mapping.d.ts +76 -0
  204. package/dist/utils/fhs-mapping.d.ts.map +1 -0
  205. package/dist/utils/fhs-mapping.js +189 -0
  206. package/dist/utils/fhs-mapping.js.map +1 -0
  207. package/package.json +58 -0
  208. package/templates/compilers/agent-map.md.hbs +36 -0
  209. package/templates/compilers/claude.md.hbs +95 -0
  210. package/templates/procedural/code-review.md +54 -0
  211. package/templates/procedural/debugging.md +52 -0
@@ -0,0 +1,112 @@
1
+ /**
2
+ * AgentFS Manifest — the heart of kernel space.
3
+ *
4
+ * Lives at `.agentos/manifest.yaml`. Defines what this vault is,
5
+ * which agents are supported, and how directories map to Linux FHS.
6
+ *
7
+ * @see docs/architecture.md Section 2 "Kernel Space"
8
+ */
9
+ /** Vault profile type — determines directory layout and features. */
10
+ export type Profile = 'personal' | 'company' | 'shared';
11
+ /** Supported AI agent runtimes. */
12
+ export type AgentRuntime = 'claude' | 'openclaw' | 'cursor';
13
+ /** Security enforcement mode (AppArmor-style). */
14
+ export type SecurityMode = 'enforce' | 'complain' | 'disabled';
15
+ /**
16
+ * Linux FHS path keys — maps standard Linux paths to vault directories.
17
+ *
18
+ * Each key corresponds to a Linux FHS location:
19
+ * - `tmp` → `/tmp` (Inbox/)
20
+ * - `log` → `/var/log` (Daily/)
21
+ * - `spool` → `/var/spool` (Tasks/)
22
+ * - etc.
23
+ *
24
+ * @see docs/architecture.md Section 11 "FHS Mapping"
25
+ */
26
+ export interface FhsPaths {
27
+ /** /tmp — entry point for new notes */
28
+ tmp: string;
29
+ /** /var/log — daily journals */
30
+ log: string;
31
+ /** /var/spool — task queues */
32
+ spool: string;
33
+ /** /home — active projects */
34
+ home: string;
35
+ /** /srv — content for publishing */
36
+ srv: string;
37
+ /** /usr/share — shared knowledge base */
38
+ usr_share: string;
39
+ /** /proc — active contacts (people) */
40
+ proc_people: string;
41
+ /** /etc — system configuration (.agentos) */
42
+ etc: string;
43
+ /** /var/archive — completed/archived items */
44
+ archive: string;
45
+ /** /home/contracts — client projects (personal profile) */
46
+ home_contracts?: string;
47
+ /** /usr/local/career — job search pipeline (personal profile) */
48
+ usr_local_career?: string;
49
+ /** /home/{user} — professional knowledge base (personal profile) */
50
+ home_user?: string;
51
+ /** /usr/share/media — media assets */
52
+ usr_share_media?: string;
53
+ }
54
+ /** Agent configuration within the manifest. */
55
+ export interface AgentConfig {
56
+ /** Which agent is the primary runtime */
57
+ primary: AgentRuntime;
58
+ /** All supported agents (primary included) */
59
+ supported: AgentRuntime[];
60
+ }
61
+ /** Boot sequence configuration. */
62
+ export interface BootConfig {
63
+ /** Ordered list of init.d/ scripts to load at boot */
64
+ sequence: string[];
65
+ /** Variable substitutions (e.g. `today: "$(date +%F)"`) */
66
+ variables?: Record<string, string>;
67
+ }
68
+ /** Frontmatter standards for vault files. */
69
+ export interface FrontmatterConfig {
70
+ /** Fields that must be present in every file */
71
+ required: string[];
72
+ /** Recommended but optional fields */
73
+ standard?: string[];
74
+ }
75
+ /**
76
+ * Subagent completion status (Superpowers pattern).
77
+ *
78
+ * Written to `.agentos/proc/signals/` as status files for inter-agent communication.
79
+ */
80
+ export type SubagentStatus = 'DONE' | 'DONE_WITH_CONCERNS' | 'BLOCKED' | 'NEEDS_CONTEXT';
81
+ /** Lifecycle hook event names (inspired by OMC's 11-event model). */
82
+ export type HookEvent = 'on-boot' | 'on-shutdown' | 'pre-compile' | 'post-compile' | 'on-commit' | 'on-file-create' | 'on-triage';
83
+ /** Hook configuration — maps events to handler scripts. */
84
+ export interface HooksConfig {
85
+ [event: string]: string[];
86
+ }
87
+ /**
88
+ * The full manifest schema — `.agentos/manifest.yaml`.
89
+ *
90
+ * This is the single source of truth for the vault.
91
+ * The compile pipeline reads this to generate native agent configs.
92
+ */
93
+ export interface Manifest {
94
+ agentos: {
95
+ version: string;
96
+ profile: Profile;
97
+ };
98
+ vault: {
99
+ name: string;
100
+ owner: string;
101
+ created: string;
102
+ };
103
+ agents: AgentConfig;
104
+ paths: FhsPaths;
105
+ boot: BootConfig;
106
+ frontmatter: FrontmatterConfig;
107
+ /** Optional active modules */
108
+ modules?: string[];
109
+ /** Optional lifecycle hooks */
110
+ hooks?: HooksConfig;
111
+ }
112
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/types/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qEAAqE;AACrE,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExD,mCAAmC;AACnC,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE5D,kDAAkD;AAClD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE/D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,QAAQ;IACvB,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,+CAA+C;AAC/C,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,OAAO,EAAE,YAAY,CAAC;IACtB,8CAA8C;IAC9C,SAAS,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED,mCAAmC;AACnC,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED,6CAA6C;AAC7C,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,oBAAoB,GACpB,SAAS,GACT,eAAe,CAAC;AAEpB,qEAAqE;AACrE,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,aAAa,GACb,aAAa,GACb,cAAc,GACd,WAAW,GACX,gBAAgB,GAChB,WAAW,CAAC;AAEhB,2DAA2D;AAC3D,MAAM,WAAW,WAAW;IAC1B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC3B;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,iBAAiB,CAAC;IAC/B,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * AgentFS Manifest — the heart of kernel space.
3
+ *
4
+ * Lives at `.agentos/manifest.yaml`. Defines what this vault is,
5
+ * which agents are supported, and how directories map to Linux FHS.
6
+ *
7
+ * @see docs/architecture.md Section 2 "Kernel Space"
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/types/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Memory types — Tulving's cognitive taxonomy for AI agents.
3
+ *
4
+ * Three memory types:
5
+ * - Semantic: context-free facts (always loaded at boot)
6
+ * - Episodic: timestamped events (lazy-loaded by date)
7
+ * - Procedural: learned skills (lazy-loaded by name)
8
+ *
9
+ * @see docs/architecture.md Section 4 "Boot Sequence"
10
+ */
11
+ /**
12
+ * Semantic memory entry types.
13
+ *
14
+ * - PREF: preferences ("no emoji in headings")
15
+ * - FACT: declarative facts ("[active] primary stack is K8s")
16
+ * - PATTERN: behavioral patterns with confidence ("[confidence:0.85] ...")
17
+ * - AVOID: anti-patterns ("don't suggest LangChain")
18
+ * - DIRECTIVE: imperative rules that must always be followed ("always run tests before commit")
19
+ */
20
+ export type SemanticEntryType = 'PREF' | 'FACT' | 'PATTERN' | 'AVOID' | 'DIRECTIVE';
21
+ /** Status of a semantic entry. */
22
+ export type EntryStatus = 'active' | `superseded:${string}`;
23
+ /**
24
+ * A single entry in semantic memory.
25
+ *
26
+ * Format in `semantic.md`:
27
+ * ```
28
+ * PREF: no emoji in headings
29
+ * FACT: [active] primary stack is Kubernetes + ArgoCD
30
+ * PATTERN: [confidence:0.85] more productive in the morning
31
+ * AVOID: don't suggest LangChain
32
+ * ```
33
+ */
34
+ export interface SemanticEntry {
35
+ type: SemanticEntryType;
36
+ content: string;
37
+ status: EntryStatus;
38
+ /** Confidence score for PATTERN entries (0.0 - 1.0) */
39
+ confidence?: number;
40
+ }
41
+ /**
42
+ * Confidence scoring rules.
43
+ *
44
+ * - New pattern → 0.3
45
+ * - Confirmed → +0.2 (max 1.0)
46
+ * - Denied → -0.3
47
+ * - Inactive 30 days → -0.1 (decay)
48
+ * - Below 0.1 → superseded
49
+ */
50
+ export interface ConfidenceConfig {
51
+ initial: number;
52
+ confirmBoost: number;
53
+ denyPenalty: number;
54
+ decayRate: number;
55
+ decayDays: number;
56
+ supersededThreshold: number;
57
+ }
58
+ /** Default confidence scoring configuration. */
59
+ export declare const DEFAULT_CONFIDENCE: ConfidenceConfig;
60
+ /** Episodic memory entry — one day's events. */
61
+ export interface EpisodicEntry {
62
+ date: string;
63
+ events: string[];
64
+ decisions: string[];
65
+ lessons: string[];
66
+ }
67
+ /**
68
+ * Procedural memory — a learned skill/workflow.
69
+ *
70
+ * Follows SKILL.md pattern: frontmatter with triggers + description,
71
+ * body with steps and context. Agents can auto-match skills by trigger keywords.
72
+ */
73
+ export interface ProceduralEntry {
74
+ name: string;
75
+ description: string;
76
+ steps: string[];
77
+ context: string;
78
+ /** Keywords that trigger this skill (e.g. ["deploy", "kubernetes", "rollout"]) */
79
+ triggers?: string[];
80
+ /** How often this skill was used (for distillation ranking) */
81
+ useCount?: number;
82
+ /** When this skill was last used (ISO date) */
83
+ lastUsed?: string;
84
+ }
85
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/types/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;AAEpF,kCAAkC;AAClC,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,cAAc,MAAM,EAAE,CAAC;AAE5D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;IACpB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,gDAAgD;AAChD,eAAO,MAAM,kBAAkB,EAAE,gBAOhC,CAAC;AAEF,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Memory types — Tulving's cognitive taxonomy for AI agents.
3
+ *
4
+ * Three memory types:
5
+ * - Semantic: context-free facts (always loaded at boot)
6
+ * - Episodic: timestamped events (lazy-loaded by date)
7
+ * - Procedural: learned skills (lazy-loaded by name)
8
+ *
9
+ * @see docs/architecture.md Section 4 "Boot Sequence"
10
+ */
11
+ /** Default confidence scoring configuration. */
12
+ export const DEFAULT_CONFIDENCE = {
13
+ initial: 0.3,
14
+ confirmBoost: 0.2,
15
+ denyPenalty: 0.3,
16
+ decayRate: 0.1,
17
+ decayDays: 30,
18
+ supersededThreshold: 0.1,
19
+ };
20
+ //# sourceMappingURL=memory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/types/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAqDH,gDAAgD;AAChD,MAAM,CAAC,MAAM,kBAAkB,GAAqB;IAClD,OAAO,EAAE,GAAG;IACZ,YAAY,EAAE,GAAG;IACjB,WAAW,EAAE,GAAG;IAChB,SAAS,EAAE,GAAG;IACd,SAAS,EAAE,EAAE;IACb,mBAAmB,EAAE,GAAG;CACzB,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Security types — AppArmor-style Mandatory Access Control for AI agents.
3
+ *
4
+ * The security policy lives at `.agentos/security/policy.yaml`.
5
+ * It compiles into native enforcement rules per agent.
6
+ *
7
+ * @see docs/architecture.md Section 15 "Security Model"
8
+ */
9
+ import type { SecurityMode } from './manifest.js';
10
+ /** File access permission type. */
11
+ export type FilePermission = 'r' | 'w' | 'rw' | 'x';
12
+ /** Action to take on input validation match. */
13
+ export type ValidationAction = 'warn' | 'quarantine' | 'block';
14
+ /** File access control rules. */
15
+ export interface FileAccessPolicy {
16
+ /** Default permission for all files */
17
+ default: FilePermission;
18
+ /** Glob patterns where agent can write freely */
19
+ allow_write: string[];
20
+ /** Glob patterns where agent needs user confirmation to write */
21
+ ask_write: string[];
22
+ /** Glob patterns agent cannot read */
23
+ deny_read: string[];
24
+ /** Glob patterns agent cannot write */
25
+ deny_write: string[];
26
+ }
27
+ /** Prompt injection detection pattern. */
28
+ export interface ValidationPattern {
29
+ pattern: string;
30
+ }
31
+ /** Input validation configuration. */
32
+ export interface InputValidationPolicy {
33
+ enabled: boolean;
34
+ scan_on_read: ValidationPattern[];
35
+ action: ValidationAction;
36
+ quarantine_path: string;
37
+ }
38
+ /** Exfiltration detection pattern. */
39
+ export interface ExfilPattern {
40
+ regex: string;
41
+ }
42
+ /** Network/exfiltration control. */
43
+ export interface NetworkPolicy {
44
+ deny_exfil_patterns: ExfilPattern[];
45
+ allowed_domains: string[];
46
+ }
47
+ /** Command control rules. */
48
+ export interface CommandPolicy {
49
+ blocked: string[];
50
+ ask_before: string[];
51
+ }
52
+ /**
53
+ * Full security policy — `.agentos/security/policy.yaml`.
54
+ *
55
+ * Compiles into native enforcement:
56
+ * - Claude Code → `.claude/settings.json` permissions.deny[]
57
+ * - Others → advisory text in compiled output
58
+ */
59
+ export interface SecurityPolicy {
60
+ version: string;
61
+ default_mode: SecurityMode;
62
+ file_access: FileAccessPolicy;
63
+ input_validation: InputValidationPolicy;
64
+ network: NetworkPolicy;
65
+ commands: CommandPolicy;
66
+ }
67
+ //# sourceMappingURL=security.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/types/security.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,mCAAmC;AACnC,MAAM,MAAM,cAAc,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC;AAEpD,gDAAgD;AAChD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC;AAE/D,iCAAiC;AACjC,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,OAAO,EAAE,cAAc,CAAC;IACxB,iDAAiD;IACjD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,iEAAiE;IACjE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,sCAAsC;IACtC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,uCAAuC;IACvC,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,0CAA0C;AAC1C,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,sCAAsC;AACtC,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,MAAM,EAAE,gBAAgB,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,sCAAsC;AACtC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oCAAoC;AACpC,MAAM,WAAW,aAAa;IAC5B,mBAAmB,EAAE,YAAY,EAAE,CAAC;IACpC,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,6BAA6B;AAC7B,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,gBAAgB,CAAC;IAC9B,gBAAgB,EAAE,qBAAqB,CAAC;IACxC,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,aAAa,CAAC;CACzB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Security types — AppArmor-style Mandatory Access Control for AI agents.
3
+ *
4
+ * The security policy lives at `.agentos/security/policy.yaml`.
5
+ * It compiles into native enforcement rules per agent.
6
+ *
7
+ * @see docs/architecture.md Section 15 "Security Model"
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=security.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security.js","sourceRoot":"","sources":["../../src/types/security.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Setup answers — collected from interactive prompts during `npx create-agentfs`.
3
+ *
4
+ * These answers drive all generators: filesystem, manifest, init.d, memory, etc.
5
+ *
6
+ * @see src/generators/ for consumers of this type
7
+ */
8
+ import type { Profile, AgentRuntime } from './manifest.js';
9
+ /**
10
+ * Answers collected from the interactive setup wizard.
11
+ *
12
+ * Every generator receives this as input — it's the contract
13
+ * between the prompts step and all downstream generators.
14
+ */
15
+ export interface SetupAnswers {
16
+ /** Name of the vault (e.g. "my-notes", "company-kb") */
17
+ vaultName: string;
18
+ /** Owner name (person or team) */
19
+ ownerName: string;
20
+ /** Vault profile type */
21
+ profile: Profile;
22
+ /** Primary AI agent runtime */
23
+ primaryAgent: AgentRuntime;
24
+ /** All supported agent runtimes (includes primary) */
25
+ supportedAgents: AgentRuntime[];
26
+ /** Optional modules to enable */
27
+ modules: string[];
28
+ /** Target directory for the vault (defaults to cwd) */
29
+ targetDir: string;
30
+ }
31
+ /**
32
+ * Result of a single generator's execution.
33
+ * Used for the summary report at the end of scaffolding.
34
+ */
35
+ export interface GeneratorResult {
36
+ /** What the generator created or skipped */
37
+ created: string[];
38
+ /** Files/dirs that already existed and were skipped */
39
+ skipped: string[];
40
+ }
41
+ /**
42
+ * Full scaffold result — aggregates all generator results.
43
+ */
44
+ export interface ScaffoldResult {
45
+ /** Total directories created */
46
+ dirsCreated: number;
47
+ /** Total files created */
48
+ filesCreated: number;
49
+ /** Total items skipped (already existed) */
50
+ itemsSkipped: number;
51
+ /** Per-generator details */
52
+ details: Record<string, GeneratorResult>;
53
+ }
54
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/types/setup.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,+BAA+B;IAC/B,YAAY,EAAE,YAAY,CAAC;IAC3B,sDAAsD;IACtD,eAAe,EAAE,YAAY,EAAE,CAAC;IAChC,iCAAiC;IACjC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,uDAAuD;IACvD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC1C"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Setup answers — collected from interactive prompts during `npx create-agentfs`.
3
+ *
4
+ * These answers drive all generators: filesystem, manifest, init.d, memory, etc.
5
+ *
6
+ * @see src/generators/ for consumers of this type
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/types/setup.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * FHS Mapping Utility — Linux Filesystem Hierarchy Standard to vault path resolver.
3
+ *
4
+ * AgentFS maps standard Linux FHS paths to human-readable vault directories.
5
+ * This module provides per-profile default mappings and a resolution helper.
6
+ *
7
+ * @see docs/architecture.md Section 11 "FHS Mapping"
8
+ * @module fhs-mapping
9
+ */
10
+ import type { FhsPaths, Profile } from '../types/index.js';
11
+ /**
12
+ * Human-readable metadata for every FHS key.
13
+ *
14
+ * Each entry documents:
15
+ * - `linuxPath` — the canonical Linux FHS location this key mirrors
16
+ * - `description` — semantic role in the vault context
17
+ *
18
+ * Agents and tooling can surface these descriptions in help text,
19
+ * validation errors, and generated documentation.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const meta = FHS_DESCRIPTIONS.tmp;
24
+ * // { linuxPath: '/tmp', description: 'Entry point for new notes and captures' }
25
+ * ```
26
+ */
27
+ export declare const FHS_DESCRIPTIONS: Record<keyof Required<FhsPaths>, {
28
+ linuxPath: string;
29
+ description: string;
30
+ }>;
31
+ /**
32
+ * Returns the default FHS → vault directory mapping for a given profile.
33
+ *
34
+ * The returned object is ready to be written into `manifest.yaml` under
35
+ * the `paths:` key. Profile-specific optional paths are included only when
36
+ * they apply to the chosen profile.
37
+ *
38
+ * Profile semantics:
39
+ * - `personal` — solo engineer/creator; includes Work/, Career/, Engineering/
40
+ * - `company` — team vault; home maps to Teams/, srv maps to Clients/
41
+ * - `shared` — multi-user collaborative; home maps to Spaces/, usr_share maps to Shared/
42
+ *
43
+ * @param profile - The vault profile type.
44
+ * @returns A fully-populated `FhsPaths` object with sensible defaults.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const paths = getDefaultPaths('personal');
49
+ * paths.tmp; // 'Inbox'
50
+ * paths.home_contracts; // 'Work'
51
+ * ```
52
+ */
53
+ export declare function getDefaultPaths(profile: Profile): FhsPaths;
54
+ /**
55
+ * Resolves a FHS key to its vault-relative directory path.
56
+ *
57
+ * Looks up `fhsKey` in the provided `paths` object and returns the
58
+ * corresponding vault directory string. Throws a descriptive error when the
59
+ * key is present in the type but absent from the runtime object — this
60
+ * surfaces misconfigured manifests early rather than silently producing
61
+ * `undefined` paths downstream.
62
+ *
63
+ * @param fhsKey - A key from the `FhsPaths` interface (e.g. `'tmp'`, `'home'`).
64
+ * @param paths - The resolved `FhsPaths` instance (e.g. from `manifest.paths`).
65
+ * @returns The vault-relative directory string for the given FHS key.
66
+ * @throws {Error} When `fhsKey` is an optional path not present in `paths`.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const paths = getDefaultPaths('personal');
71
+ * resolveFhsPath('tmp', paths); // 'Inbox'
72
+ * resolveFhsPath('home_contracts', paths); // 'Work'
73
+ * ```
74
+ */
75
+ export declare function resolveFhsPath(fhsKey: keyof FhsPaths, paths: FhsPaths): string;
76
+ //# sourceMappingURL=fhs-mapping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fhs-mapping.d.ts","sourceRoot":"","sources":["../../src/utils/fhs-mapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAM3D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,MAAM,QAAQ,CAAC,QAAQ,CAAC,EACxB;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAsD3C,CAAC;AAMF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,CAkD1D;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,QAAQ,EAAE,KAAK,EAAE,QAAQ,GAAG,MAAM,CAY9E"}