@notis_ai/cli 0.2.0-beta.191.1 → 0.2.0-beta.196.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.
- package/README.md +479 -80
- package/config/portal-route-roots.json +48 -0
- package/dist/agent-hooks/notis-agent-hook.mjs +29072 -2784
- package/dist/base-skills/notis-apps/SKILL.md +88 -67
- package/dist/base-skills/notis-apps/references/architecture.md +114 -167
- package/dist/base-skills/notis-apps/references/design.md +26 -107
- package/dist/base-skills/notis-apps/references/memory.md +58 -0
- package/dist/base-skills/notis-apps/references/reading.md +52 -74
- package/dist/base-skills/notis-apps/references/release.md +104 -142
- package/dist/base-skills/notis-apps/references/sdk.md +113 -60
- package/dist/base-skills/notis-apps/references/troubleshooting.md +22 -21
- package/dist/base-skills/notis-apps/references/views.md +142 -0
- package/dist/base-skills/notis-cli/SKILL.md +4 -4
- package/dist/base-skills/notis-cli/references/app-delivery.md +12 -11
- package/dist/base-skills/notis-cli/references/native-databases.md +6 -6
- package/dist/base-skills/notis-cli/references/tool-examples.md +4 -4
- package/dist/base-skills/notis-query/SKILL.md +34 -60
- package/dist/base-skills/notis-query/references/database-discovery.md +59 -69
- package/dist/base-skills/notis-query/references/documents.md +63 -50
- package/dist/base-skills/notis-query/references/query.md +57 -524
- package/dist/sdk/src/bundleModule.ts +79 -0
- package/dist/sdk/src/components/DocumentEditor.tsx +6 -3
- package/dist/sdk/src/components/DocumentPage.tsx +141 -0
- package/dist/sdk/src/components/RecordComponents.tsx +33 -0
- package/dist/sdk/src/components/RenderChartData.tsx +19 -0
- package/dist/sdk/src/config.ts +4 -26
- package/dist/sdk/src/documents.ts +2 -0
- package/dist/sdk/src/hooks/useAction.ts +28 -0
- package/dist/sdk/src/hooks/useCloudComputer.ts +35 -4
- package/dist/sdk/src/hooks/useCloudComputerShell.ts +114 -0
- package/dist/sdk/src/hooks/useHandover.ts +5 -4
- package/dist/sdk/src/hooks/useNativeDocumentBody.ts +50 -0
- package/dist/sdk/src/hooks/useNativeDocuments.ts +83 -0
- package/dist/sdk/src/hooks/useNotis.ts +3 -0
- package/dist/sdk/src/hooks/useNotisNavigation.ts +26 -11
- package/dist/sdk/src/hooks/useQuery.ts +7 -4
- package/dist/sdk/src/hooks/useViewParams.ts +121 -0
- package/dist/sdk/src/hooks/useViewerReads.ts +129 -0
- package/dist/sdk/src/index.ts +36 -0
- package/dist/sdk/src/interactions/shortcuts.tsx +17 -3
- package/dist/sdk/src/nativeData.ts +39 -0
- package/dist/sdk/src/presentation.tsx +82 -0
- package/dist/sdk/src/provider.tsx +9 -4
- package/dist/sdk/src/queryCache.ts +5 -3
- package/dist/sdk/src/queryErrors.ts +51 -0
- package/dist/sdk/src/runtime.ts +146 -8
- package/dist/sdk/src/space.ts +425 -0
- package/dist/sdk/src/styles.css +96 -72
- package/dist/sdk/src/vite.ts +11 -1
- package/dist/skill-sync/index.js +458 -68
- package/dist/skill-sync/index.js.map +4 -4
- package/dist/skill-sync-worker.mjs +451 -77
- package/dist/space-harness/host.js +66 -0
- package/dist/view-renderer/dist/host.css +1 -0
- package/dist/view-renderer/dist/host.js +1042 -0
- package/dist/view-renderer/dist/theme.css +73 -0
- package/dist/view-renderer/src/dom.js +180 -0
- package/dist/view-renderer/src/errors.js +8 -0
- package/dist/view-renderer/src/host.tsx +173 -0
- package/dist/view-renderer/src/index.js +4 -0
- package/dist/view-renderer/src/pool.js +76 -0
- package/dist/view-renderer/src/remote-broker.js +59 -0
- package/dist/view-renderer/src/renderer.js +201 -0
- package/package.json +11 -5
- package/skills/notis-apps/cli.md +270 -163
- package/skills/notis-cli/AGENT_INSTRUCTIONS.md +2 -2
- package/skills/notis-onboarding/BRIEF.md +7 -3
- package/src/command-specs/apps.js +1 -8
- package/src/command-specs/files.js +29 -0
- package/src/command-specs/helpers.js +1 -0
- package/src/command-specs/index.js +10 -4
- package/src/command-specs/skills.js +229 -0
- package/src/command-specs/spaces.js +572 -0
- package/src/command-specs/views.js +69 -0
- package/src/runtime/agent-browser.js +30 -7
- package/src/runtime/app-boundary-validator.js +7 -4
- package/src/runtime/app-data-literals.js +82 -0
- package/src/runtime/app-platform.js +321 -253
- package/src/runtime/confined-space-build.js +74 -0
- package/src/runtime/confined-space-verify.js +49 -0
- package/src/runtime/native-record-files.js +47 -0
- package/src/runtime/retired-sdk-files.js +20 -0
- package/src/runtime/skill-sync/cloud-client.ts +26 -4
- package/src/runtime/skill-sync/index.ts +154 -35
- package/src/runtime/skill-sync/local-scanner.ts +125 -17
- package/src/runtime/skill-sync/native-identity.ts +102 -0
- package/src/runtime/skill-sync/native-plan.ts +59 -0
- package/src/runtime/skill-sync/sync-plan.ts +16 -9
- package/src/runtime/skill-sync/types.ts +32 -6
- package/src/runtime/source-root.js +32 -0
- package/src/runtime/space-collection-scaffold.js +66 -0
- package/src/runtime/space-database-structures.js +229 -0
- package/src/runtime/space-fixture-broker.js +50 -0
- package/src/runtime/space-lock.js +337 -0
- package/src/runtime/space-platform.js +105 -0
- package/src/runtime/space-source.js +281 -0
- package/src/runtime/space-test-server.js +327 -0
- package/src/runtime/space-verification.js +89 -0
- package/src/runtime/space-verify-browser-worker.js +51 -0
- package/src/runtime/space-view-manifest.js +254 -0
- package/src/runtime/sync-skills.js +1 -1
- package/src/runtime/transport.js +8 -1
- package/src/runtime/view-render.js +49 -0
- package/src/space-harness-host.ts +103 -0
- package/template/app/globals.css +1 -0
- package/src/command-specs/reports.js +0 -97
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# View authoring
|
|
2
|
+
|
|
3
|
+
A view is the presentation of a Space. A record opens in a view; its database has
|
|
4
|
+
one main view. Words in links describe the destination, while IDs choose it.
|
|
5
|
+
Get links from write results or `LOCAL_NOTIS_FIND_VIEWS`, not by joining labels.
|
|
6
|
+
|
|
7
|
+
## Start from the collection scaffold
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
notis spaces init "Notes" ./notes --database-key notes --path notes
|
|
11
|
+
notis spaces build ./notes --space collection
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`init` is local only. For an existing Space, pull its exact ID instead. Keep its
|
|
15
|
+
lock and local source key; one build/deploy changes that selected Space only.
|
|
16
|
+
A container has children but no page; page-only params/shows/memory belong on views.
|
|
17
|
+
|
|
18
|
+
## A complete view declaration
|
|
19
|
+
|
|
20
|
+
The linked `notes` resource below must already resolve to this installation's
|
|
21
|
+
native database. Descriptions explain what a person or agent can do here.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { defineSpace } from '@notis/sdk/config';
|
|
25
|
+
|
|
26
|
+
export default defineSpace({
|
|
27
|
+
specVersion: 2,
|
|
28
|
+
name: 'Notes',
|
|
29
|
+
path: 'notes',
|
|
30
|
+
description: 'Browse notes and open one with its files.',
|
|
31
|
+
readableContext: 'The note parameter opens one note. The list shows all notes available through this Space.',
|
|
32
|
+
entry: './view.tsx',
|
|
33
|
+
resources: { notes: { kind: 'database', key: 'notes' } },
|
|
34
|
+
collection: { database: 'notes', titleProperty: 'title' },
|
|
35
|
+
params: {
|
|
36
|
+
note: { type: 'record', database: 'notes', main: true,
|
|
37
|
+
description: 'The note to open beside the list.' },
|
|
38
|
+
},
|
|
39
|
+
shows: { notes: { database: 'notes', where: {}, open: 'note' } },
|
|
40
|
+
memory: { markdown: true, attachments: true, screenshot: false, snapshots: [] },
|
|
41
|
+
actions: {
|
|
42
|
+
read: {
|
|
43
|
+
tool: 'LOCAL_NOTIS_DATABASE_QUERY',
|
|
44
|
+
inputs: { type: 'object', additionalProperties: false,
|
|
45
|
+
required: ['request'], properties: { request: {
|
|
46
|
+
type: 'object', additionalProperties: false,
|
|
47
|
+
required: ['filter', 'page_size', 'include_content'],
|
|
48
|
+
properties: {
|
|
49
|
+
filter: { type: 'object', additionalProperties: false,
|
|
50
|
+
required: ['field', 'op', 'value'], properties: {
|
|
51
|
+
field: { type: 'object', additionalProperties: false,
|
|
52
|
+
required: ['column'], properties: { column: { const: 'record_key' } } },
|
|
53
|
+
op: { const: 'equals' }, value: { type: 'string', format: 'uuid' },
|
|
54
|
+
} },
|
|
55
|
+
page_size: { const: 1 }, include_content: { const: true },
|
|
56
|
+
},
|
|
57
|
+
} } },
|
|
58
|
+
arguments: { database_id: { $asset: 'notes' }, request: { $input: 'request' } },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Use `useViewParams<typeof definition>()`, `useShown('notes')`, and
|
|
65
|
+
`<DocumentPage recordKey={params.note}>` (the whole note page; use `DocumentEditor` only to embed a body
|
|
66
|
+
inside a layout of your own; if `spaces build` reports no `DocumentPage` export, your CLI predates it: use
|
|
67
|
+
`useNotisRuntime().ui?.DocumentPage` with a `DocumentEditor` fallback, see the SDK reference). Keep hooks unconditional; conditional
|
|
68
|
+
record/list branches can be separate components. The SDK reference covers the
|
|
69
|
+
components and exact navigation helpers. The saved `read` action is deliberately
|
|
70
|
+
constrained to one native record for body/Site reads; `shows.notes` owns the
|
|
71
|
+
Editor’s collection list. Keep both tied to the same declared resource.
|
|
72
|
+
|
|
73
|
+
## Params and declared lists
|
|
74
|
+
|
|
75
|
+
- Param types: `record`, `enum`, `text`, `number`, `date`, `boolean`. Each needs a
|
|
76
|
+
description. Enum values and defaults are typed; a required param has no default.
|
|
77
|
+
- Record params name a declared database and have no default record. `main: true`
|
|
78
|
+
claims that database's main view. `slugProperty` is a title/number property used
|
|
79
|
+
for readable link text, not record identity.
|
|
80
|
+
- `path` is descriptive lowercase words, up to four slash-separated segments;
|
|
81
|
+
do not put IDs, credentials or reserved product routes in it.
|
|
82
|
+
- `shows` for native data is `{database, where, open?}`. `where` is the native filter
|
|
83
|
+
grammar and is what `useShown` executes, not commentary beside a different query.
|
|
84
|
+
`open` names a record param over the same database.
|
|
85
|
+
- A project-scoped task list can use
|
|
86
|
+
`{field: {property: 'Project'}, op: 'contains', value: '{project}'}` with a declared
|
|
87
|
+
project record param. `{project.Status}` reads a property of that authorized record.
|
|
88
|
+
- For connected-service content use `{about, services?}` and declared actions.
|
|
89
|
+
This descriptive form is not a native executable list; use `useAction` for reads.
|
|
90
|
+
- Preserve the application's real semantics and option names. For the existing
|
|
91
|
+
Tasks migration, Inbox is **Project empty OR Status equals Inbox**. Keep imported
|
|
92
|
+
rows, statuses and creation defaults; add the Inbox option only if absent. Its
|
|
93
|
+
native filter is `{or: [{field: {property: 'Project'}, op: 'is_empty'},
|
|
94
|
+
{field: {property: 'Status'}, op: 'equals', value: 'Inbox'}]}`. Other applications
|
|
95
|
+
must use their own inspected schema rather than copying these labels blindly.
|
|
96
|
+
|
|
97
|
+
## Create a database in the same release
|
|
98
|
+
|
|
99
|
+
Replace an existing database reference with:
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
resources: {
|
|
103
|
+
notes: { kind: 'database', create: {
|
|
104
|
+
name: 'Notes',
|
|
105
|
+
schema: {
|
|
106
|
+
schema_version: 1, value_encoding_version: 1, coercion_version: 1,
|
|
107
|
+
title_property_id: 'title', property_order: ['title'],
|
|
108
|
+
properties: { title: { id: 'title', name: 'Name', kind: 'title',
|
|
109
|
+
storage_family: 'textish', description: '', order: 0, config: {} } },
|
|
110
|
+
},
|
|
111
|
+
} },
|
|
112
|
+
},
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The same view declares a record param over `notes` with `main: true`. Promotion
|
|
116
|
+
creates the database, link, main view, optional fictional `starterRows` and source
|
|
117
|
+
atomically; a later failure leaves none of them behind. Verification does not create
|
|
118
|
+
it. `create` is creation-only: later schema edits use native database tools;
|
|
119
|
+
`spaces pull` refreshes the declaration from the live schema.
|
|
120
|
+
|
|
121
|
+
The separate native schema-tool creation route requires `links.add` and
|
|
122
|
+
`main_view: {space_id, param}` in that linked Space. Until the Space next deploys
|
|
123
|
+
that main param, record links open the Space and writes return `view_warning`.
|
|
124
|
+
Inspect current tools for exact argument shapes; do not repeatedly insert rows
|
|
125
|
+
because a pending main view cannot yet open one.
|
|
126
|
+
|
|
127
|
+
## Rendering and memory
|
|
128
|
+
|
|
129
|
+
Choose [memory](memory.md) deliberately. `chrome: 'hidden'` is for full-screen
|
|
130
|
+
presentations such as the HTML Space; ordinary collection views keep Portal chrome.
|
|
131
|
+
A Space whose published view hides chrome starts hidden from each person's sidebar,
|
|
132
|
+
like Skill review Spaces; it stays reachable by link and search, and each person
|
|
133
|
+
can show it from the sidebar's hidden Spaces list or the Space's menu.
|
|
134
|
+
Optional `markdown: './markdown.ts'` names a module exporting a pure function of
|
|
135
|
+
`{params, shown}`. Its output must represent this view, not make hidden writes.
|
|
136
|
+
Use `<RenderChartData>` with the chart's actual rows so rendered Markdown contains
|
|
137
|
+
precise labels and values as well as its image.
|
|
138
|
+
|
|
139
|
+
Add synthetic action/list/body/record fixtures, then build and verify. Verification
|
|
140
|
+
and live rendering share the read-only renderer; fixture success does not prove
|
|
141
|
+
live permissions or data. After an authorized deploy, render the returned view link
|
|
142
|
+
with `notis views render` and inspect both the Markdown and full-height screenshot.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: notis-cli
|
|
3
|
-
description: Use when agents should work through the Notis CLI, especially to develop Notis
|
|
3
|
+
description: Use when agents should work through the Notis CLI, especially to develop Notis Spaces locally or to access Notis, Composio, or MCP tools they do not currently have loaded directly.
|
|
4
4
|
mcp_resource: true
|
|
5
5
|
mcp_tool_patterns: ["LOCAL_NOTIS_GET_INTELLIGENCE_POLICY"]
|
|
6
6
|
mcp_references: ["references/app-delivery.md", "references/tool-examples.md", "references/native-databases.md", "references/troubleshooting.md", "references/intelligence.md"]
|
|
@@ -12,13 +12,13 @@ Use this skill when the user wants work done through the Notis CLI.
|
|
|
12
12
|
|
|
13
13
|
This skill covers two main CLI workflows:
|
|
14
14
|
|
|
15
|
-
1. Developing Notis
|
|
15
|
+
1. Developing Notis Spaces (views, their source and linked Skills) locally.
|
|
16
16
|
2. Accessing Notis, Composio, and MCP tools through the CLI.
|
|
17
17
|
## When to use this skill
|
|
18
18
|
|
|
19
19
|
Activate this skill when:
|
|
20
20
|
|
|
21
|
-
- the user wants to init,
|
|
21
|
+
- the user wants to init, pull, build, verify, preview, deploy or promote a Notis Space through the CLI
|
|
22
22
|
- the current agent does not have the tool it needs in its direct tool list
|
|
23
23
|
- the user wants direct MCP access through Notis
|
|
24
24
|
- the user wants to use an integration-backed capability through Notis rather than a first-class local tool
|
|
@@ -133,7 +133,7 @@ For hosted MCP, fetch the matching `notis://docs/notis-cli/references/<file>.md`
|
|
|
133
133
|
with resources/read or the available Notis resource-fetch tool; the root resource
|
|
134
134
|
also rewrites these links to their published URIs.
|
|
135
135
|
|
|
136
|
-
- [
|
|
136
|
+
- [Space delivery](references/app-delivery.md)
|
|
137
137
|
- [Toolkit mental model](references/tool-examples.md)
|
|
138
138
|
- [Native database access](references/native-databases.md)
|
|
139
139
|
- [Supporting commands](references/troubleshooting.md)
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Space delivery
|
|
2
2
|
|
|
3
|
-
Use the canonical `notis-apps` skill
|
|
3
|
+
Use the canonical `notis-apps` skill's entrypoint and [release guide](../../notis-apps/references/release.md).
|
|
4
4
|
For hosted MCP fetch `notis://docs/notis-apps` and `notis://docs/notis-apps/references/release.md`.
|
|
5
5
|
User/repository no-deploy and explicit-consent policies take precedence over default delivery.
|
|
6
6
|
|
|
7
|
-
## IMPORTANT: When NOT to use tool access for
|
|
7
|
+
## IMPORTANT: When NOT to use tool access for Space development
|
|
8
8
|
|
|
9
|
-
When building or deploying a
|
|
9
|
+
When building or deploying a Space, do NOT use `npx --package @notis_ai/cli@latest -- notis tools exec` for source operations:
|
|
10
10
|
|
|
11
|
-
- Loading or
|
|
12
|
-
-
|
|
13
|
-
-
|
|
11
|
+
- Loading, building or publishing source -- use `notis spaces pull`, `spaces build`, `spaces verify`, `spaces preview`, `spaces deploy` and `spaces promote` as the release guide orders them
|
|
12
|
+
- Validating views -- `spaces build` and `spaces verify` check declarations, fixtures and renders
|
|
13
|
+
- Writing pages -- write standard Vite + React views with `@notis/sdk`, not raw JS files
|
|
14
14
|
|
|
15
|
-
Database schemas
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
Database schemas have two routes: the native database tool (create with `links.add`
|
|
16
|
+
and `main_view`), or a `create` declaration in Space source that the deploy applies
|
|
17
|
+
atomically. Tool calls are also valid for testing runtime behavior after deployment.
|
|
18
|
+
`notis apps` is the legacy App group for accounts not yet moved to Spaces; a legacy
|
|
19
|
+
App cannot declare Skills.
|
|
@@ -5,17 +5,17 @@ Native Notis databases are accessed through the generic tool workflow, not a fir
|
|
|
5
5
|
- `LOCAL_NOTIS_DATABASE_LIST_DATABASES` -- list databases accessible to the current profile
|
|
6
6
|
- `LOCAL_NOTIS_DATABASE_GET_DATABASE` -- inspect read-only metadata and schema detail
|
|
7
7
|
- `LOCAL_NOTIS_DATABASE_QUERY` -- query documents from a database
|
|
8
|
-
- `LOCAL_NOTIS_DATABASE_UPSERT_DATABASE` -- create or update a database schema.
|
|
9
|
-
- `LOCAL_NOTIS_DATABASE_DELETE_DATABASE` -- permanently delete a database and all its rows by `database_id`. It is refused for a database its
|
|
8
|
+
- `LOCAL_NOTIS_DATABASE_UPSERT_DATABASE` -- create or update a database schema. A new database is linked to a Space in the same call (`links.add`) and names its main view; change a database used in Spaces through protocol 1 with its exact Space binding target
|
|
9
|
+
- `LOCAL_NOTIS_DATABASE_DELETE_DATABASE` -- permanently delete a database and all its rows by `database_id`. It is refused for every database a Space links (`database_linked_to_space`: move it instead; a database used only in one Space is deleted with that Space from the bin), for a legacy App database its App declares, and while another database relates to it or an automation is triggered by it; the error says what to remove first
|
|
10
10
|
|
|
11
|
-
Example workflow before building
|
|
11
|
+
Example workflow before building a Space view:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
npx --package @notis_ai/cli@latest -- notis tools search "list Notis databases"
|
|
15
15
|
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_LIST_DATABASES --arguments '{}'
|
|
16
16
|
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --get-schema
|
|
17
|
-
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --arguments '{"
|
|
18
|
-
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_QUERY --arguments '{"
|
|
17
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --arguments '{"database_id":"<id from LIST_DATABASES>"}'
|
|
18
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_QUERY --arguments '{"protocol":1,"target":{"space_id":"<space id>","binding":"<binding id>"},"input":{"mode":"rows","page_size":1}}'
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Most databases are used in Spaces. Such a database is read only through one of its links: `GET_DATABASE` with a bare `database_id` returns `resolved_target` (the main view's `{space_id, binding}`), and a bare-id `QUERY` answers `database_in_spaces` with every link. Reuse that exact target with `protocol: 1`. Every database lives in a Space; a `database_slug` resolves among every database you can reach, and a slug several of them share answers `database_slug_ambiguous` with each `database_id` and its Spaces.
|
|
@@ -32,15 +32,15 @@ npx --package @notis_ai/cli@latest -- notis tools exec composio-googlecalendar-l
|
|
|
32
32
|
Dry-run a tool call:
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --dry-run --arguments '{"
|
|
36
|
-
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_QUERY --dry-run --arguments '{"
|
|
35
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --dry-run --arguments '{"database_id":"<tasks database id>"}'
|
|
36
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_QUERY --dry-run --arguments '{"protocol":1,"target":{"space_id":"<space id>","binding":"<binding id>"},"input":{"mode":"rows","page_size":10}}'
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
Execute a tool call:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --arguments '{"
|
|
43
|
-
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_QUERY --arguments '{"
|
|
42
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_GET_DATABASE --arguments '{"database_id":"<tasks database id>"}'
|
|
43
|
+
npx --package @notis_ai/cli@latest -- notis tools exec LOCAL_NOTIS_DATABASE_QUERY --arguments '{"protocol":1,"target":{"space_id":"<space id>","binding":"<binding id>"},"input":{"mode":"rows","page_size":10}}'
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
Connect a missing toolkit:
|
|
@@ -1,67 +1,41 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: notis-query
|
|
3
|
-
description:
|
|
4
|
-
feature_flag:
|
|
3
|
+
description: Discover native Notis databases and query their records with exact structured filters, current Space authority and view-qualified links.
|
|
4
|
+
feature_flag: spaces
|
|
5
5
|
mcp_resource: true
|
|
6
6
|
mcp_tool_patterns: ["LOCAL_NOTIS_DATABASE_*"]
|
|
7
7
|
mcp_references: ["references/database-discovery.md", "references/documents.md", "references/query.md"]
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
Use
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
Use these tools together:
|
|
44
|
-
|
|
45
|
-
- `LOCAL_NOTIS_DATABASE_LIST_DATABASES` to discover available databases and confirm the slug
|
|
46
|
-
- `LOCAL_NOTIS_DATABASE_GET_DATABASE` to inspect read-only schema detail, ordered properties, options, and relation targets
|
|
47
|
-
- `LOCAL_NOTIS_DATABASE_QUERY` to find matching records
|
|
48
|
-
- `LOCAL_NOTIS_DATABASE_GET_DOCUMENT` to inspect one specific matching document in full
|
|
49
|
-
- generated database upsert tools to update or create records after you know the right document or relation IDs
|
|
50
|
-
|
|
51
|
-
Follow the same workflow and use the exact canonical tool names available in the current runtime.
|
|
52
|
-
|
|
53
|
-
Every database has one owning app; inspect its identity/schema before schema writes.
|
|
54
|
-
Known document IDs/URLs use the document guide, not a broad query. For queries,
|
|
55
|
-
use the query guide for exact filter/property/pagination rules; live inputSchema
|
|
56
|
-
is authoritative. Dry-run writes and read back the resulting state.
|
|
57
|
-
|
|
58
|
-
## Task guides
|
|
59
|
-
|
|
60
|
-
Read only the guide needed for this task. Relative links resolve in the skill bundle.
|
|
61
|
-
For hosted MCP, fetch the matching `notis://docs/notis-query/references/<file>.md` URI
|
|
62
|
-
with resources/read or the available Notis resource-fetch tool; the root resource
|
|
63
|
-
also rewrites these links to their published URIs.
|
|
64
|
-
|
|
65
|
-
- [Native Database Workflow](references/database-discovery.md)
|
|
66
|
-
- [Reading documents](references/documents.md)
|
|
67
|
-
- [Supported execution mode](references/query.md)
|
|
10
|
+
# Native database queries
|
|
11
|
+
|
|
12
|
+
Use structured native queries for filtering, sorting, counts, aggregates and
|
|
13
|
+
pagination. Use memory for semantic discovery; use view rendering for what a page
|
|
14
|
+
shows. The live tool `inputSchema` is authoritative.
|
|
15
|
+
|
|
16
|
+
1. Discover the database and inspect its schema, property descriptions, relation
|
|
17
|
+
targets and option IDs with `LOCAL_NOTIS_DATABASE_GET_DATABASE`.
|
|
18
|
+
2. Keep its exact returned native `target`, schema revision and available operations.
|
|
19
|
+
Every database lives in a Space; failed access never falls back to another owner.
|
|
20
|
+
3. Use `LOCAL_NOTIS_DATABASE_QUERY` with `protocol: 1`, that `target` and direct
|
|
21
|
+
`input`. Build filters from actual field types/options. Page until the returned
|
|
22
|
+
continuation ends; one page is not the whole database.
|
|
23
|
+
4. For a known record or view link, follow [Reading records](references/documents.md)
|
|
24
|
+
instead of running broad discovery. View links come from write results or
|
|
25
|
+
`LOCAL_NOTIS_FIND_VIEWS`; sensitive or stale evidence needs a fresh render.
|
|
26
|
+
5. Writes use discovered native tools with current schema/record revisions and a
|
|
27
|
+
stable request ID. Dry-run first and read back the committed state. A missing
|
|
28
|
+
view link is not a failed write and does not justify repeating it.
|
|
29
|
+
|
|
30
|
+
In authored Space code use `useShown` or declared actions, not account-wide tool
|
|
31
|
+
calls. Load `notis-apps` for [Space authoring](../notis-apps/references/views.md);
|
|
32
|
+
its hosted reference is `notis://docs/notis-apps/references/views.md`.
|
|
33
|
+
|
|
34
|
+
## Guides
|
|
35
|
+
|
|
36
|
+
- [Database discovery and creation](references/database-discovery.md)
|
|
37
|
+
- [Structured native query grammar](references/query.md)
|
|
38
|
+
- [Reading, updating and citing records](references/documents.md)
|
|
39
|
+
|
|
40
|
+
Hosted MCP exposes these references under
|
|
41
|
+
`notis://docs/notis-query/references/<file>.md`; load only the relevant guide.
|
|
@@ -1,70 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- `
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Deleting databases
|
|
62
|
-
|
|
63
|
-
Use `LOCAL_NOTIS_DATABASE_DELETE_DATABASE` only when the user asked for a database
|
|
64
|
-
to be removed: it permanently deletes the database and every row, and cannot be
|
|
65
|
-
undone. Pass the exact `database_id` from `LOCAL_NOTIS_DATABASE_LIST_DATABASES`.
|
|
66
|
-
The tool refuses while another database has a relation property pointing to it or
|
|
67
|
-
an automation is triggered by it, and lists them; remove those first (delete the
|
|
1
|
+
# Database discovery and creation
|
|
2
|
+
|
|
3
|
+
Use `LOCAL_NOTIS_DATABASE_LIST_DATABASES` to find accessible databases, then
|
|
4
|
+
`LOCAL_NOTIS_DATABASE_GET_DATABASE` for schema and current native authority. A
|
|
5
|
+
name or slug helps discovery; use the returned exact identity for further work.
|
|
6
|
+
A slug shared by several databases you can reach answers `database_slug_ambiguous`
|
|
7
|
+
with each `database_id` and its Spaces: choose with the user, then keep that ID.
|
|
8
|
+
Inspect property descriptions, types, option IDs and relation targets before
|
|
9
|
+
filtering or writing. Keep the returned target intact, including binding pins.
|
|
10
|
+
|
|
11
|
+
## Database creation has two supported routes
|
|
12
|
+
|
|
13
|
+
**Native tool.** Discover/inspect `LOCAL_NOTIS_DATABASE_UPSERT_DATABASE`. With
|
|
14
|
+
`protocol: 1`, creation requires a stable `request_id`, `links.add` with at least
|
|
15
|
+
one Space and its current revision, and `main_view: {space_id, param}` naming a
|
|
16
|
+
Space linked in that call. The database and link are created together. That
|
|
17
|
+
Space's next source deploy must declare the record param with `main: true`.
|
|
18
|
+
Until then, bare record links open the Space and write results carry `view_warning`.
|
|
19
|
+
|
|
20
|
+
**Space source.** Declare `resources.<alias> = {kind: 'database', create: {name,
|
|
21
|
+
schema, starterRows?}}` and a main record param for that alias in the same view.
|
|
22
|
+
Promotion creates the database/link/main/source atomically. Build/verify does not
|
|
23
|
+
create anything. See [View authoring](../../notis-apps/references/views.md).
|
|
24
|
+
|
|
25
|
+
Every database keeps a main view and at least one Space. To move it, add the new
|
|
26
|
+
link and remove the old one in a single resource mutation; unlinking the final
|
|
27
|
+
Space is refused with `database_last_space`. Moving into another Space tree also
|
|
28
|
+
sets `main_view` in the added Space and needs an Editor of both Spaces; the main
|
|
29
|
+
view stays pending (`view_warning`) until that Space deploys it. Reuse the current
|
|
30
|
+
IDs instead of making an equivalent duplicate. Explain who gains or loses access
|
|
31
|
+
first ([consequences](../../notis-apps/references/architecture.md#consequences-to-explain-before-acting)).
|
|
32
|
+
|
|
33
|
+
## Schema edits
|
|
34
|
+
|
|
35
|
+
Use the exact `target`, `schema_revision` and stable `request_id` from discovery.
|
|
36
|
+
Only whole-database Editors change shared definitions. `rename` preserves a
|
|
37
|
+
property's ID and values; remove-plus-add is not a rename. Merge choice options
|
|
38
|
+
by default; replacing the complete option set can make old stored values unreadable.
|
|
39
|
+
|
|
40
|
+
A relation must specify the exact target database. For Space authoring, also
|
|
41
|
+
resolve its same-Space relation binding when required; a description does not
|
|
42
|
+
grant access or define the target. Native writes validate the related record's
|
|
43
|
+
identity and visibility inside that binding.
|
|
44
|
+
|
|
45
|
+
Source `create` declarations apply only once. Later changes use the native schema
|
|
46
|
+
tool; `spaces pull` refreshes source from the live schema instead of reapplying an
|
|
47
|
+
old creation schema. Keep schemas, source and tests aligned after intentional edits.
|
|
48
|
+
|
|
49
|
+
## Deleting databases
|
|
50
|
+
|
|
51
|
+
`LOCAL_NOTIS_DATABASE_DELETE_DATABASE` permanently deletes a database and every
|
|
52
|
+
row, and cannot be undone. Use it only when the user asked for that database to be
|
|
53
|
+
removed, with the exact `database_id` from `LOCAL_NOTIS_DATABASE_LIST_DATABASES`.
|
|
54
|
+
It refuses while another database has a relation property pointing to it or an
|
|
55
|
+
automation is triggered by it, and lists them; remove those first (delete the
|
|
68
56
|
relation property with `LOCAL_NOTIS_DATABASE_UPSERT_DATABASE`, action `remove`).
|
|
69
|
-
It also refuses
|
|
70
|
-
|
|
57
|
+
It also refuses every database linked to a Space (`database_linked_to_space`): a
|
|
58
|
+
Space database cannot be deleted directly, so offer to move it instead. A database
|
|
59
|
+
used only in one Space is deleted with that Space when its bin entry is deleted.
|
|
60
|
+
A legacy App database its App declares is refused with `database_declared_by_app`.
|