@tallpond/cli 0.0.2 → 0.0.3

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 (2) hide show
  1. package/README.md +14 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -58,12 +58,24 @@ handler:
58
58
 
59
59
  ```ts
60
60
  // functions/submitMove.ts — invoked as tallpond.functions.invoke('submitMove', args)
61
- export default async (ctx, args) => {
62
- await ctx.db.query({ table: 'moves', insert: args })
61
+ import type { FunctionContext } from '@tallpond/sdk' // type-only; nothing bundled
62
+
63
+ export default async (ctx: FunctionContext, args: { resourceId: string; move: unknown }) => {
64
+ await ctx.db.query({
65
+ scope: { kind: 'resource', resourceId: args.resourceId },
66
+ table: 'moves',
67
+ op: 'insert',
68
+ values: { move: args.move },
69
+ })
63
70
  return { ok: true }
64
71
  }
65
72
  ```
66
73
 
74
+ The ctx surface is exactly `userId`, `resourceId`, `fn`, `invocationId`,
75
+ `db.query`/`db.batch` (raw `/v1/db` wire shape), and `gateway(path, body)` —
76
+ annotate with `FunctionContext` so the compiler enforces it. Full contract:
77
+ <https://tallpond.com/docs/functions/>.
78
+
67
79
  File names must be identifiers (letters/digits/underscores). Shared helpers and
68
80
  types belong in a subdirectory (e.g. `functions/lib/`) — subdirectories aren't
69
81
  scanned, and handlers can import from them freely (everything is bundled). A
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tallpond/cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "The tallpond developer CLI — sign in, register an app, and deploy schema + frontend with one command.",
5
5
  "license": "MIT",
6
6
  "repository": {