appilot-mcp 0.1.1 → 0.3.0

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 (52) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/LICENSE +15 -0
  4. package/README.md +102 -24
  5. package/dist/appilot-configurator.mcpb +0 -0
  6. package/dist/cli.d.ts +34 -0
  7. package/dist/cli.js +171 -0
  8. package/dist/client.d.ts +122 -3
  9. package/dist/client.js +306 -31
  10. package/dist/config.d.ts +14 -0
  11. package/dist/config.js +19 -0
  12. package/dist/contract/bundleSnapshot.js +8 -1
  13. package/dist/contract/healthContract.d.ts +1 -1
  14. package/dist/contract/healthContract.js +100 -10
  15. package/dist/contract/types.d.ts +37 -1
  16. package/dist/index.bundle.js +4487 -16520
  17. package/dist/index.js +7 -0
  18. package/dist/inspect.d.ts +88 -0
  19. package/dist/inspect.js +384 -0
  20. package/dist/manifest.d.ts +14 -2
  21. package/dist/manifest.js +31 -9
  22. package/dist/public-marketplace/.claude-plugin/marketplace.json +20 -0
  23. package/dist/public-marketplace/README.md +23 -0
  24. package/dist/public-marketplace/plugins/app-configurator/.claude-plugin/plugin.json +43 -0
  25. package/dist/public-marketplace/plugins/app-configurator/README.md +328 -0
  26. package/dist/public-marketplace/plugins/app-configurator/dist/index.bundle.js +57370 -0
  27. package/dist/public-marketplace/plugins/app-configurator/skills/app-configurator/SKILL.md +267 -0
  28. package/dist/public-marketplace/plugins/app-configurator/skills/app-configurator/agents/openai.yaml +13 -0
  29. package/dist/redaction.d.ts +18 -3
  30. package/dist/redaction.js +27 -3
  31. package/dist/remote/consent.d.ts +30 -20
  32. package/dist/remote/consent.js +114 -82
  33. package/dist/remote/consentMessages.d.ts +65 -0
  34. package/dist/remote/consentMessages.js +199 -0
  35. package/dist/remote/handoff.d.ts +10 -0
  36. package/dist/remote/handoff.js +44 -0
  37. package/dist/remote/httpServer.js +28 -5
  38. package/dist/remote/oauth.d.ts +39 -6
  39. package/dist/remote/oauth.js +281 -36
  40. package/dist/scaffold.d.ts +110 -1
  41. package/dist/scaffold.js +474 -39
  42. package/dist/server.js +425 -38
  43. package/dist/soak.js +21 -1
  44. package/dist/templates.d.ts +62 -0
  45. package/dist/templates.js +255 -0
  46. package/dist/verify.js +18 -1
  47. package/dist/version.d.ts +1 -1
  48. package/dist/version.js +1 -1
  49. package/examples/app.appilot.json +212 -0
  50. package/mcpb/manifest.json +117 -15
  51. package/package.json +5 -3
  52. package/skills/app-configurator/SKILL.md +136 -25
@@ -10,8 +10,23 @@
10
10
  * integration a developer must write in their own backend, it is
11
11
  * security-critical, and getting it wrong is invisible until an auth edge case
12
12
  * shows up in production.
13
+ *
14
+ * Everything returned here has to COMPILE. Three of the six framework outputs
15
+ * did not typecheck under `strict` when the 2026-09-07 audit ran them through
16
+ * `tsc`, and the relay, the piece a developer is least able to review, was the
17
+ * file that failed. `test/scaffoldTypecheck.test.ts` now compiles every output
18
+ * against the workspace sources of `appilot` and `appilot-server`.
19
+ */
20
+ /**
21
+ * The frameworks with a first-class relay, plus `other`.
22
+ *
23
+ * `appilot-server` is a Node package, so a Django, Rails or PHP host cannot use
24
+ * it. That is not a reason to answer a raw Zod enum dump: the exchange is one
25
+ * authenticated HTTPS call, and `other` returns it as curl plus a Python and a
26
+ * Ruby handler.
13
27
  */
14
- export type Framework = 'next' | 'express' | 'fastify' | 'hono' | 'remix' | 'sveltekit';
28
+ export declare const SCAFFOLD_FRAMEWORKS: readonly ["next", "express", "fastify", "hono", "remix", "sveltekit", "other"];
29
+ export type Framework = (typeof SCAFFOLD_FRAMEWORKS)[number];
15
30
  export interface ScaffoldFile {
16
31
  /** Suggested path, relative to the repository root. The agent may move it. */
17
32
  path: string;
@@ -34,4 +49,98 @@ interface ScaffoldOptions {
34
49
  idNamespace?: string;
35
50
  }
36
51
  export declare function scaffoldIntegration(options: ScaffoldOptions): ScaffoldResult;
52
+ /**
53
+ * `scaffold_agent_first`: the four pieces one capability needs, together.
54
+ *
55
+ * `scaffoldIntegration` above returns the integration. It does not return the
56
+ * shape of an agent-first application, and the two are not the same thing. A
57
+ * capability that a user can complete through the assistant alone is four
58
+ * artifacts that have to agree with each other: the way the agent calls the
59
+ * backend, the way the page acts in the user's own session, the procedure the
60
+ * agent follows in the interface, and the meaning behind it.
61
+ *
62
+ * The split between the last two is the rule that is easiest to state and
63
+ * easiest to break. The Action Plan is the procedure. Knowledge carries meaning.
64
+ * A step-by-step knowledge article is a procedure in the wrong place, and it
65
+ * teaches the agent to author steps instead of adopting the plan that already
66
+ * exists. Emitting both halves correctly is how a scaffold teaches that once.
67
+ *
68
+ * Everything emitted here is in the shape the API accepts, and
69
+ * `test/scaffoldAgentFirst.test.ts` proves it by running the output through the
70
+ * shared action-plan schemas and through the health contract. The previous
71
+ * version emitted `{ title, steps: [{ text }] }` sections and a `form_values`
72
+ * entry with no `fields`, so the tool meant to make an app agent-first produced
73
+ * a plan `create_entity` rejected and `runHealthContract` crashed on.
74
+ */
75
+ export interface AgentFirstScaffold {
76
+ capability: string;
77
+ shape: CapabilityShape;
78
+ /** Ready for `create_entity({ kind: 'tool' })`, minus the credential. Null for a page-only capability. */
79
+ tool: Record<string, unknown> | null;
80
+ /** Ready for `create_entity({ kind: 'action_plan' })` once the control ids exist. Null when the capability has no in-page procedure. */
81
+ actionPlan: Record<string, unknown> | null;
82
+ /** Ready for `create_entity({ kind: 'knowledge' })`. */
83
+ knowledge: Record<string, unknown>;
84
+ files: ScaffoldFile[];
85
+ order: string[];
86
+ notes: string[];
87
+ }
88
+ /**
89
+ * What the capability does to the app, which decides whether a plan makes sense
90
+ * and what its steps are.
91
+ *
92
+ * `create` is a form the user fills and submits. `navigate` takes them to a
93
+ * place. `read` answers a question, and it gets NO action plan: a plan whose
94
+ * only step opens a screen does nothing, and the health contract says so. The
95
+ * scaffold used to emit the open/fill/submit template for all three, so asking
96
+ * it for "Show a booking" produced a plan that filled a form nobody had.
97
+ */
98
+ export type CapabilityShape = 'create' | 'navigate' | 'read';
99
+ interface AgentFirstOptions {
100
+ /** What the user is trying to do, in their words. */
101
+ capability: string;
102
+ /** Short English slug, used for the tool name and the plan id. */
103
+ slug: string;
104
+ appId: number | null;
105
+ /**
106
+ * The host endpoint the agent should reach, as a PATH on the host origin.
107
+ * The executor rejects an absolute URL: a server-side tool call is proxied
108
+ * to the app's own origin, never to an arbitrary host.
109
+ */
110
+ endpoint?: {
111
+ method: string;
112
+ path: string;
113
+ } | null;
114
+ /** True when the operation is UI-coupled and belongs in the page instead. */
115
+ clientSide?: boolean;
116
+ /** What the capability does. Defaults to `create`. */
117
+ shape?: CapabilityShape;
118
+ /** Where the plan's steps run. Defaults to `/`. */
119
+ viewPath?: string;
120
+ }
121
+ export declare function scaffoldAgentFirst(options: AgentFirstOptions): AgentFirstScaffold;
122
+ export interface IntegrationSnippet {
123
+ apiUrl: string | null;
124
+ scriptTag: string;
125
+ bootSnippet: string;
126
+ tokenEndpointHint: string;
127
+ publicEnvName: string;
128
+ notes: string[];
129
+ }
130
+ /**
131
+ * The script tag and the boot call for an app that is already provisioned.
132
+ *
133
+ * `create_app` returns these, and returning them was the only way to get them,
134
+ * so a developer who had lost the snippet re-ran a provisioning write to read
135
+ * one line of HTML. They are composed from the connection and the key, so this
136
+ * is pure: it calls nothing and needs no scope. The shape matches what the
137
+ * backend's own `buildIntegration` returns, deliberately, so a curl caller and
138
+ * an agent read the same thing.
139
+ */
140
+ export declare function integrationSnippet(options: {
141
+ widgetScriptUrl: string;
142
+ apiUrl?: string | null;
143
+ widgetKey?: string | null;
144
+ framework?: Framework;
145
+ }): IntegrationSnippet;
37
146
  export {};