@notis_ai/cli 0.2.0-beta.178.1 → 0.2.0-beta.1792022492092.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +548 -98
  2. package/config/portal-route-roots.json +47 -0
  3. package/dist/agent-hooks/notis-agent-hook.mjs +32901 -5934
  4. package/dist/base-skills/notis-apps/SKILL.md +76 -51
  5. package/dist/base-skills/notis-apps/references/architecture.md +116 -164
  6. package/dist/base-skills/notis-apps/references/design.md +26 -107
  7. package/dist/base-skills/notis-apps/references/memory.md +58 -0
  8. package/dist/base-skills/notis-apps/references/reading.md +52 -74
  9. package/dist/base-skills/notis-apps/references/release.md +105 -96
  10. package/dist/base-skills/notis-apps/references/sdk.md +115 -60
  11. package/dist/base-skills/notis-apps/references/troubleshooting.md +22 -21
  12. package/dist/base-skills/notis-apps/references/views.md +145 -0
  13. package/dist/base-skills/notis-cli/SKILL.md +29 -12
  14. package/dist/base-skills/notis-cli/references/app-delivery.md +12 -11
  15. package/dist/base-skills/notis-cli/references/intelligence.md +94 -0
  16. package/dist/base-skills/notis-cli/references/native-databases.md +6 -5
  17. package/dist/base-skills/notis-cli/references/tool-examples.md +4 -4
  18. package/dist/base-skills/notis-query/SKILL.md +34 -60
  19. package/dist/base-skills/notis-query/references/database-discovery.md +60 -59
  20. package/dist/base-skills/notis-query/references/documents.md +53 -39
  21. package/dist/base-skills/notis-query/references/query.md +57 -524
  22. package/dist/sdk/src/bundleModule.ts +79 -0
  23. package/dist/sdk/src/components/DocumentEditor.tsx +6 -3
  24. package/dist/sdk/src/components/DocumentPage.tsx +144 -0
  25. package/dist/sdk/src/components/RecordComponents.tsx +33 -0
  26. package/dist/sdk/src/components/RenderChartData.tsx +19 -0
  27. package/dist/sdk/src/config.ts +4 -26
  28. package/dist/sdk/src/documents.ts +2 -0
  29. package/dist/sdk/src/hooks/useAction.ts +28 -0
  30. package/dist/sdk/src/hooks/useBackend.ts +3 -2
  31. package/dist/sdk/src/hooks/useCloudComputer.ts +35 -4
  32. package/dist/sdk/src/hooks/useCloudComputerShell.ts +114 -0
  33. package/dist/sdk/src/hooks/useCollectionInteractions.ts +4 -2
  34. package/dist/sdk/src/hooks/useHandover.ts +7 -7
  35. package/dist/sdk/src/hooks/useNativeDocumentBody.ts +50 -0
  36. package/dist/sdk/src/hooks/useNativeDocuments.ts +83 -0
  37. package/dist/sdk/src/hooks/useNotis.ts +3 -0
  38. package/dist/sdk/src/hooks/useNotisNavigation.ts +26 -11
  39. package/dist/sdk/src/hooks/useQuery.ts +7 -4
  40. package/dist/sdk/src/hooks/useViewParams.ts +121 -0
  41. package/dist/sdk/src/hooks/useViewerReads.ts +129 -0
  42. package/dist/sdk/src/index.ts +36 -0
  43. package/dist/sdk/src/interactions/shortcuts.tsx +42 -5
  44. package/dist/sdk/src/nativeData.ts +39 -0
  45. package/dist/sdk/src/presentation.tsx +82 -0
  46. package/dist/sdk/src/provider.tsx +9 -4
  47. package/dist/sdk/src/queryCache.ts +5 -3
  48. package/dist/sdk/src/queryErrors.ts +51 -0
  49. package/dist/sdk/src/runtime.ts +163 -13
  50. package/dist/sdk/src/space.ts +425 -0
  51. package/dist/sdk/src/styles.css +96 -72
  52. package/dist/sdk/src/vite.ts +11 -1
  53. package/dist/skill-sync/index.js +571 -80
  54. package/dist/skill-sync/index.js.map +4 -4
  55. package/dist/skill-sync-worker.mjs +858 -233
  56. package/dist/space-harness/host.js +66 -0
  57. package/dist/view-renderer/dist/host.css +1 -0
  58. package/dist/view-renderer/dist/host.js +1028 -0
  59. package/dist/view-renderer/dist/theme.css +73 -0
  60. package/dist/view-renderer/src/dom.js +180 -0
  61. package/dist/view-renderer/src/errors.js +8 -0
  62. package/dist/view-renderer/src/host.tsx +175 -0
  63. package/dist/view-renderer/src/index.js +4 -0
  64. package/dist/view-renderer/src/pool.js +76 -0
  65. package/dist/view-renderer/src/remote-broker.js +59 -0
  66. package/dist/view-renderer/src/renderer.js +201 -0
  67. package/package.json +16 -5
  68. package/skills/notis-apps/cli.md +323 -163
  69. package/skills/notis-cli/AGENT_INSTRUCTIONS.md +3 -3
  70. package/skills/notis-onboarding/BRIEF.md +7 -3
  71. package/src/command-specs/apps.js +2 -1
  72. package/src/command-specs/auth.js +2 -2
  73. package/src/command-specs/files.js +29 -0
  74. package/src/command-specs/handover.js +331 -79
  75. package/src/command-specs/helpers.js +2 -0
  76. package/src/command-specs/index.js +11 -5
  77. package/src/command-specs/profile.js +42 -1
  78. package/src/command-specs/skills.js +242 -1
  79. package/src/command-specs/spaces.js +645 -0
  80. package/src/command-specs/tools.js +0 -6
  81. package/src/command-specs/views.js +69 -0
  82. package/src/runtime/agent-browser.js +92 -29
  83. package/src/runtime/app-boundary-validator.js +7 -4
  84. package/src/runtime/app-data-literals.js +82 -0
  85. package/src/runtime/app-platform.js +321 -253
  86. package/src/runtime/computer-identity.d.ts +30 -0
  87. package/src/runtime/computer-identity.js +151 -0
  88. package/src/runtime/config-lock.js +135 -0
  89. package/src/runtime/confined-space-build.js +74 -0
  90. package/src/runtime/confined-space-verify.js +49 -0
  91. package/src/runtime/delegated-context.js +5 -21
  92. package/src/runtime/native-record-files.js +47 -0
  93. package/src/runtime/oauth.js +18 -1
  94. package/src/runtime/profiles.js +5 -107
  95. package/src/runtime/retired-sdk-files.js +20 -0
  96. package/src/runtime/screenshot-framing.js +85 -0
  97. package/src/runtime/skill-sync/cloud-client.ts +26 -4
  98. package/src/runtime/skill-sync/index.ts +230 -35
  99. package/src/runtime/skill-sync/local-scanner.ts +188 -29
  100. package/src/runtime/skill-sync/native-identity.ts +102 -0
  101. package/src/runtime/skill-sync/native-plan.ts +70 -0
  102. package/src/runtime/skill-sync/sync-plan.ts +16 -9
  103. package/src/runtime/skill-sync/types.ts +32 -6
  104. package/src/runtime/source-root.js +32 -0
  105. package/src/runtime/space-collection-scaffold.js +66 -0
  106. package/src/runtime/space-database-structures.js +229 -0
  107. package/src/runtime/space-fixture-broker.js +50 -0
  108. package/src/runtime/space-lock.js +337 -0
  109. package/src/runtime/space-platform.js +105 -0
  110. package/src/runtime/space-source.js +281 -0
  111. package/src/runtime/space-test-server.js +327 -0
  112. package/src/runtime/space-verification.js +89 -0
  113. package/src/runtime/space-verify-browser-worker.js +51 -0
  114. package/src/runtime/space-view-manifest.js +254 -0
  115. package/src/runtime/store-screenshot.js +10 -7
  116. package/src/runtime/sync-skills.d.ts +3 -1
  117. package/src/runtime/sync-skills.js +10 -2
  118. package/src/runtime/transport.js +8 -6
  119. package/src/runtime/view-render.js +49 -0
  120. package/src/skill-sync-worker.js +14 -2
  121. package/src/space-harness-host.ts +103 -0
  122. package/template/.harness/index.html.tmpl +7 -10
  123. package/template/app/globals.css +1 -0
  124. package/src/command-specs/reports.js +0 -97
@@ -1,7 +1,7 @@
1
1
  <!-- notis-cli:instructions:start -->
2
2
  ## Notis CLI
3
3
 
4
- Use the Notis CLI (`npx --package @notis_ai/cli@latest -- notis ...`) whenever the task involves the user's personal data or connected services: integrations (Gmail, Google Calendar, Notion, Slack, GitHub, ...), long-term memories, reminders, automations, native Notis databases and notes, public deep research, or Notis apps. Prefer it over telling the user to operate another app manually, and never treat a task as blocked merely because a capability is absent from the current tool list—reach it through the CLI.
4
+ Use the Notis CLI (`npx --package @notis_ai/cli@latest -- notis ...`) whenever the task involves the user's personal data or connected services: integrations (Gmail, Google Calendar, Notion, Slack, GitHub, ...), long-term memories, reminders, automations, native Notis databases and notes, public deep research, or Notis Spaces and apps. Prefer it over telling the user to operate another app manually, and never treat a task as blocked merely because a capability is absent from the current tool list—reach it through the CLI.
5
5
 
6
6
  On a local machine, `notis login` authorizes a scoped, revocable OAuth profile in the browser. Notis Desktop may authorize that profile automatically, but the Desktop app does not need to remain running. Hosted Notis shells use `NOTIS_JWT`. Before acting on personal data, run `notis whoami` when the intended account or endpoint is not already clear.
7
7
 
@@ -15,7 +15,7 @@ Relevant Notis long-term memory may be injected into a turn inside `<notis_relev
15
15
  4. Execute: `notis tools exec <TOOL> --arguments '<json>'`; batch independent calls with `notis tools exec-parallel '<json-array>'`.
16
16
  5. If an integration is not connected, `notis tools link <toolkit>` prints a connection URL to give the user.
17
17
 
18
- Tool name shapes: `LOCAL_NOTIS_*` (native Notis), `LOCAL_NOTIS_DATABASE_*` (databases and notes), `LOCAL_MCP_*` (the user's connected MCP servers), and integration tools such as `GMAIL_*`, `NOTION_*`, and `GOOGLECALENDAR_*`.
18
+ Tool name shapes: `LOCAL_NOTIS_*` (native Notis), `LOCAL_NOTIS_DATABASE_*` (databases and notes), `CUSTOM_*` (the user's remote MCP servers), `LOCAL_MCP_*` (MCP servers on the user's computer), and integration tools such as `GMAIL_*`, `NOTION_*`, and `GOOGLECALENDAR_*`.
19
19
 
20
20
  ### Main features
21
21
 
@@ -24,7 +24,7 @@ Tool name shapes: `LOCAL_NOTIS_*` (native Notis), `LOCAL_NOTIS_DATABASE_*` (data
24
24
  - **Automations:** `LOCAL_NOTIS_INSERT_AUTOMATION`, `LOCAL_NOTIS_UPDATE_AUTOMATION`, and `LOCAL_NOTIS_RUN_AUTOMATION` run an agent prompt on a cron schedule or event trigger; `LOCAL_NOTIS_LIST_INTEGRATION_TRIGGERS` lists triggers. Fixed text at a time is a reminder; work an agent must perform is an automation.
25
25
  - **Databases and notes:** `LOCAL_NOTIS_DATABASE_QUERY` reads; generated `LOCAL_NOTIS_DATABASE_UPSERT_<SLUG>` tools write rows; `LOCAL_NOTIS_DATABASE_UPSERT_DATABASE` creates or alters a schema. Discover the exact per-database tool names before use.
26
26
  - **Deep research:** `LOCAL_NOTIS_DEEP_SEARCH` performs public multi-source research.
27
- - **Notis apps:** Use the notis-apps skill and release-only workflow. App create/edit requests authorize Workspace deployment after checks on local and cloud computers. Explicit read-only, preview-only or no-deploy requests stop at local checks without remote mutations. Preserve exact app identity and deployment base. Verify the installed result. Store publication requires separate approval.
27
+ - **Spaces and legacy apps:** Use the notis-apps skill's release workflow. For accounts moved to Spaces, source work uses `notis spaces`; `notis apps` is only for accounts that have not moved. Never use the legacy App path to modify a migrated Space. Create/edit requests authorize Workspace deployment after checks on local and cloud computers. Explicit read-only, preview-only or no-deploy requests stop at local checks without remote mutations. Preserve the exact Space or app identity and deployment base. Verify the installed result. Store publication requires separate approval.
28
28
 
29
29
  ### Rules
30
30
 
@@ -94,9 +94,13 @@ through the connection and show them the actual result: today's calendar events,
94
94
  their most recent email threads, the databases in their Notion. A connected
95
95
  integration is a claim; their own data on screen is proof.
96
96
 
97
- If they connect nothing, fall back to installing a public app:
98
- `LOCAL_NOTIS_LIST_PUBLIC_APP_STORE`, then `LOCAL_NOTIS_INSTALL_APP` with
99
- `destination_type="personal"`.
97
+ If they connect nothing, you may offer a Space from the Space Store instead, but
98
+ only on an account that has the Store: it is not open to every account yet. Check
99
+ with `notis spaces store list` first. If it answers that Spaces or the Store are
100
+ not available for this account (`spaces_unavailable` or
101
+ `spaces_store_unavailable`), skip this fallback without retrying and go to
102
+ step 3. Otherwise install one with
103
+ `notis spaces store install <listing-id> --request-id <stable-id>`.
100
104
 
101
105
  ## 3. Finish onboarding
102
106
 
@@ -935,6 +935,7 @@ async function appsScreenshotHandler(ctx) {
935
935
  sessionName: captureSessionName,
936
936
  screenshotPath: browserScreenshotPath,
937
937
  focusSelector: ctx.options.raw ? null : focus,
938
+ frameContent: !ctx.options.raw,
938
939
  width,
939
940
  height,
940
941
  timeoutMs: Number.parseInt(ctx.globalOptions.timeoutMs || '', 10) || 15_000,
@@ -949,7 +950,7 @@ async function appsScreenshotHandler(ctx) {
949
950
  height,
950
951
  accent: appConfig.accent,
951
952
  seed: appConfig.name || manifest.app?.name || appSlug,
952
- focused: Boolean(focus),
953
+ focused: Boolean(result.framing?.focus_selector),
953
954
  theme: theme || 'light',
954
955
  });
955
956
  } catch (error) {
@@ -133,9 +133,9 @@ export const authCommandSpecs = [
133
133
  },
134
134
  {
135
135
  command_path: ['logout'],
136
- summary: 'Revoke and remove the OAuth credential for one CLI profile.',
136
+ summary: 'Sign this computer out of one CLI profile: revoke and remove its OAuth credential.',
137
137
  when_to_use:
138
- 'Use this to disconnect a single account. Other profiles keep their credentials unless you pass --all-profiles.',
138
+ 'Use this to disconnect a single account on this computer. Its sign-ins on other computers stay, and other profiles keep their credentials unless you pass --all-profiles.',
139
139
  args_schema: {
140
140
  arguments: [],
141
141
  options: [
@@ -0,0 +1,29 @@
1
+ import { uploadNativeRecordFileWithCliRuntime } from '../runtime/native-record-files.js';
2
+ import { parseJson } from './helpers.js';
3
+ import { usageError } from '../runtime/errors.js';
4
+
5
+ export const filesCommandSpecs = [{
6
+ command_path: ['files', 'upload'],
7
+ summary: 'Upload a local file for one native record you can edit.',
8
+ when_to_use: 'Save file bytes without a cloud computer; attach the returned file reference through a normal revision-checked row update.',
9
+ args_schema: { arguments: [{ token: '<file>', key: 'file', description: 'Local regular file up to 8 MB.' }], options: [
10
+ { flags: '--target <json>', description: 'Exact native target returned by schema discovery.' },
11
+ { flags: '--record-key <id>', description: 'Stable record key to attach this file to.' },
12
+ { flags: '--schema-revision <number>', description: 'Current native schema revision.' },
13
+ { flags: '--request-id <uuid>', description: 'Stable UUID; reuse with identical bytes after an uncertain response.' },
14
+ { flags: '--name <name>', description: 'Attachment name; defaults to the local basename.' },
15
+ { flags: '--content-type <mime>', description: 'File MIME type; inferred from known extensions.' },
16
+ ] },
17
+ examples: ['notis files upload ./report.html --target \'{"database_id":"<database-id>"}\' --record-key <record-key> --schema-revision 1 --request-id <uuid>'],
18
+ mutates: true, idempotent: true, require_auth: true,
19
+ backend_call: { type: 'http', path: '/portal_native_files/upload' },
20
+ async handler(ctx) {
21
+ if (!ctx.options.target || ctx.options.schemaRevision === undefined) throw usageError('Pass the discovered native --target and --schema-revision.');
22
+ const result = await uploadNativeRecordFileWithCliRuntime({ runtime: ctx.runtime, filePath: ctx.args.file,
23
+ target: parseJson(ctx.options.target, '--target'), recordKey: ctx.options.recordKey,
24
+ schemaRevision: Number(ctx.options.schemaRevision), requestId: ctx.options.requestId,
25
+ ...(ctx.options.name ? { name: ctx.options.name } : {}), ...(ctx.options.contentType ? { contentType: ctx.options.contentType } : {}) });
26
+ return ctx.output.emitSuccess({ command: 'files upload', data: result,
27
+ humanSummary: 'Uploaded and verified the file. Attach the returned file reference with a revision-checked record update.', meta: { mutating: true } });
28
+ },
29
+ }];