@paperclipai/server 0.2.4 → 0.2.5

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.
@@ -0,0 +1,95 @@
1
+ # Paperclip Create Agent API Reference
2
+
3
+ ## Core Endpoints
4
+
5
+ - `GET /llms/agent-configuration.txt`
6
+ - `GET /llms/agent-configuration/:adapterType.txt`
7
+ - `GET /llms/agent-icons.txt`
8
+ - `GET /api/companies/:companyId/agent-configurations`
9
+ - `GET /api/agents/:agentId/configuration`
10
+ - `POST /api/companies/:companyId/agent-hires`
11
+ - `GET /api/agents/:agentId/config-revisions`
12
+ - `POST /api/agents/:agentId/config-revisions/:revisionId/rollback`
13
+ - `POST /api/issues/:issueId/approvals`
14
+ - `GET /api/approvals/:approvalId/issues`
15
+
16
+ Approval collaboration:
17
+
18
+ - `GET /api/approvals/:approvalId`
19
+ - `POST /api/approvals/:approvalId/request-revision` (board)
20
+ - `POST /api/approvals/:approvalId/resubmit`
21
+ - `GET /api/approvals/:approvalId/comments`
22
+ - `POST /api/approvals/:approvalId/comments`
23
+ - `GET /api/approvals/:approvalId/issues`
24
+
25
+ ## `POST /api/companies/:companyId/agent-hires`
26
+
27
+ Request body matches agent create shape:
28
+
29
+ ```json
30
+ {
31
+ "name": "CTO",
32
+ "role": "cto",
33
+ "title": "Chief Technology Officer",
34
+ "icon": "crown",
35
+ "reportsTo": "uuid-or-null",
36
+ "capabilities": "Owns architecture and engineering execution",
37
+ "adapterType": "claude_local",
38
+ "adapterConfig": {
39
+ "cwd": "/absolute/path",
40
+ "model": "claude-sonnet-4-5-20250929",
41
+ "promptTemplate": "You are CTO..."
42
+ },
43
+ "runtimeConfig": {
44
+ "heartbeat": {
45
+ "enabled": true,
46
+ "intervalSec": 300,
47
+ "wakeOnDemand": true
48
+ }
49
+ },
50
+ "budgetMonthlyCents": 0,
51
+ "sourceIssueId": "uuid-or-null",
52
+ "sourceIssueIds": ["uuid-1", "uuid-2"]
53
+ }
54
+ ```
55
+
56
+ Response:
57
+
58
+ ```json
59
+ {
60
+ "agent": {
61
+ "id": "uuid",
62
+ "status": "pending_approval"
63
+ },
64
+ "approval": {
65
+ "id": "uuid",
66
+ "type": "hire_agent",
67
+ "status": "pending"
68
+ }
69
+ }
70
+ ```
71
+
72
+ If company setting disables required approval, `approval` is `null` and the agent is created as `idle`.
73
+
74
+ ## Approval Lifecycle
75
+
76
+ Statuses:
77
+
78
+ - `pending`
79
+ - `revision_requested`
80
+ - `approved`
81
+ - `rejected`
82
+ - `cancelled`
83
+
84
+ For hire approvals:
85
+
86
+ - approved: linked agent transitions `pending_approval -> idle`
87
+ - rejected: linked agent is terminated
88
+
89
+ ## Safety Notes
90
+
91
+ - Config read APIs redact obvious secrets.
92
+ - `pending_approval` agents cannot run heartbeats, receive assignments, or create keys.
93
+ - All actions are logged in activity for auditability.
94
+ - Use markdown in issue/approval comments and include links to approval, agent, and source issue.
95
+ - After approval resolution, requester may be woken with `PAPERCLIP_APPROVAL_ID` and should reconcile linked issues.
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: para-memory-files
3
+ description: >
4
+ File-based memory system using Tiago Forte's PARA method. Use this skill whenever
5
+ you need to store, retrieve, update, or organize knowledge across sessions. Covers
6
+ three memory layers: (1) Knowledge graph in PARA folders with atomic YAML facts,
7
+ (2) Daily notes as raw timeline, (3) Tacit knowledge about user patterns. Also
8
+ handles planning files, memory decay, weekly synthesis, and recall via qmd.
9
+ Trigger on any memory operation: saving facts, writing daily notes, creating
10
+ entities, running weekly synthesis, recalling past context, or managing plans.
11
+ ---
12
+
13
+ # PARA Memory Files
14
+
15
+ Persistent, file-based memory organized by Tiago Forte's PARA method. Three layers: a knowledge graph, daily notes, and tacit knowledge. All paths are relative to `$AGENT_HOME`.
16
+
17
+ ## Three Memory Layers
18
+
19
+ ### Layer 1: Knowledge Graph (`$AGENT_HOME/life/` -- PARA)
20
+
21
+ Entity-based storage. Each entity gets a folder with two tiers:
22
+
23
+ 1. `summary.md` -- quick context, load first.
24
+ 2. `items.yaml` -- atomic facts, load on demand.
25
+
26
+ ```text
27
+ $AGENT_HOME/life/
28
+ projects/ # Active work with clear goals/deadlines
29
+ <name>/
30
+ summary.md
31
+ items.yaml
32
+ areas/ # Ongoing responsibilities, no end date
33
+ people/<name>/
34
+ companies/<name>/
35
+ resources/ # Reference material, topics of interest
36
+ <topic>/
37
+ archives/ # Inactive items from the other three
38
+ index.md
39
+ ```
40
+
41
+ **PARA rules:**
42
+
43
+ - **Projects** -- active work with a goal or deadline. Move to archives when complete.
44
+ - **Areas** -- ongoing (people, companies, responsibilities). No end date.
45
+ - **Resources** -- reference material, topics of interest.
46
+ - **Archives** -- inactive items from any category.
47
+
48
+ **Fact rules:**
49
+
50
+ - Save durable facts immediately to `items.yaml`.
51
+ - Weekly: rewrite `summary.md` from active facts.
52
+ - Never delete facts. Supersede instead (`status: superseded`, add `superseded_by`).
53
+ - When an entity goes inactive, move its folder to `$AGENT_HOME/life/archives/`.
54
+
55
+ **When to create an entity:**
56
+
57
+ - Mentioned 3+ times, OR
58
+ - Direct relationship to the user (family, coworker, partner, client), OR
59
+ - Significant project or company in the user's life.
60
+ - Otherwise, note it in daily notes.
61
+
62
+ For the atomic fact YAML schema and memory decay rules, see [references/schemas.md](references/schemas.md).
63
+
64
+ ### Layer 2: Daily Notes (`$AGENT_HOME/memory/YYYY-MM-DD.md`)
65
+
66
+ Raw timeline of events -- the "when" layer.
67
+
68
+ - Write continuously during conversations.
69
+ - Extract durable facts to Layer 1 during heartbeats.
70
+
71
+ ### Layer 3: Tacit Knowledge (`$AGENT_HOME/MEMORY.md`)
72
+
73
+ How the user operates -- patterns, preferences, lessons learned.
74
+
75
+ - Not facts about the world; facts about the user.
76
+ - Update whenever you learn new operating patterns.
77
+
78
+ ## Write It Down -- No Mental Notes
79
+
80
+ Memory does not survive session restarts. Files do.
81
+
82
+ - Want to remember something -> WRITE IT TO A FILE.
83
+ - "Remember this" -> update `$AGENT_HOME/memory/YYYY-MM-DD.md` or the relevant entity file.
84
+ - Learn a lesson -> update AGENTS.md, TOOLS.md, or the relevant skill file.
85
+ - Make a mistake -> document it so future-you does not repeat it.
86
+ - On-disk text files are always better than holding it in temporary context.
87
+
88
+ ## Memory Recall -- Use qmd
89
+
90
+ Use `qmd` rather than grepping files:
91
+
92
+ ```bash
93
+ qmd query "what happened at Christmas" # Semantic search with reranking
94
+ qmd search "specific phrase" # BM25 keyword search
95
+ qmd vsearch "conceptual question" # Pure vector similarity
96
+ ```
97
+
98
+ Index your personal folder: `qmd index $AGENT_HOME`
99
+
100
+ Vectors + BM25 + reranking finds things even when the wording differs.
101
+
102
+ ## Planning
103
+
104
+ Keep plans in timestamped files in `plans/` at the project root (outside personal memory so other agents can access them). Use `qmd` to search plans. Plans go stale -- if a newer plan exists, do not confuse yourself with an older version. If you notice staleness, update the file to note what it is supersededBy.
@@ -0,0 +1,35 @@
1
+ # Schemas and Memory Decay
2
+
3
+ ## Atomic Fact Schema (items.yaml)
4
+
5
+ ```yaml
6
+ - id: entity-001
7
+ fact: "The actual fact"
8
+ category: relationship | milestone | status | preference
9
+ timestamp: "YYYY-MM-DD"
10
+ source: "YYYY-MM-DD"
11
+ status: active # active | superseded
12
+ superseded_by: null # e.g. entity-002
13
+ related_entities:
14
+ - companies/acme
15
+ - people/jeff
16
+ last_accessed: "YYYY-MM-DD"
17
+ access_count: 0
18
+ ```
19
+
20
+ ## Memory Decay
21
+
22
+ Facts decay in retrieval priority over time so stale info does not crowd out recent context.
23
+
24
+ **Access tracking:** When a fact is used in conversation, bump `access_count` and set `last_accessed` to today. During heartbeat extraction, scan the session for referenced entity facts and update their access metadata.
25
+
26
+ **Recency tiers (for summary.md rewriting):**
27
+
28
+ - **Hot** (accessed in last 7 days) -- include prominently in summary.md.
29
+ - **Warm** (8-30 days ago) -- include at lower priority.
30
+ - **Cold** (30+ days or never accessed) -- omit from summary.md. Still in items.yaml, retrievable on demand.
31
+ - High `access_count` resists decay -- frequently used facts stay warm longer.
32
+
33
+ **Weekly synthesis:** Sort by recency tier, then by access_count within tier. Cold facts drop out of the summary but remain in items.yaml. Accessing a cold fact reheats it.
34
+
35
+ No deletion. Decay only affects retrieval priority via summary.md curation. The full record always lives in items.yaml.