better-notion 1.6.0__py3-none-any.whl → 1.8.0__py3-none-any.whl
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.
- better_notion/_cli/docs/base.py +9 -1
- better_notion/plugins/official/agents.py +168 -30
- better_notion/plugins/official/agents_schema.py +648 -37
- {better_notion-1.6.0.dist-info → better_notion-1.8.0.dist-info}/METADATA +1 -1
- {better_notion-1.6.0.dist-info → better_notion-1.8.0.dist-info}/RECORD +8 -8
- {better_notion-1.6.0.dist-info → better_notion-1.8.0.dist-info}/WHEEL +0 -0
- {better_notion-1.6.0.dist-info → better_notion-1.8.0.dist-info}/entry_points.txt +0 -0
- {better_notion-1.6.0.dist-info → better_notion-1.8.0.dist-info}/licenses/LICENSE +0 -0
better_notion/_cli/docs/base.py
CHANGED
|
@@ -138,6 +138,7 @@ class Command:
|
|
|
138
138
|
workflow: Which workflow this command belongs to
|
|
139
139
|
when_to_use: When this command should be used
|
|
140
140
|
error_recovery: Error handling strategies
|
|
141
|
+
subcommands: Dict of subcommand name -> subcommand documentation
|
|
141
142
|
"""
|
|
142
143
|
|
|
143
144
|
name: str
|
|
@@ -147,10 +148,11 @@ class Command:
|
|
|
147
148
|
workflow: str | None = None
|
|
148
149
|
when_to_use: list[str] = field(default_factory=list)
|
|
149
150
|
error_recovery: dict[str, dict[str, Any]] = field(default_factory=dict)
|
|
151
|
+
subcommands: dict[str, dict[str, Any]] = field(default_factory=dict)
|
|
150
152
|
|
|
151
153
|
def to_dict(self) -> dict[str, Any]:
|
|
152
154
|
"""Convert to dictionary for JSON serialization."""
|
|
153
|
-
|
|
155
|
+
result = {
|
|
154
156
|
"name": self.name,
|
|
155
157
|
"purpose": self.purpose,
|
|
156
158
|
"description": self.description,
|
|
@@ -160,6 +162,12 @@ class Command:
|
|
|
160
162
|
"error_recovery": self.error_recovery,
|
|
161
163
|
}
|
|
162
164
|
|
|
165
|
+
# Add subcommands if present
|
|
166
|
+
if self.subcommands:
|
|
167
|
+
result["subcommands"] = self.subcommands
|
|
168
|
+
|
|
169
|
+
return result
|
|
170
|
+
|
|
163
171
|
|
|
164
172
|
@dataclass
|
|
165
173
|
class Schema:
|
|
@@ -169,22 +169,93 @@ class AgentsPlugin(CombinedPluginInterface):
|
|
|
169
169
|
"state": "already_initialized",
|
|
170
170
|
"description": "Agents workspace already exists in this page",
|
|
171
171
|
},
|
|
172
|
+
"hierarchy": {
|
|
173
|
+
"description": "Agents workflow hierarchy",
|
|
174
|
+
"levels": [
|
|
175
|
+
{
|
|
176
|
+
"level": 1,
|
|
177
|
+
"entity": "Organization",
|
|
178
|
+
"database": "organizations",
|
|
179
|
+
"required_before": ["Projects"]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"level": 2,
|
|
183
|
+
"entity": "Project",
|
|
184
|
+
"database": "projects",
|
|
185
|
+
"required_before": ["Versions", "Tasks"],
|
|
186
|
+
"requires": ["Organization"]
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"level": 3,
|
|
190
|
+
"entity": "Version",
|
|
191
|
+
"database": "versions",
|
|
192
|
+
"required_before": ["Tasks"],
|
|
193
|
+
"requires": ["Project"]
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"level": 4,
|
|
197
|
+
"entity": "Task",
|
|
198
|
+
"database": "tasks",
|
|
199
|
+
"requires": ["Version"]
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
},
|
|
172
203
|
"next_steps": [
|
|
173
204
|
{
|
|
174
|
-
"action": "
|
|
175
|
-
"command":
|
|
176
|
-
"purpose": "
|
|
205
|
+
"action": "check_organizations",
|
|
206
|
+
"command": "notion agents orgs list",
|
|
207
|
+
"purpose": "Check if organizations exist",
|
|
208
|
+
"why": "Organizations are the starting point - create them first"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"action": "create_organization",
|
|
212
|
+
"command": "notion agents orgs create --name 'Organization Name'",
|
|
213
|
+
"purpose": "Create a new organization",
|
|
214
|
+
"when": "If no organizations exist",
|
|
215
|
+
"examples": [
|
|
216
|
+
"notion agents orgs create --name 'WareflowX'",
|
|
217
|
+
"notion agents orgs create --name 'WareflowX' --slug 'wareflowx'"
|
|
218
|
+
]
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"action": "create_project",
|
|
222
|
+
"command": "notion agents projects create --org 'Org Name' --name 'Project Name'",
|
|
223
|
+
"purpose": "Create a project in an organization",
|
|
224
|
+
"requires": ["organization_exists"],
|
|
225
|
+
"examples": [
|
|
226
|
+
"notion agents projects create --org 'WareflowX' --name 'Website Redesign'"
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"action": "create_version",
|
|
231
|
+
"command": "notion agents versions create --project 'Project' --name 'v1.0.0'",
|
|
232
|
+
"purpose": "Create a version in a project",
|
|
233
|
+
"requires": ["project_exists"],
|
|
177
234
|
},
|
|
178
235
|
{
|
|
179
236
|
"action": "create_task",
|
|
180
|
-
"
|
|
237
|
+
"command": "notion agents tasks create --version 'v1.0.0' --name 'Task Name'",
|
|
238
|
+
"purpose": "Create a task in a version",
|
|
239
|
+
"requires": ["version_exists"],
|
|
181
240
|
},
|
|
182
241
|
],
|
|
183
242
|
"capabilities": [
|
|
243
|
+
"create_organizations",
|
|
244
|
+
"create_projects",
|
|
245
|
+
"create_versions",
|
|
184
246
|
"create_tasks",
|
|
185
|
-
"
|
|
186
|
-
"
|
|
247
|
+
"manage_ideas",
|
|
248
|
+
"track_work_issues",
|
|
249
|
+
"manage_incidents",
|
|
187
250
|
],
|
|
251
|
+
"quick_reference": {
|
|
252
|
+
"lifecycle": "Organization → Project → Version → Task",
|
|
253
|
+
"create_org": "notion agents orgs create --name NAME",
|
|
254
|
+
"list_orgs": "notion agents orgs list",
|
|
255
|
+
"create_project": "notion agents projects create --org ORG --name NAME",
|
|
256
|
+
"create_version": "notion agents versions create --project PROJECT --name VERSION",
|
|
257
|
+
"create_task": "notion agents tasks create --version VERSION --name TASK",
|
|
258
|
+
}
|
|
188
259
|
}
|
|
189
260
|
)
|
|
190
261
|
except Exception:
|
|
@@ -212,40 +283,107 @@ class AgentsPlugin(CombinedPluginInterface):
|
|
|
212
283
|
"description": "Agents workspace ready for task management",
|
|
213
284
|
"workspace_name": workspace_name,
|
|
214
285
|
},
|
|
286
|
+
"hierarchy": {
|
|
287
|
+
"description": "Agents workflow hierarchy - follow this order",
|
|
288
|
+
"lifecycle": "Organization → Project → Version → Task",
|
|
289
|
+
"levels": [
|
|
290
|
+
{
|
|
291
|
+
"level": 1,
|
|
292
|
+
"entity": "Organization",
|
|
293
|
+
"database": "organizations",
|
|
294
|
+
"command": "notion agents orgs create --name 'Org Name'",
|
|
295
|
+
"next": "Projects"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"level": 2,
|
|
299
|
+
"entity": "Project",
|
|
300
|
+
"database": "projects",
|
|
301
|
+
"command": "notion agents projects create --org 'Org' --name 'Project'",
|
|
302
|
+
"requires": ["Organization"],
|
|
303
|
+
"next": "Versions"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"level": 3,
|
|
307
|
+
"entity": "Version",
|
|
308
|
+
"database": "versions",
|
|
309
|
+
"command": "notion agents versions create --project 'Project' --name 'v1.0.0'",
|
|
310
|
+
"requires": ["Project"],
|
|
311
|
+
"next": "Tasks"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"level": 4,
|
|
315
|
+
"entity": "Task",
|
|
316
|
+
"database": "tasks",
|
|
317
|
+
"command": "notion agents tasks create --version 'v1.0.0' --name 'Task'",
|
|
318
|
+
"requires": ["Version"]
|
|
319
|
+
}
|
|
320
|
+
]
|
|
321
|
+
},
|
|
215
322
|
"next_steps": [
|
|
216
323
|
{
|
|
217
|
-
"
|
|
218
|
-
"
|
|
219
|
-
"
|
|
324
|
+
"action": "first_create_organization",
|
|
325
|
+
"priority": 1,
|
|
326
|
+
"command": "notion agents orgs create --name 'Your Organization Name'",
|
|
327
|
+
"purpose": "Create your first organization (required before projects)",
|
|
328
|
+
"why": "Organizations are the top-level entity - all projects belong to an organization",
|
|
329
|
+
"examples": [
|
|
330
|
+
"notion agents orgs create --name 'WareflowX'",
|
|
331
|
+
"notion agents orgs create --name 'WareflowX' --slug 'wareflowx'"
|
|
332
|
+
]
|
|
220
333
|
},
|
|
221
334
|
{
|
|
222
|
-
"
|
|
223
|
-
"
|
|
224
|
-
"
|
|
335
|
+
"action": "then_create_project",
|
|
336
|
+
"priority": 2,
|
|
337
|
+
"command": "notion agents projects create --org 'Org Name' --name 'Project Name'",
|
|
338
|
+
"purpose": "Create a project in the organization",
|
|
339
|
+
"requires": ["organization_exists"],
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"action": "then_create_version",
|
|
343
|
+
"priority": 3,
|
|
344
|
+
"command": "notion agents versions create --project 'Project' --name 'v1.0.0'",
|
|
345
|
+
"purpose": "Create a version in the project",
|
|
346
|
+
"requires": ["project_exists"],
|
|
225
347
|
},
|
|
226
|
-
],
|
|
227
|
-
"capabilities": [
|
|
228
|
-
"create_tasks",
|
|
229
|
-
"manage_versions",
|
|
230
|
-
"track_projects",
|
|
231
|
-
"manage_ideas",
|
|
232
|
-
"track_incidents",
|
|
233
|
-
],
|
|
234
|
-
"common_workflows": [
|
|
235
348
|
{
|
|
236
|
-
"
|
|
237
|
-
"
|
|
238
|
-
"command":
|
|
349
|
+
"action": "then_create_tasks",
|
|
350
|
+
"priority": 4,
|
|
351
|
+
"command": "notion agents tasks create --version 'v1.0.0' --name 'Task Name'",
|
|
352
|
+
"purpose": "Create tasks in the version",
|
|
353
|
+
"requires": ["version_exists"],
|
|
239
354
|
},
|
|
240
355
|
{
|
|
241
|
-
"
|
|
242
|
-
"
|
|
243
|
-
"
|
|
244
|
-
|
|
245
|
-
f"notion pages create --parent {database_ids.get('tasks', 'TASKS_DB_ID')} --title 'Task Name' --properties '{{\"Status\": \"Todo\", \"Version\": \"VERSION_ID\"}}'",
|
|
246
|
-
],
|
|
356
|
+
"action": "verify_setup",
|
|
357
|
+
"command": "agents info --parent-page " + parent_page_id,
|
|
358
|
+
"purpose": "View workspace status and database IDs",
|
|
359
|
+
"when": "Anytime to verify setup",
|
|
247
360
|
},
|
|
248
361
|
],
|
|
362
|
+
"capabilities": [
|
|
363
|
+
"create_organizations",
|
|
364
|
+
"create_projects",
|
|
365
|
+
"create_versions",
|
|
366
|
+
"create_tasks",
|
|
367
|
+
"manage_ideas",
|
|
368
|
+
"track_work_issues",
|
|
369
|
+
"manage_incidents",
|
|
370
|
+
],
|
|
371
|
+
"quick_start": {
|
|
372
|
+
"description": "Quick start guide - create your first workflow",
|
|
373
|
+
"steps": [
|
|
374
|
+
"1. Create organization: notion agents orgs create --name 'WareflowX'",
|
|
375
|
+
"2. Create project: notion agents projects create --org 'WareflowX' --name 'Website Redesign'",
|
|
376
|
+
"3. Create version: notion agents versions create --project 'Website Redesign' --name 'v1.0.0'",
|
|
377
|
+
"4. Create task: notion agents tasks create --version 'v1.0.0' --name 'Fix login bug'"
|
|
378
|
+
]
|
|
379
|
+
},
|
|
380
|
+
"quick_reference": {
|
|
381
|
+
"list_orgs": "notion agents orgs list",
|
|
382
|
+
"list_projects": "notion agents projects list",
|
|
383
|
+
"list_versions": "notion agents versions list --project 'Project'",
|
|
384
|
+
"list_tasks": "notion agents tasks list --version 'v1.0.0'",
|
|
385
|
+
"find_next_task": "notion agents tasks next --version 'v1.0.0'"
|
|
386
|
+
}
|
|
249
387
|
}
|
|
250
388
|
)
|
|
251
389
|
|
|
@@ -5,6 +5,15 @@ system that AI agents can consume to understand how to work with the system.
|
|
|
5
5
|
|
|
6
6
|
This is the SINGLE SOURCE OF TRUTH for agents documentation. All other
|
|
7
7
|
documentation (CLI help, website, etc.) should be derived from this schema.
|
|
8
|
+
|
|
9
|
+
IMPORTANT - Command signatures use IDs not names:
|
|
10
|
+
- Organization creation: --name (name), --slug (optional)
|
|
11
|
+
- Project creation: --name, --org-id (requires organization PAGE ID)
|
|
12
|
+
- Version creation: --name, --project-id (requires project PAGE ID)
|
|
13
|
+
- Task creation: --title, --version-id (requires version PAGE ID)
|
|
14
|
+
|
|
15
|
+
You must get entity IDs from previous command responses before creating
|
|
16
|
+
child entities.
|
|
8
17
|
"""
|
|
9
18
|
|
|
10
19
|
from better_notion._cli.docs.base import (
|
|
@@ -15,6 +24,172 @@ from better_notion._cli.docs.base import (
|
|
|
15
24
|
WorkflowStep,
|
|
16
25
|
)
|
|
17
26
|
|
|
27
|
+
# =============================================================================
|
|
28
|
+
# DATABASE SCHEMAS
|
|
29
|
+
# =============================================================================
|
|
30
|
+
|
|
31
|
+
ORGANIZATIONS_DB_SCHEMA = {
|
|
32
|
+
"title": "Organizations",
|
|
33
|
+
"property_types": {
|
|
34
|
+
"Name": {
|
|
35
|
+
"type": "title",
|
|
36
|
+
"required": True,
|
|
37
|
+
"description": "Organization name"
|
|
38
|
+
},
|
|
39
|
+
"Slug": {
|
|
40
|
+
"type": "rich_text",
|
|
41
|
+
"required": False,
|
|
42
|
+
"description": "URL-friendly identifier"
|
|
43
|
+
},
|
|
44
|
+
"Status": {
|
|
45
|
+
"type": "select",
|
|
46
|
+
"required": False,
|
|
47
|
+
"options": ["Active", "Inactive"],
|
|
48
|
+
"default": "Active"
|
|
49
|
+
},
|
|
50
|
+
"Website": {
|
|
51
|
+
"type": "url",
|
|
52
|
+
"required": False,
|
|
53
|
+
"description": "Organization website URL"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"example_creation": {
|
|
57
|
+
"command": "notion agents orgs create --name 'WareflowX' --slug 'wareflowx'",
|
|
58
|
+
"properties": {
|
|
59
|
+
"Name": "WareflowX",
|
|
60
|
+
"Slug": "wareflowx",
|
|
61
|
+
"Status": "Active"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
PROJECTS_DB_SCHEMA = {
|
|
67
|
+
"title": "Projects",
|
|
68
|
+
"property_types": {
|
|
69
|
+
"Name": {
|
|
70
|
+
"type": "title",
|
|
71
|
+
"required": True,
|
|
72
|
+
"description": "Project name"
|
|
73
|
+
},
|
|
74
|
+
"Organization": {
|
|
75
|
+
"type": "relation",
|
|
76
|
+
"required": True,
|
|
77
|
+
"target": "Organizations",
|
|
78
|
+
"description": "Organization this project belongs to (requires org PAGE ID)"
|
|
79
|
+
},
|
|
80
|
+
"Status": {
|
|
81
|
+
"type": "select",
|
|
82
|
+
"required": False,
|
|
83
|
+
"options": ["Active", "On Hold", "Completed", "Archived"],
|
|
84
|
+
"default": "Active"
|
|
85
|
+
},
|
|
86
|
+
"Description": {
|
|
87
|
+
"type": "rich_text",
|
|
88
|
+
"required": False,
|
|
89
|
+
"description": "Project description"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"example_creation": {
|
|
93
|
+
"command": "notion agents projects create --name 'Website Redesign' --org-id ORG_PAGE_ID",
|
|
94
|
+
"properties": {
|
|
95
|
+
"Name": "Website Redesign",
|
|
96
|
+
"Organization": "ORG_PAGE_ID",
|
|
97
|
+
"Status": "Active"
|
|
98
|
+
},
|
|
99
|
+
"note": "ORG_PAGE_ID comes from 'notion agents orgs create' response (id field)"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
VERSIONS_DB_SCHEMA = {
|
|
104
|
+
"title": "Versions",
|
|
105
|
+
"property_types": {
|
|
106
|
+
"Name": {
|
|
107
|
+
"type": "title",
|
|
108
|
+
"required": True,
|
|
109
|
+
"description": "Version name (e.g., v1.0.0)"
|
|
110
|
+
},
|
|
111
|
+
"Project": {
|
|
112
|
+
"type": "relation",
|
|
113
|
+
"required": True,
|
|
114
|
+
"target": "Projects",
|
|
115
|
+
"description": "Project this version belongs to (requires project PAGE ID)"
|
|
116
|
+
},
|
|
117
|
+
"Status": {
|
|
118
|
+
"type": "select",
|
|
119
|
+
"required": False,
|
|
120
|
+
"options": ["Planning", "In Progress", "Released", "Archived"],
|
|
121
|
+
"default": "Planning"
|
|
122
|
+
},
|
|
123
|
+
"Release Date": {
|
|
124
|
+
"type": "date",
|
|
125
|
+
"required": False,
|
|
126
|
+
"description": "Planned or actual release date"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"example_creation": {
|
|
130
|
+
"command": "notion agents versions create --name 'v1.0.0' --project-id PROJECT_PAGE_ID",
|
|
131
|
+
"properties": {
|
|
132
|
+
"Name": "v1.0.0",
|
|
133
|
+
"Project": "PROJECT_PAGE_ID",
|
|
134
|
+
"Status": "Planning"
|
|
135
|
+
},
|
|
136
|
+
"note": "PROJECT_PAGE_ID comes from 'notion agents projects create' response (id field)"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
TASKS_DB_SCHEMA = {
|
|
141
|
+
"title": "Tasks",
|
|
142
|
+
"property_types": {
|
|
143
|
+
"Name": {
|
|
144
|
+
"type": "title",
|
|
145
|
+
"required": True,
|
|
146
|
+
"description": "Task name"
|
|
147
|
+
},
|
|
148
|
+
"Status": {
|
|
149
|
+
"type": "select",
|
|
150
|
+
"required": True,
|
|
151
|
+
"options": ["Backlog", "Claimed", "In Progress", "Completed", "Cancelled"],
|
|
152
|
+
"default": "Backlog"
|
|
153
|
+
},
|
|
154
|
+
"Version": {
|
|
155
|
+
"type": "relation",
|
|
156
|
+
"required": True,
|
|
157
|
+
"target": "Versions",
|
|
158
|
+
"description": "Version this task belongs to (requires version PAGE ID)"
|
|
159
|
+
},
|
|
160
|
+
"Dependencies": {
|
|
161
|
+
"type": "relation",
|
|
162
|
+
"required": False,
|
|
163
|
+
"target": "Tasks",
|
|
164
|
+
"dual_property": "Dependent Tasks",
|
|
165
|
+
"description": "Tasks that must complete before this task"
|
|
166
|
+
},
|
|
167
|
+
"Dependent Tasks": {
|
|
168
|
+
"type": "relation",
|
|
169
|
+
"required": False,
|
|
170
|
+
"target": "Tasks",
|
|
171
|
+
"dual_property": "Dependencies",
|
|
172
|
+
"description": "Tasks blocked by this task"
|
|
173
|
+
},
|
|
174
|
+
"Priority": {
|
|
175
|
+
"type": "select",
|
|
176
|
+
"required": False,
|
|
177
|
+
"options": ["Low", "Medium", "High", "Critical"],
|
|
178
|
+
"default": "Medium"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"example_creation": {
|
|
182
|
+
"command": "notion agents tasks create --title 'Fix login bug' --version-id VERSION_PAGE_ID",
|
|
183
|
+
"properties": {
|
|
184
|
+
"Name": "Fix login bug",
|
|
185
|
+
"Status": "Backlog",
|
|
186
|
+
"Version": "VERSION_PAGE_ID",
|
|
187
|
+
"Priority": "High"
|
|
188
|
+
},
|
|
189
|
+
"note": "VERSION_PAGE_ID comes from 'notion agents versions create' response (id field)"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
18
193
|
# =============================================================================
|
|
19
194
|
# CONCEPTS
|
|
20
195
|
# =============================================================================
|
|
@@ -50,25 +225,57 @@ WORKSPACE_CONCEPT = Concept(
|
|
|
50
225
|
},
|
|
51
226
|
)
|
|
52
227
|
|
|
228
|
+
ORGANIZATION_CONCEPT = Concept(
|
|
229
|
+
name="organization",
|
|
230
|
+
description=(
|
|
231
|
+
"An organization represents a company, team, or entity that owns projects. "
|
|
232
|
+
"Organizations are the top-level entities in the agents workflow hierarchy."
|
|
233
|
+
),
|
|
234
|
+
properties={
|
|
235
|
+
"database_schema": ORGANIZATIONS_DB_SCHEMA,
|
|
236
|
+
"creation": {
|
|
237
|
+
"command": "notion agents orgs create --name 'Org Name' --slug 'org-slug'",
|
|
238
|
+
"returns": "JSON with 'id' field containing organization PAGE ID",
|
|
239
|
+
"required_flags": {"--name": "Organization name (required)"},
|
|
240
|
+
"optional_flags": {
|
|
241
|
+
"--slug": "URL-friendly identifier (optional)",
|
|
242
|
+
"--description": "Organization description (optional)",
|
|
243
|
+
"--repository-url": "Git repository URL (optional)",
|
|
244
|
+
"--status": "Active or Inactive (default: Active)"
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"listing": {
|
|
248
|
+
"command": "notion agents orgs list",
|
|
249
|
+
"description": "List all organizations in workspace",
|
|
250
|
+
"returns": "JSON array of organizations with id, name, slug, status"
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
relationships={
|
|
254
|
+
"Projects": "One-to-many - organization contains multiple projects",
|
|
255
|
+
"description": "All projects must belong to an organization",
|
|
256
|
+
},
|
|
257
|
+
)
|
|
258
|
+
|
|
53
259
|
TASK_CONCEPT = Concept(
|
|
54
260
|
name="task",
|
|
55
261
|
description=(
|
|
56
262
|
"A task represents a unit of work that needs to be completed as part of "
|
|
57
|
-
"a project version. Tasks have states (
|
|
263
|
+
"a project version. Tasks have states (Backlog, Claimed, In Progress, Completed) "
|
|
58
264
|
"and can depend on other tasks."
|
|
59
265
|
),
|
|
60
266
|
properties={
|
|
61
267
|
"required_properties": {
|
|
62
268
|
"Title": "Task name (title property)",
|
|
63
|
-
"Status": "Current state:
|
|
64
|
-
"Version": "Relation to Version database (
|
|
269
|
+
"Status": "Current state: Backlog, Claimed, In Progress, Completed, Cancelled",
|
|
270
|
+
"Version": "Relation to Version database (requires version PAGE ID)",
|
|
65
271
|
},
|
|
66
272
|
"optional_properties": {
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
273
|
+
"Type": "Task type: New Feature, Bug Fix, Refactor, Documentation, Testing, Other",
|
|
274
|
+
"Priority": "Low, Medium, High, Critical",
|
|
275
|
+
"Dependencies": "Other tasks this task depends on (comma-separated task IDs)",
|
|
276
|
+
"Estimated Hours": "Time estimate in hours",
|
|
70
277
|
},
|
|
71
|
-
"workflow": "
|
|
278
|
+
"workflow": "Backlog → Claimed → In Progress → Completed",
|
|
72
279
|
},
|
|
73
280
|
relationships={
|
|
74
281
|
"Version": "Required - each task must belong to one version",
|
|
@@ -85,13 +292,20 @@ PROJECT_CONCEPT = Concept(
|
|
|
85
292
|
),
|
|
86
293
|
properties={
|
|
87
294
|
"required_properties": {
|
|
88
|
-
"
|
|
89
|
-
"Organization": "
|
|
295
|
+
"Name": "Project name",
|
|
296
|
+
"Organization ID": "Organization PAGE ID from 'agents orgs create' response",
|
|
297
|
+
},
|
|
298
|
+
"optional_properties": {
|
|
299
|
+
"Slug": "URL-friendly identifier",
|
|
300
|
+
"Description": "Project description",
|
|
301
|
+
"Repository": "Git repository URL",
|
|
302
|
+
"Tech Stack": "Comma-separated technologies",
|
|
303
|
+
"Role": "Project role: Developer, Designer, PM, QA, DevOps (default: Developer)",
|
|
90
304
|
},
|
|
91
305
|
"contains": ["Versions", "Tasks", "Ideas", "Work Issues", "Incidents"],
|
|
92
306
|
},
|
|
93
307
|
relationships={
|
|
94
|
-
"Organization": "Required - each project belongs to one organization",
|
|
308
|
+
"Organization": "Required - each project belongs to one organization (via org-id)",
|
|
95
309
|
"Versions": "One-to-many - project contains multiple versions",
|
|
96
310
|
},
|
|
97
311
|
)
|
|
@@ -104,14 +318,20 @@ VERSION_CONCEPT = Concept(
|
|
|
104
318
|
),
|
|
105
319
|
properties={
|
|
106
320
|
"required_properties": {
|
|
107
|
-
"
|
|
108
|
-
"Project": "
|
|
321
|
+
"Name": "Version name (e.g., v1.0.0)",
|
|
322
|
+
"Project ID": "Project PAGE ID from 'agents projects create' response",
|
|
323
|
+
},
|
|
324
|
+
"optional_properties": {
|
|
325
|
+
"Status": "Planning, In Progress, Released, Archived (default: Planning)",
|
|
326
|
+
"Type": "Major, Minor, Patch, Hotfix (default: Minor)",
|
|
327
|
+
"Branch": "Git branch name",
|
|
328
|
+
"Progress": "Progress percentage 0-100 (default: 0)",
|
|
109
329
|
},
|
|
110
330
|
"contains": ["Tasks"],
|
|
111
331
|
"examples": ["v1.0.0", "v1.1.0", "v2.0.0-beta", "sprint-1"],
|
|
112
332
|
},
|
|
113
333
|
relationships={
|
|
114
|
-
"Project": "Required - each version belongs to one project",
|
|
334
|
+
"Project": "Required - each version belongs to one project (via project-id)",
|
|
115
335
|
"Tasks": "One-to-many - version contains multiple tasks",
|
|
116
336
|
},
|
|
117
337
|
)
|
|
@@ -198,6 +418,122 @@ INITIALIZE_WORKSPACE = Workflow(
|
|
|
198
418
|
},
|
|
199
419
|
)
|
|
200
420
|
|
|
421
|
+
CREATE_ORGANIZATION_WORKFLOW = Workflow(
|
|
422
|
+
name="create_organization",
|
|
423
|
+
description="Create a new organization in the agents workspace",
|
|
424
|
+
steps=[
|
|
425
|
+
WorkflowStep(
|
|
426
|
+
description="Verify workspace is initialized",
|
|
427
|
+
command="agents info --parent-page PAGE_ID",
|
|
428
|
+
purpose="Get Organizations database ID and verify workspace exists",
|
|
429
|
+
),
|
|
430
|
+
WorkflowStep(
|
|
431
|
+
description="Create organization using agents command",
|
|
432
|
+
command="notion agents orgs create --name 'Org Name' --slug 'org-slug'",
|
|
433
|
+
purpose="Create organization with proper properties",
|
|
434
|
+
),
|
|
435
|
+
],
|
|
436
|
+
commands=[
|
|
437
|
+
"agents info --parent-page PAGE_ID",
|
|
438
|
+
"notion agents orgs create --name 'WareflowX' --slug 'wareflowx'",
|
|
439
|
+
],
|
|
440
|
+
prerequisites=["workspace_initialized"],
|
|
441
|
+
error_recovery={
|
|
442
|
+
"workspace_not_found": {
|
|
443
|
+
"message": "No workspace detected in page",
|
|
444
|
+
"solution": "Run 'agents init --parent-page PAGE_ID' first to create workspace",
|
|
445
|
+
},
|
|
446
|
+
"missing_name": {
|
|
447
|
+
"message": "Organization name is required",
|
|
448
|
+
"solution": "Always specify --name flag when creating organization",
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
)
|
|
452
|
+
|
|
453
|
+
CREATE_PROJECT_WORKFLOW = Workflow(
|
|
454
|
+
name="create_project",
|
|
455
|
+
description="Create a new project in an organization",
|
|
456
|
+
steps=[
|
|
457
|
+
WorkflowStep(
|
|
458
|
+
description="Verify workspace is initialized",
|
|
459
|
+
command="agents info --parent-page PAGE_ID",
|
|
460
|
+
purpose="Get database IDs and verify workspace exists",
|
|
461
|
+
),
|
|
462
|
+
WorkflowStep(
|
|
463
|
+
description="List organizations to get organization ID",
|
|
464
|
+
command="notion agents orgs list",
|
|
465
|
+
purpose="Get the organization PAGE ID from the response",
|
|
466
|
+
),
|
|
467
|
+
WorkflowStep(
|
|
468
|
+
description="Create project with organization ID",
|
|
469
|
+
command="notion agents projects create --name 'Project Name' --org-id ORG_PAGE_ID",
|
|
470
|
+
purpose="Create project with Organization relation (requires org PAGE ID, not name)",
|
|
471
|
+
),
|
|
472
|
+
],
|
|
473
|
+
commands=[
|
|
474
|
+
"agents info --parent-page PAGE_ID",
|
|
475
|
+
"notion agents orgs list",
|
|
476
|
+
"notion agents projects create --name 'Website Redesign' --org-id ORG_PAGE_ID",
|
|
477
|
+
],
|
|
478
|
+
prerequisites=["workspace_initialized", "organization_exists"],
|
|
479
|
+
error_recovery={
|
|
480
|
+
"workspace_not_found": {
|
|
481
|
+
"message": "No workspace detected in page",
|
|
482
|
+
"solution": "Run 'agents init --parent-page PAGE_ID' first to create workspace",
|
|
483
|
+
},
|
|
484
|
+
"organization_not_found": {
|
|
485
|
+
"message": "Organization ID not found",
|
|
486
|
+
"solution": "Run 'agents orgs list' to get valid organization IDs, or create org first with 'agents orgs create --name NAME'",
|
|
487
|
+
},
|
|
488
|
+
"missing_org_id": {
|
|
489
|
+
"message": "Project requires --org-id (organization PAGE ID), not name",
|
|
490
|
+
"solution": "Use --org-id with the ID from 'agents orgs list' response",
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
)
|
|
494
|
+
|
|
495
|
+
CREATE_VERSION_WORKFLOW = Workflow(
|
|
496
|
+
name="create_version",
|
|
497
|
+
description="Create a new version in a project",
|
|
498
|
+
steps=[
|
|
499
|
+
WorkflowStep(
|
|
500
|
+
description="Verify workspace is initialized",
|
|
501
|
+
command="agents info --parent-page PAGE_ID",
|
|
502
|
+
purpose="Get database IDs and verify workspace exists",
|
|
503
|
+
),
|
|
504
|
+
WorkflowStep(
|
|
505
|
+
description="List projects to get project ID",
|
|
506
|
+
command="notion agents projects list",
|
|
507
|
+
purpose="Get the project PAGE ID from the response",
|
|
508
|
+
),
|
|
509
|
+
WorkflowStep(
|
|
510
|
+
description="Create version with project ID",
|
|
511
|
+
command="notion agents versions create --name 'v1.0.0' --project-id PROJECT_PAGE_ID",
|
|
512
|
+
purpose="Create version with Project relation (requires project PAGE ID, not name)",
|
|
513
|
+
),
|
|
514
|
+
],
|
|
515
|
+
commands=[
|
|
516
|
+
"agents info --parent-page PAGE_ID",
|
|
517
|
+
"notion agents projects list",
|
|
518
|
+
"notion agents versions create --name 'v1.0.0' --project-id PROJECT_PAGE_ID",
|
|
519
|
+
],
|
|
520
|
+
prerequisites=["workspace_initialized", "organization_exists", "project_exists"],
|
|
521
|
+
error_recovery={
|
|
522
|
+
"workspace_not_found": {
|
|
523
|
+
"message": "No workspace detected in page",
|
|
524
|
+
"solution": "Run 'agents init --parent-page PAGE_ID' first to create workspace",
|
|
525
|
+
},
|
|
526
|
+
"project_not_found": {
|
|
527
|
+
"message": "Project ID not found",
|
|
528
|
+
"solution": "Run 'agents projects list' to get valid project IDs, or create project first with 'agents projects create --name NAME --org-id ORG_ID'",
|
|
529
|
+
},
|
|
530
|
+
"missing_project_id": {
|
|
531
|
+
"message": "Version requires --project-id (project PAGE ID), not name",
|
|
532
|
+
"solution": "Use --project-id with the ID from 'agents projects list' response",
|
|
533
|
+
},
|
|
534
|
+
},
|
|
535
|
+
)
|
|
536
|
+
|
|
201
537
|
CREATE_TASK_WORKFLOW = Workflow(
|
|
202
538
|
name="create_task",
|
|
203
539
|
description="Create a new task in the agents workflow system",
|
|
@@ -208,18 +544,20 @@ CREATE_TASK_WORKFLOW = Workflow(
|
|
|
208
544
|
purpose="Get database IDs and verify workspace exists",
|
|
209
545
|
),
|
|
210
546
|
WorkflowStep(
|
|
211
|
-
description="
|
|
212
|
-
|
|
547
|
+
description="List versions to get version ID",
|
|
548
|
+
command="notion agents versions list",
|
|
549
|
+
purpose="Get the version PAGE ID from the response",
|
|
213
550
|
),
|
|
214
551
|
WorkflowStep(
|
|
215
|
-
description="Create task
|
|
216
|
-
command="notion
|
|
217
|
-
purpose="Create task with
|
|
552
|
+
description="Create task with version ID",
|
|
553
|
+
command="notion agents tasks create --title 'Task Name' --version-id VERSION_PAGE_ID",
|
|
554
|
+
purpose="Create task with Version relation (requires version PAGE ID, not name)",
|
|
218
555
|
),
|
|
219
556
|
],
|
|
220
557
|
commands=[
|
|
221
558
|
"agents info --parent-page PAGE_ID",
|
|
222
|
-
"notion
|
|
559
|
+
"notion agents versions list",
|
|
560
|
+
"notion agents tasks create --title 'Fix login bug' --version-id VERSION_PAGE_ID",
|
|
223
561
|
],
|
|
224
562
|
prerequisites=["workspace_initialized"],
|
|
225
563
|
error_recovery={
|
|
@@ -227,9 +565,13 @@ CREATE_TASK_WORKFLOW = Workflow(
|
|
|
227
565
|
"message": "No workspace detected in page",
|
|
228
566
|
"solution": "Run 'agents init' first to create workspace",
|
|
229
567
|
},
|
|
230
|
-
"
|
|
231
|
-
"message": "
|
|
232
|
-
"solution": "
|
|
568
|
+
"version_not_found": {
|
|
569
|
+
"message": "Version ID not found",
|
|
570
|
+
"solution": "Run 'agents versions list' to get valid version IDs, or create version first with 'agents versions create --name NAME --project-id PROJECT_ID'",
|
|
571
|
+
},
|
|
572
|
+
"missing_version_id": {
|
|
573
|
+
"message": "Task requires --version-id (version PAGE ID), not name",
|
|
574
|
+
"solution": "Use --version-id with the ID from 'agents versions list' response",
|
|
233
575
|
},
|
|
234
576
|
},
|
|
235
577
|
)
|
|
@@ -307,13 +649,211 @@ INFO_COMMAND = Command(
|
|
|
307
649
|
],
|
|
308
650
|
)
|
|
309
651
|
|
|
652
|
+
# =============================================================================
|
|
653
|
+
# SUBCOMMANDS
|
|
654
|
+
# =============================================================================
|
|
655
|
+
|
|
656
|
+
# ORGS_SUBCOMMAND documents the agents orgs commands
|
|
657
|
+
ORGS_COMMAND = Command(
|
|
658
|
+
name="orgs",
|
|
659
|
+
purpose="Organizations management - top-level entities in workflow hierarchy",
|
|
660
|
+
description=(
|
|
661
|
+
"Organizations are the starting point for all projects. "
|
|
662
|
+
"Every project must belong to an organization."
|
|
663
|
+
),
|
|
664
|
+
subcommands={
|
|
665
|
+
"list": {
|
|
666
|
+
"purpose": "List all organizations in workspace",
|
|
667
|
+
"usage": "notion agents orgs list",
|
|
668
|
+
"output": "Returns JSON array with organization objects containing id, name, slug, status"
|
|
669
|
+
},
|
|
670
|
+
"get": {
|
|
671
|
+
"purpose": "Get organization by ID",
|
|
672
|
+
"usage": "notion agents orgs get ORG_PAGE_ID",
|
|
673
|
+
"output": "Returns organization details"
|
|
674
|
+
},
|
|
675
|
+
"create": {
|
|
676
|
+
"purpose": "Create a new organization",
|
|
677
|
+
"usage": "notion agents orgs create --name NAME [--slug SLUG] [--description DESC] [--repository-url URL] [--status STATUS]",
|
|
678
|
+
"required_flags": {
|
|
679
|
+
"--name": "Organization name (required)"
|
|
680
|
+
},
|
|
681
|
+
"optional_flags": {
|
|
682
|
+
"--slug": "URL-friendly identifier (optional)",
|
|
683
|
+
"--description": "Organization description (optional)",
|
|
684
|
+
"--repository-url": "Git repository URL (optional)",
|
|
685
|
+
"--status": "Active or Inactive (default: Active)"
|
|
686
|
+
},
|
|
687
|
+
"returns": "JSON with 'id' field containing organization PAGE ID (needed for creating projects)",
|
|
688
|
+
"examples": [
|
|
689
|
+
"notion agents orgs create --name 'WareflowX'",
|
|
690
|
+
"notion agents orgs create --name 'WareflowX' --slug 'wareflowx' --status 'Active'"
|
|
691
|
+
]
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
)
|
|
695
|
+
|
|
696
|
+
# PROJECTS_SUBCOMMAND documents the agents projects commands
|
|
697
|
+
PROJECTS_COMMAND = Command(
|
|
698
|
+
name="projects",
|
|
699
|
+
purpose="Projects management - belongs to organizations",
|
|
700
|
+
description=(
|
|
701
|
+
"Projects represent software development efforts. "
|
|
702
|
+
"Every project must belong to an organization (requires org PAGE ID)."
|
|
703
|
+
),
|
|
704
|
+
subcommands={
|
|
705
|
+
"list": {
|
|
706
|
+
"purpose": "List all projects (optionally filtered by organization)",
|
|
707
|
+
"usage": "notion agents projects list [--org-id ORG_PAGE_ID]",
|
|
708
|
+
"output": "Returns JSON array with project objects containing id, name, slug, status, organization_id"
|
|
709
|
+
},
|
|
710
|
+
"get": {
|
|
711
|
+
"purpose": "Get project by ID",
|
|
712
|
+
"usage": "notion agents projects get PROJECT_PAGE_ID",
|
|
713
|
+
"output": "Returns project details"
|
|
714
|
+
},
|
|
715
|
+
"create": {
|
|
716
|
+
"purpose": "Create a new project in an organization",
|
|
717
|
+
"usage": "notion agents projects create --name NAME --org-id ORG_PAGE_ID [--slug SLUG] [--description DESC] [--repository REPO] [--tech-stack STACK]",
|
|
718
|
+
"required_flags": {
|
|
719
|
+
"--name": "Project name (required)",
|
|
720
|
+
"--org-id": "Organization PAGE ID (required) - use ID from 'agents orgs list' or 'agents orgs create' response"
|
|
721
|
+
},
|
|
722
|
+
"optional_flags": {
|
|
723
|
+
"--slug": "URL-friendly identifier (optional)",
|
|
724
|
+
"--description": "Project description (optional)",
|
|
725
|
+
"--repository": "Git repository URL (optional)",
|
|
726
|
+
"--tech-stack": "Comma-separated tech stack (optional)",
|
|
727
|
+
"--status": "Active, On Hold, Completed, Archived (default: Active)",
|
|
728
|
+
"--role": "Developer, Designer, PM, QA, DevOps (default: Developer)"
|
|
729
|
+
},
|
|
730
|
+
"returns": "JSON with 'id' field containing project PAGE ID (needed for creating versions)",
|
|
731
|
+
"examples": [
|
|
732
|
+
"notion agents projects create --name 'Website Redesign' --org-id org_12345"
|
|
733
|
+
],
|
|
734
|
+
"note": "IMPORTANT: Use --org-id with organization PAGE ID, not organization name"
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
)
|
|
738
|
+
|
|
739
|
+
# VERSIONS_SUBCOMMAND documents the agents versions commands
|
|
740
|
+
VERSIONS_COMMAND = Command(
|
|
741
|
+
name="versions",
|
|
742
|
+
purpose="Versions management - releases and milestones",
|
|
743
|
+
description=(
|
|
744
|
+
"Versions represent releases or milestones. "
|
|
745
|
+
"Every version must belong to a project (requires project PAGE ID)."
|
|
746
|
+
),
|
|
747
|
+
subcommands={
|
|
748
|
+
"list": {
|
|
749
|
+
"purpose": "List all versions (optionally filtered by project)",
|
|
750
|
+
"usage": "notion agents versions list [--project-id PROJECT_PAGE_ID]",
|
|
751
|
+
"output": "Returns JSON array with version objects containing id, name, status, type, project_id"
|
|
752
|
+
},
|
|
753
|
+
"get": {
|
|
754
|
+
"purpose": "Get version by ID",
|
|
755
|
+
"usage": "notion agents versions get VERSION_PAGE_ID",
|
|
756
|
+
"output": "Returns version details"
|
|
757
|
+
},
|
|
758
|
+
"create": {
|
|
759
|
+
"purpose": "Create a new version in a project",
|
|
760
|
+
"usage": "notion agents versions create --name NAME --project-id PROJECT_PAGE_ID [--type TYPE] [--status STATUS]",
|
|
761
|
+
"required_flags": {
|
|
762
|
+
"--name": "Version name e.g. v1.0.0 (required)",
|
|
763
|
+
"--project-id": "Project PAGE ID (required) - use ID from 'agents projects list' or 'agents projects create' response"
|
|
764
|
+
},
|
|
765
|
+
"optional_flags": {
|
|
766
|
+
"--status": "Planning, In Progress, Released, Archived (default: Planning)",
|
|
767
|
+
"--type": "Major, Minor, Patch, Hotfix (default: Minor)",
|
|
768
|
+
"--branch": "Git branch name (optional)",
|
|
769
|
+
"--progress": "Progress percentage 0-100 (default: 0)"
|
|
770
|
+
},
|
|
771
|
+
"returns": "JSON with 'id' field containing version PAGE ID (needed for creating tasks)",
|
|
772
|
+
"examples": [
|
|
773
|
+
"notion agents versions create --name 'v1.0.0' --project-id proj_12345"
|
|
774
|
+
],
|
|
775
|
+
"note": "IMPORTANT: Use --project-id with project PAGE ID, not project name"
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
)
|
|
779
|
+
|
|
780
|
+
# TASKS_SUBCOMMAND documents the agents tasks commands
|
|
781
|
+
TASKS_COMMAND = Command(
|
|
782
|
+
name="tasks",
|
|
783
|
+
purpose="Tasks management - units of work in versions",
|
|
784
|
+
description=(
|
|
785
|
+
"Tasks represent work items. Every task must belong to a version (requires version PAGE ID). "
|
|
786
|
+
"Tasks can have dependencies on other tasks."
|
|
787
|
+
),
|
|
788
|
+
subcommands={
|
|
789
|
+
"list": {
|
|
790
|
+
"purpose": "List all tasks (optionally filtered by version or status)",
|
|
791
|
+
"usage": "notion agents tasks list [--version-id VERSION_PAGE_ID] [--status STATUS]",
|
|
792
|
+
"output": "Returns JSON array with task objects containing id, title, status, type, priority, version_id"
|
|
793
|
+
},
|
|
794
|
+
"get": {
|
|
795
|
+
"purpose": "Get task by ID",
|
|
796
|
+
"usage": "notion agents tasks get TASK_PAGE_ID",
|
|
797
|
+
"output": "Returns task details"
|
|
798
|
+
},
|
|
799
|
+
"create": {
|
|
800
|
+
"purpose": "Create a new task in a version",
|
|
801
|
+
"usage": "notion agents tasks create --title TITLE --version-id VERSION_PAGE_ID [--type TYPE] [--priority PRIORITY] [--dependencies DEP_IDS]",
|
|
802
|
+
"required_flags": {
|
|
803
|
+
"--title": "Task name (required)",
|
|
804
|
+
"--version-id": "Version PAGE ID (required) - use ID from 'agents versions list' or 'agents versions create' response"
|
|
805
|
+
},
|
|
806
|
+
"optional_flags": {
|
|
807
|
+
"--status": "Backlog, Claimed, In Progress, Completed, Cancelled (default: Backlog)",
|
|
808
|
+
"--type": "New Feature, Bug Fix, Refactor, Documentation, Testing, Other (default: New Feature)",
|
|
809
|
+
"--priority": "Low, Medium, High, Critical (default: Medium)",
|
|
810
|
+
"--dependencies": "Comma-separated dependency task IDs (optional)",
|
|
811
|
+
"--estimate": "Estimated hours (optional)"
|
|
812
|
+
},
|
|
813
|
+
"returns": "JSON with 'id' field containing task PAGE ID",
|
|
814
|
+
"examples": [
|
|
815
|
+
"notion agents tasks create --title 'Fix login bug' --version-id ver_12345",
|
|
816
|
+
"notion agents tasks create --title 'Add feature' --version-id ver_12345 --priority 'High' --type 'New Feature'"
|
|
817
|
+
],
|
|
818
|
+
"note": "IMPORTANT: Use --version-id with version PAGE ID, not version name"
|
|
819
|
+
},
|
|
820
|
+
"next": {
|
|
821
|
+
"purpose": "Find next available task to work on",
|
|
822
|
+
"usage": "notion agents tasks next [--project-id PROJECT_PAGE_ID]",
|
|
823
|
+
"description": "Finds tasks with status 'Backlog' or 'Claimed' and no incomplete dependencies",
|
|
824
|
+
"output": "Returns task object or message if no tasks available"
|
|
825
|
+
},
|
|
826
|
+
"claim": {
|
|
827
|
+
"purpose": "Claim a task (transition to Claimed status)",
|
|
828
|
+
"usage": "notion agents tasks claim TASK_PAGE_ID",
|
|
829
|
+
"output": "Returns updated task with agent ID"
|
|
830
|
+
},
|
|
831
|
+
"start": {
|
|
832
|
+
"purpose": "Start working on a task (transition to In Progress)",
|
|
833
|
+
"usage": "notion agents tasks start TASK_PAGE_ID",
|
|
834
|
+
"output": "Returns updated task with agent ID",
|
|
835
|
+
"note": "Will fail if task has incomplete dependencies"
|
|
836
|
+
},
|
|
837
|
+
"complete": {
|
|
838
|
+
"purpose": "Complete a task (transition to Completed)",
|
|
839
|
+
"usage": "notion agents tasks complete TASK_PAGE_ID [--actual-hours HOURS]",
|
|
840
|
+
"output": "Returns completed task with actual hours"
|
|
841
|
+
},
|
|
842
|
+
"can-start": {
|
|
843
|
+
"purpose": "Check if a task can start (all dependencies completed)",
|
|
844
|
+
"usage": "notion agents tasks can-start TASK_PAGE_ID",
|
|
845
|
+
"output": "Returns boolean and lists incomplete dependencies if any"
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
)
|
|
849
|
+
|
|
310
850
|
# =============================================================================
|
|
311
851
|
# COMPLETE SCHEMA
|
|
312
852
|
# =============================================================================
|
|
313
853
|
|
|
314
854
|
AGENTS_SCHEMA = Schema(
|
|
315
855
|
name="agents",
|
|
316
|
-
version="
|
|
856
|
+
version="2.0.0",
|
|
317
857
|
description=(
|
|
318
858
|
"Workflow management system for software development. "
|
|
319
859
|
"Provides complete structure for tracking organizations, projects, "
|
|
@@ -321,28 +861,41 @@ AGENTS_SCHEMA = Schema(
|
|
|
321
861
|
),
|
|
322
862
|
concepts=[
|
|
323
863
|
WORKSPACE_CONCEPT,
|
|
324
|
-
|
|
864
|
+
ORGANIZATION_CONCEPT,
|
|
325
865
|
PROJECT_CONCEPT,
|
|
326
866
|
VERSION_CONCEPT,
|
|
867
|
+
TASK_CONCEPT,
|
|
327
868
|
],
|
|
328
869
|
workflows=[
|
|
329
870
|
INITIALIZE_WORKSPACE,
|
|
871
|
+
CREATE_ORGANIZATION_WORKFLOW,
|
|
872
|
+
CREATE_PROJECT_WORKFLOW,
|
|
873
|
+
CREATE_VERSION_WORKFLOW,
|
|
330
874
|
CREATE_TASK_WORKFLOW,
|
|
331
875
|
QUERY_TASKS_WORKFLOW,
|
|
332
876
|
],
|
|
333
877
|
commands={
|
|
334
878
|
"init": INIT_COMMAND,
|
|
335
879
|
"info": INFO_COMMAND,
|
|
880
|
+
"orgs": ORGS_COMMAND,
|
|
881
|
+
"projects": PROJECTS_COMMAND,
|
|
882
|
+
"versions": VERSIONS_COMMAND,
|
|
883
|
+
"tasks": TASKS_COMMAND,
|
|
336
884
|
},
|
|
337
885
|
best_practices=[
|
|
338
|
-
"
|
|
886
|
+
"Follow the hierarchy: Organization → Project → Version → Task",
|
|
887
|
+
"Always run 'agents info' before operations to verify workspace state",
|
|
339
888
|
"Use --skip flag to safely check for existing workspaces (prevents duplicates)",
|
|
340
889
|
"Use --reset flag only when you need to recreate workspace (causes data loss)",
|
|
341
|
-
"
|
|
342
|
-
"
|
|
343
|
-
"
|
|
344
|
-
"
|
|
345
|
-
"
|
|
890
|
+
"IMPORTANT: Child entities require parent PAGE IDs, not names",
|
|
891
|
+
"Save the 'id' field from create responses - you need it for creating child entities",
|
|
892
|
+
"Use 'agents orgs/projects/versions list' to get valid entity IDs",
|
|
893
|
+
"Create organization before creating projects",
|
|
894
|
+
"Create project before creating versions",
|
|
895
|
+
"Create version before creating tasks",
|
|
896
|
+
"Tasks must have a Version relation (required via --version-id)",
|
|
897
|
+
"Projects must have an Organization relation (required via --org-id)",
|
|
898
|
+
"Use 'agents tasks next' to find next available task",
|
|
346
899
|
],
|
|
347
900
|
examples={
|
|
348
901
|
"initial_setup": """# First time setup
|
|
@@ -357,13 +910,71 @@ notion agents init --parent-page PAGE_ID --skip""",
|
|
|
357
910
|
"force_recreate": """# Delete existing workspace and recreate (WARNING: data loss)
|
|
358
911
|
notion agents init --parent-page PAGE_ID --reset""",
|
|
359
912
|
|
|
360
|
-
"
|
|
361
|
-
|
|
913
|
+
"complete_lifecycle": """# Complete workflow: Org → Project → Version → Task
|
|
914
|
+
# IMPORTANT: Each command returns an ID that the next command needs!
|
|
915
|
+
|
|
916
|
+
# 1. Create organization - SAVE THE ID from response!
|
|
917
|
+
notion agents orgs create --name "WareflowX" --slug "wareflowx"
|
|
918
|
+
# Response: {id: "org_abc123", "name": "WareflowX", ...}
|
|
919
|
+
# Save: ORG_ID="org_abc123"
|
|
920
|
+
|
|
921
|
+
# 2. Create project - requires org PAGE ID, not name!
|
|
922
|
+
notion agents projects create --name "Website Redesign" --org-id "org_abc123"
|
|
923
|
+
# Response: {id: "proj_def456", "name": "Website Redesign", ...}
|
|
924
|
+
# Save: PROJECT_ID="proj_def456"
|
|
925
|
+
|
|
926
|
+
# 3. Create version - requires project PAGE ID, not name!
|
|
927
|
+
notion agents versions create --name "v1.0.0" --project-id "proj_def456"
|
|
928
|
+
# Response: {id: "ver_ghi789", "name": "v1.0.0", ...}
|
|
929
|
+
# Save: VERSION_ID="ver_ghi789"
|
|
930
|
+
|
|
931
|
+
# 4. Create task - requires version PAGE ID, not name!
|
|
932
|
+
notion agents tasks create --title "Fix login bug" --version-id "ver_ghi789" --priority "High\"""",
|
|
933
|
+
|
|
934
|
+
"list_and_filter": """# List all organizations
|
|
935
|
+
notion agents orgs list
|
|
936
|
+
|
|
937
|
+
# List all projects (unfiltered)
|
|
938
|
+
notion agents projects list
|
|
939
|
+
|
|
940
|
+
# List all versions (unfiltered)
|
|
941
|
+
notion agents versions list
|
|
942
|
+
|
|
943
|
+
# List tasks in a specific version
|
|
944
|
+
notion agents tasks list --version-id "ver_ghi789"
|
|
945
|
+
|
|
946
|
+
# Find next task to work on
|
|
947
|
+
notion agents tasks next""",
|
|
948
|
+
|
|
949
|
+
"task_workflow": """# Find a task
|
|
950
|
+
notion agents tasks next
|
|
951
|
+
|
|
952
|
+
# Claim a task (uses task ID from list or next)
|
|
953
|
+
notion agents tasks claim task_xyz123
|
|
954
|
+
|
|
955
|
+
# Start working on task (fails if dependencies not complete)
|
|
956
|
+
notion agents tasks start task_xyz123
|
|
957
|
+
|
|
958
|
+
# Complete task
|
|
959
|
+
notion agents tasks complete task_xyz123 --actual-hours 3.5""",
|
|
960
|
+
|
|
961
|
+
"get_entity_by_id": """# Get organization details
|
|
962
|
+
notion agents orgs get org_abc123
|
|
963
|
+
|
|
964
|
+
# Get project details
|
|
965
|
+
notion agents projects get proj_def456
|
|
966
|
+
|
|
967
|
+
# Get version details
|
|
968
|
+
notion agents versions get ver_ghi789
|
|
969
|
+
|
|
970
|
+
# Get task details
|
|
971
|
+
notion agents tasks get task_xyz123""",
|
|
972
|
+
|
|
973
|
+
"check_dependencies": """# Check if task can start (all deps complete?)
|
|
974
|
+
notion agents tasks can-start task_xyz123
|
|
975
|
+
# Returns: {can_start: false, incomplete_dependencies: [...]}
|
|
362
976
|
|
|
363
|
-
|
|
364
|
-
notion
|
|
365
|
-
--parent TASKS_DB_ID \\
|
|
366
|
-
--title "Fix login bug" \\
|
|
367
|
-
--properties '{"Status": "Todo", "Version": "VERSION_ID"}'""",
|
|
977
|
+
# List tasks with dependencies
|
|
978
|
+
notion agents tasks list --version-id ver_ghi789""",
|
|
368
979
|
},
|
|
369
980
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: better-notion
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.0
|
|
4
4
|
Summary: A high-level Python SDK for the Notion API with developer experience in mind.
|
|
5
5
|
Project-URL: Homepage, https://github.com/nesalia-inc/better-notion
|
|
6
6
|
Project-URL: Documentation, https://github.com/nesalia-inc/better-notion#readme
|
|
@@ -49,7 +49,7 @@ better_notion/_cli/commands/update.py,sha256=NfmijzTpCbVTEY2h0QdcJZXEiGmWkk-iyEt
|
|
|
49
49
|
better_notion/_cli/commands/users.py,sha256=wpjKCo-HHfpiGsjvLSs8nb2MjZ8nxtppCC0N_OCkz9M,4890
|
|
50
50
|
better_notion/_cli/commands/workspace.py,sha256=f3VQcXZ6lu2QrAxkQyFVb3FVU7LYC8kag6VOUvVEu-c,3671
|
|
51
51
|
better_notion/_cli/docs/__init__.py,sha256=NQ2Wt18dVEE43hw2XZtdM8S3OJ5DHzLTKW20byxxYng,415
|
|
52
|
-
better_notion/_cli/docs/base.py,sha256=
|
|
52
|
+
better_notion/_cli/docs/base.py,sha256=2l-4mR-Ss_jMrT2ZNF0xT-kr-XbbaGg8-ed-Fy62hE0,6837
|
|
53
53
|
better_notion/_cli/docs/formatters.py,sha256=bFZ2WOr7Q1O-Q2uUXWki_88jciqHU39wJeaOc_QqSGc,4261
|
|
54
54
|
better_notion/_cli/docs/registry.py,sha256=D1AyQoUITrs-8r_hP72C6ef1vsEQhOEqV13oBuv3pK0,2281
|
|
55
55
|
better_notion/_cli/utils/__init__.py,sha256=VV2SaZnclN-HMMRIsqgxlBNL2HB4n1AvAfMJJWCoTxo,29
|
|
@@ -111,9 +111,9 @@ better_notion/plugins/base.py,sha256=3h9jOZzS--UqmVW3RREtcQ2h1GTWWPUryTencsJKhTM
|
|
|
111
111
|
better_notion/plugins/loader.py,sha256=zCWsMdJyvZs1IHFm0zjEiqm_l_5jB1Uw4x30Kq8rLS4,9527
|
|
112
112
|
better_notion/plugins/state.py,sha256=jH_tZWvC35hqLO4qwl2Kwq9ziWVavwCEUcCqy3s5wMY,3780
|
|
113
113
|
better_notion/plugins/official/__init__.py,sha256=rPg5vdk1cEANVstMPzxcWmImtsOpdSR40JSml7h1uUk,426
|
|
114
|
-
better_notion/plugins/official/agents.py,sha256=
|
|
114
|
+
better_notion/plugins/official/agents.py,sha256=OHX-vmEsab8b-tMljXJLOB9YRpq1oG125FTK7mtm23A,50667
|
|
115
115
|
better_notion/plugins/official/agents_cli.py,sha256=8l6e1zJCAT4DdAO-QfdjK_vrrrik3pmrojwakE32ZNY,53048
|
|
116
|
-
better_notion/plugins/official/agents_schema.py,sha256=
|
|
116
|
+
better_notion/plugins/official/agents_schema.py,sha256=NQRAJFoBAXRuxB9_9Eaf-4tVth-1OZh7GjmN56Yp9lA,39867
|
|
117
117
|
better_notion/plugins/official/productivity.py,sha256=_-whP4pYA4HufE1aUFbIdhrjU-O9njI7xUO_Id2M1J8,8726
|
|
118
118
|
better_notion/plugins/official/agents_sdk/__init__.py,sha256=luQBzZLsJ7fC5U0jFu8dfzMviiXj2SBZXcTohM53wkQ,725
|
|
119
119
|
better_notion/plugins/official/agents_sdk/managers.py,sha256=0zMZPu63zhdyqiudO2gKsmM3YOJh0nFAR9FrMlwkV2A,31186
|
|
@@ -132,8 +132,8 @@ better_notion/utils/agents/rbac.py,sha256=8ZA8Y7wbOiVZDbpjpH7iC35SZrZ0jl4fcJ3xWC
|
|
|
132
132
|
better_notion/utils/agents/schemas.py,sha256=eHfGhY90FAPXA3E8qE6gP75dgNzn-9z5Ju1FMwBKnQQ,22120
|
|
133
133
|
better_notion/utils/agents/state_machine.py,sha256=xUBEeDTbU1Xq-rsRo2sbr6AUYpYrV9DTHOtZT2cWES8,6699
|
|
134
134
|
better_notion/utils/agents/workspace.py,sha256=nS7BNa0-RFCxeAKa0inmBZcPfRKTMB11pi9OW4WzvQ4,15915
|
|
135
|
-
better_notion-1.
|
|
136
|
-
better_notion-1.
|
|
137
|
-
better_notion-1.
|
|
138
|
-
better_notion-1.
|
|
139
|
-
better_notion-1.
|
|
135
|
+
better_notion-1.8.0.dist-info/METADATA,sha256=6HwsgB9jczxjDz6qehycler3WfqBs2MLbUz89VWnDYg,11096
|
|
136
|
+
better_notion-1.8.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
137
|
+
better_notion-1.8.0.dist-info/entry_points.txt,sha256=D0bUcP7Z00Zyjxw7r2p29T95UrwioDO0aGDoHe9I6fo,55
|
|
138
|
+
better_notion-1.8.0.dist-info/licenses/LICENSE,sha256=BAdN3JpgMY_y_fWqZSCFSvSbC2mTHP-BKDAzF5FXQAI,1069
|
|
139
|
+
better_notion-1.8.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|