@feltdb/feltkit 0.4.0 → 0.5.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.
- package/dist/agent-engine.d.ts +93 -0
- package/dist/agent-engine.js +40 -0
- package/dist/agent-engine.js.map +1 -0
- package/dist/app.d.ts +153 -4
- package/dist/app.js +134 -25
- package/dist/app.js.map +1 -1
- package/dist/appboundry/build.d.ts +7 -0
- package/dist/appboundry/build.js +4 -1
- package/dist/appboundry/build.js.map +1 -1
- package/dist/appboundry/guest.js +4 -0
- package/dist/appboundry/guest.js.map +1 -1
- package/dist/appboundry/host.d.ts +21 -0
- package/dist/appboundry/host.js +25 -0
- package/dist/appboundry/host.js.map +1 -1
- package/dist/appboundry/runtime.js +1 -0
- package/dist/appboundry/runtime.js.map +1 -1
- package/dist/boards/index.d.ts +1258 -0
- package/dist/boards/index.js +1410 -0
- package/dist/boards/index.js.map +1 -0
- package/dist/boards/model.d.ts +177 -0
- package/dist/boards/model.js +177 -0
- package/dist/boards/model.js.map +1 -0
- package/dist/boards/react.d.ts +18 -0
- package/dist/boards/react.js +339 -0
- package/dist/boards/react.js.map +1 -0
- package/dist/cli/deploy-appboundry-self-hosted.js +2 -2
- package/dist/cli/deploy.js +19 -6
- package/dist/cli/deploy.js.map +1 -1
- package/dist/cli/main.js +70 -5
- package/dist/cli/main.js.map +1 -1
- package/dist/client/index.d.ts +265 -4
- package/dist/client/index.js +170 -3
- package/dist/client/index.js.map +1 -1
- package/dist/cron.d.ts +18 -0
- package/dist/cron.js +67 -0
- package/dist/cron.js.map +1 -0
- package/dist/dashboard/assets/index-iIj7SL77.js +15 -0
- package/dist/dashboard/index.html +1 -1
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +3 -0
- package/dist/docs.js.map +1 -1
- package/dist/eve/index.d.ts +77 -0
- package/dist/eve/index.js +128 -0
- package/dist/eve/index.js.map +1 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/native/build.d.ts +112 -0
- package/dist/native/build.js +472 -0
- package/dist/native/build.js.map +1 -0
- package/dist/native/index.d.ts +67 -0
- package/dist/native/index.js +113 -0
- package/dist/native/index.js.map +1 -0
- package/dist/native/instance.d.ts +3 -0
- package/dist/native/instance.js +18 -0
- package/dist/native/instance.js.map +1 -0
- package/dist/react/agent-control.d.ts +2 -0
- package/dist/react/agent-control.js +1 -1
- package/dist/react/agent-control.js.map +1 -1
- package/dist/react/auth.d.ts +15 -1
- package/dist/react/auth.js +28 -5
- package/dist/react/auth.js.map +1 -1
- package/dist/react/hooks.d.ts +88 -0
- package/dist/react/hooks.js +188 -0
- package/dist/react/hooks.js.map +1 -0
- package/dist/react/index.d.ts +5 -88
- package/dist/react/index.js +3 -185
- package/dist/react/index.js.map +1 -1
- package/dist/runtime/agent-control.d.ts +10 -0
- package/dist/runtime/agent-control.js +9 -1
- package/dist/runtime/agent-control.js.map +1 -1
- package/dist/runtime/agent-run.d.ts +166 -0
- package/dist/runtime/agent-run.js +431 -0
- package/dist/runtime/agent-run.js.map +1 -0
- package/dist/runtime/agent.d.ts +158 -1
- package/dist/runtime/agent.js +329 -8
- package/dist/runtime/agent.js.map +1 -1
- package/dist/runtime/assemble.js +14 -1
- package/dist/runtime/assemble.js.map +1 -1
- package/dist/runtime/authority.d.ts +9 -0
- package/dist/runtime/authority.js.map +1 -1
- package/dist/runtime/context.d.ts +9 -0
- package/dist/runtime/required-capabilities.d.ts +73 -0
- package/dist/runtime/required-capabilities.js +69 -0
- package/dist/runtime/required-capabilities.js.map +1 -0
- package/dist/runtime/runtime.d.ts +70 -1
- package/dist/runtime/runtime.js +261 -9
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/sessions.d.ts +1 -0
- package/dist/runtime/sessions.js +1 -1
- package/dist/runtime/sessions.js.map +1 -1
- package/dist/runtime/tenancy.d.ts +9 -1
- package/dist/runtime/tenancy.js +22 -0
- package/dist/runtime/tenancy.js.map +1 -1
- package/dist/runtime/transactions.d.ts +3 -1
- package/dist/runtime/transactions.js.map +1 -1
- package/dist/server/eve.d.ts +287 -0
- package/dist/server/eve.js +1071 -0
- package/dist/server/eve.js.map +1 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.js +58 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/mcp.d.ts +7 -7
- package/dist/server/project.js +20 -3
- package/dist/server/project.js.map +1 -1
- package/dist/server/tenancy.d.ts +2 -0
- package/dist/server/tenancy.js +31 -1
- package/dist/server/tenancy.js.map +1 -1
- package/dist/testing/index.d.ts +1 -4
- package/dist/testing/index.js.map +1 -1
- package/docs/AGENT-CONTROL.md +36 -0
- package/docs/APPBOUNDRY.md +36 -0
- package/docs/AUTH.md +2 -0
- package/docs/EVE-COMPOSITION.md +75 -0
- package/docs/NATIVE-AGENTS.md +353 -0
- package/docs/NATIVE.md +137 -0
- package/docs/README.md +5 -2
- package/package.json +33 -7
- package/skills/.claude-plugin/marketplace.json +1 -1
- package/skills/.claude-plugin/plugin.json +1 -1
- package/skills/feltkit-agent/SKILL.md +1 -1
- package/skills/feltkit-build/SKILL.md +1 -1
- package/skills/feltkit-data/SKILL.md +1 -1
- package/skills/feltkit-operations/SKILL.md +1 -1
- package/skills/feltkit-services/SKILL.md +1 -1
- package/dist/dashboard/assets/index-BhxrvY37.js +0 -15
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<link rel="apple-touch-icon" href="/_feltkit/apple-touch-icon.png" />
|
|
10
10
|
<title>FeltKit</title>
|
|
11
11
|
<script>(function(){try{var v=window.localStorage.getItem("stack-ui.theme");if(v==="light"||v==="dark")document.documentElement.setAttribute("data-stack-theme",v);}catch(e){}})();</script>
|
|
12
|
-
<script type="module" crossorigin src="/_feltkit/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/_feltkit/assets/index-iIj7SL77.js"></script>
|
|
13
13
|
<link rel="stylesheet" crossorigin href="/_feltkit/assets/index-CSzYeCo_.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
package/dist/docs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const PACKAGE_NAME = "@feltdb/feltkit";
|
|
2
2
|
/** The documents shipped in the package, with what each one answers. Order = reading order. */
|
|
3
|
-
export declare const SHIPPED_DOCS: readonly [readonly ["ARCHITECTURE.md", "How FeltKit is put together: one FeltDB instance, AppPort, AppPort Services"], readonly ["GUARANTEES.md", "What FeltKit guarantees, and its known limitations"], readonly ["TRANSACTIONS.md", "Mutations, ctx.db.sequence and ctx.afterCommit: the transaction contract"], readonly ["SECURITY.md", "Authorization, sessions, credentials, and production Studio"], readonly ["AUTH.md", "Accounts, sessions, workspaces (tenancy), invitations, and the React sign-in and workspace screens"], readonly ["PRESENCE-AND-SIGNALING-PROPOSAL.md", "Presence leases, session binding and transient messages: the app.presence API and its status"], readonly ["POLICIES.md", "Declarative policies (owner, sharing, state, input, roles, delegation), managed versions without a redeploy, simulation, decision evidence"], readonly ["SIGN-IN-BROKER.md", "Sign in with GitHub and Google with nothing to register: the FeltKit broker, the assertion it signs, the extension flow, running and rotating it"], readonly ["EXTENSION-HOSTS.md", "Running the app in a browser extension: ownership, token storage, session end, lifecycle, gaps"], readonly ["INVOCATIONS.md", "Surfaces and invocations: registering entry points, the feltkit.invocation/1 contract, the durable lifecycle, dispatch and recovery"], readonly ["EXECUTION.md", "Placement-neutral execution: the control plane and execution environments, the execution contract, adapters, placement, authority and evidence"], readonly ["LOCAL-AUTHORITY.md", "The private AuthBoundry beside the application (authority.local): grants, agents, per-agent delegation and the agentCallers opt-in"], readonly ["CONNECTIONS.md", "People's own connections to integrations (credential.owner: person): connecting, isolation, AuthBoundry at every call (reference implementation)"], readonly ["AGENT-OPERATIONS.md", "Agents: MCP, tasks, proposals, approvals, and evidence"], readonly ["AGENT-CONTROL.md", "Steering a running agent: update signals, submitted updates at safe boundaries, pause, resume, interrupt, stop"], readonly ["GENERATION.md", "Model generation in an application: actions, streaming, tools as proposals, in-app approvals, caller context"], readonly ["RESOLVER.md", "Model references: change the model a deployed app uses through Resolver, without a redeploy"], readonly ["PATH-TO-PRODUCTION.md", "From a local app to production: deploy targets and what you must provide"], readonly ["BACKUP.md", "Backing up and restoring an environment's state"], readonly ["COMPONENTS.md", "Runtime components: a gateway or worker that runs with the application, as a declared principal"], readonly ["PROVIDERS.md", "AppPort providers: packages that contribute capabilities, credentials, external effects and channels to the application"], readonly ["APPBOUNDRY.md", "The AppBoundry artifact, deploying through AppBoundry, and the self-hosted runtime"], readonly ["APPBOUNDRY-DEPLOY-CONTRACT.md", "The deployment contract FeltKit expects from AppBoundry (proposed)"], readonly ["WHY-FELTKIT.md", "Design choices, compared with Convex"], readonly ["UPSTREAM-GAPS.md", "Known gaps in FeltDB, AppPort and AppPort Services, and their status"], readonly ["MEASURE.md", "feltkit measure: what an application is made of, its provenance, platform use and app-built infrastructure"]];
|
|
3
|
+
export declare const SHIPPED_DOCS: readonly [readonly ["ARCHITECTURE.md", "How FeltKit is put together: one FeltDB instance, AppPort, AppPort Services"], readonly ["GUARANTEES.md", "What FeltKit guarantees, and its known limitations"], readonly ["TRANSACTIONS.md", "Mutations, ctx.db.sequence and ctx.afterCommit: the transaction contract"], readonly ["SECURITY.md", "Authorization, sessions, credentials, and production Studio"], readonly ["AUTH.md", "Accounts, sessions, workspaces (tenancy), invitations, and the React sign-in and workspace screens"], readonly ["PRESENCE-AND-SIGNALING-PROPOSAL.md", "Presence leases, session binding and transient messages: the app.presence API and its status"], readonly ["POLICIES.md", "Declarative policies (owner, sharing, state, input, roles, delegation), managed versions without a redeploy, simulation, decision evidence"], readonly ["SIGN-IN-BROKER.md", "Sign in with GitHub and Google with nothing to register: the FeltKit broker, the assertion it signs, the extension flow, running and rotating it"], readonly ["EXTENSION-HOSTS.md", "Running the app in a browser extension: ownership, token storage, session end, lifecycle, gaps"], readonly ["NATIVE.md", "Running the app as a native iOS and Android app (Expo / React Native): feltkit build ios|android, what it produces, the compatibility matrix, validation, gaps"], readonly ["INVOCATIONS.md", "Surfaces and invocations: registering entry points, the feltkit.invocation/1 contract, the durable lifecycle, dispatch and recovery"], readonly ["EXECUTION.md", "Placement-neutral execution: the control plane and execution environments, the execution contract, adapters, placement, authority and evidence"], readonly ["LOCAL-AUTHORITY.md", "The private AuthBoundry beside the application (authority.local): grants, agents, per-agent delegation and the agentCallers opt-in"], readonly ["CONNECTIONS.md", "People's own connections to integrations (credential.owner: person): connecting, isolation, AuthBoundry at every call (reference implementation)"], readonly ["AGENT-OPERATIONS.md", "Agents: MCP, tasks, proposals, approvals, and evidence"], readonly ["EVE-COMPOSITION.md", "Composing FeltKit with EVE: the run lives in FeltDB through a FeltDB World; collisions, approvals as AppPort approvals, open questions"], readonly ["NATIVE-AGENTS.md", "Native agents: app.agent with instructions and tools, run in the app's own runtime; engines, durability, authority, approvals, limits"], readonly ["AGENT-CONTROL.md", "Steering a running agent: update signals, submitted updates at safe boundaries, pause, resume, interrupt, stop"], readonly ["GENERATION.md", "Model generation in an application: actions, streaming, tools as proposals, in-app approvals, caller context"], readonly ["RESOLVER.md", "Model references: change the model a deployed app uses through Resolver, without a redeploy"], readonly ["PATH-TO-PRODUCTION.md", "From a local app to production: deploy targets and what you must provide"], readonly ["BACKUP.md", "Backing up and restoring an environment's state"], readonly ["COMPONENTS.md", "Runtime components: a gateway or worker that runs with the application, as a declared principal"], readonly ["PROVIDERS.md", "AppPort providers: packages that contribute capabilities, credentials, external effects and channels to the application"], readonly ["APPBOUNDRY.md", "The AppBoundry artifact, deploying through AppBoundry, and the self-hosted runtime"], readonly ["APPBOUNDRY-DEPLOY-CONTRACT.md", "The deployment contract FeltKit expects from AppBoundry (proposed)"], readonly ["WHY-FELTKIT.md", "Design choices, compared with Convex"], readonly ["UPSTREAM-GAPS.md", "Known gaps in FeltDB, AppPort and AppPort Services, and their status"], readonly ["MEASURE.md", "feltkit measure: what an application is made of, its provenance, platform use and app-built infrastructure"]];
|
|
4
4
|
export type DocName = (typeof SHIPPED_DOCS)[number][0];
|
|
5
5
|
/** The shipped file on disk (inside node_modules/@feltdb/feltkit in a project). */
|
|
6
6
|
export declare function docFile(name: DocName): string;
|
package/dist/docs.js
CHANGED
|
@@ -23,11 +23,14 @@ export const SHIPPED_DOCS = [
|
|
|
23
23
|
["POLICIES.md", "Declarative policies (owner, sharing, state, input, roles, delegation), managed versions without a redeploy, simulation, decision evidence"],
|
|
24
24
|
["SIGN-IN-BROKER.md", "Sign in with GitHub and Google with nothing to register: the FeltKit broker, the assertion it signs, the extension flow, running and rotating it"],
|
|
25
25
|
["EXTENSION-HOSTS.md", "Running the app in a browser extension: ownership, token storage, session end, lifecycle, gaps"],
|
|
26
|
+
["NATIVE.md", "Running the app as a native iOS and Android app (Expo / React Native): feltkit build ios|android, what it produces, the compatibility matrix, validation, gaps"],
|
|
26
27
|
["INVOCATIONS.md", "Surfaces and invocations: registering entry points, the feltkit.invocation/1 contract, the durable lifecycle, dispatch and recovery"],
|
|
27
28
|
["EXECUTION.md", "Placement-neutral execution: the control plane and execution environments, the execution contract, adapters, placement, authority and evidence"],
|
|
28
29
|
["LOCAL-AUTHORITY.md", "The private AuthBoundry beside the application (authority.local): grants, agents, per-agent delegation and the agentCallers opt-in"],
|
|
29
30
|
["CONNECTIONS.md", "People's own connections to integrations (credential.owner: person): connecting, isolation, AuthBoundry at every call (reference implementation)"],
|
|
30
31
|
["AGENT-OPERATIONS.md", "Agents: MCP, tasks, proposals, approvals, and evidence"],
|
|
32
|
+
["EVE-COMPOSITION.md", "Composing FeltKit with EVE: the run lives in FeltDB through a FeltDB World; collisions, approvals as AppPort approvals, open questions"],
|
|
33
|
+
["NATIVE-AGENTS.md", "Native agents: app.agent with instructions and tools, run in the app's own runtime; engines, durability, authority, approvals, limits"],
|
|
31
34
|
["AGENT-CONTROL.md", "Steering a running agent: update signals, submitted updates at safe boundaries, pause, resume, interrupt, stop"],
|
|
32
35
|
["GENERATION.md", "Model generation in an application: actions, streaming, tools as proposals, in-app approvals, caller context"],
|
|
33
36
|
["RESOLVER.md", "Model references: change the model a deployed app uses through Resolver, without a redeploy"],
|
package/dist/docs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAC9C,MAAM,OAAO,GAAW,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;AAE9G,+FAA+F;AAC/F,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,CAAC,iBAAiB,EAAE,6EAA6E,CAAC;IAClG,CAAC,eAAe,EAAE,oDAAoD,CAAC;IACvE,CAAC,iBAAiB,EAAE,0EAA0E,CAAC;IAC/F,CAAC,aAAa,EAAE,6DAA6D,CAAC;IAC9E,CAAC,SAAS,EAAE,oGAAoG,CAAC;IACjH,CAAC,oCAAoC,EAAE,8FAA8F,CAAC;IACtI,CAAC,aAAa,EAAE,4IAA4I,CAAC;IAC7J,CAAC,mBAAmB,EAAE,kJAAkJ,CAAC;IACzK,CAAC,oBAAoB,EAAE,gGAAgG,CAAC;IACxH,CAAC,gBAAgB,EAAE,qIAAqI,CAAC;IACzJ,CAAC,cAAc,EAAE,gJAAgJ,CAAC;IAClK,CAAC,oBAAoB,EAAE,oIAAoI,CAAC;IAC5J,CAAC,gBAAgB,EAAE,kJAAkJ,CAAC;IACtK,CAAC,qBAAqB,EAAE,wDAAwD,CAAC;IACjF,CAAC,kBAAkB,EAAE,gHAAgH,CAAC;IACtI,CAAC,eAAe,EAAE,8GAA8G,CAAC;IACjI,CAAC,a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AAE,oEAAoE,CAAC;IACvG,CAAC,gBAAgB,EAAE,sCAAsC,CAAC;IAC1D,CAAC,kBAAkB,EAAE,sEAAsE,CAAC;IAC5F,CAAC,YAAY,EAAE,4GAA4G,CAAC;CACpH,CAAC;AAIX,mFAAmF;AACnF,MAAM,UAAU,OAAO,CAAC,IAAa;IACnC,OAAO,aAAa,CAAC,IAAI,GAAG,CAAC,WAAW,IAAI,EAAE,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,MAAM,CAAC,IAAc;IACnC,OAAO,gCAAgC,YAAY,IAAI,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAC1G,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,MAAM,CAAC,IAAa;IAClC,OAAO,gBAAgB,YAAY,SAAS,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AACvE,CAAC;AAED,gFAAgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAAG,iCAAiC,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @feltdb/feltkit/eve: for an eve agent that a FeltKit application runs (`feltkit({ eve })`). Imported by the
|
|
3
|
+
* agent's own files (`agent/channels/eve.ts`, `agent/tools/*.ts`), inside the agent's process.
|
|
4
|
+
*
|
|
5
|
+
* feltkitAuth() the channel's route auth: accepts only FeltKit's signed identity for this agent
|
|
6
|
+
* (the person, their workspace and roles, their work grant). Nothing else.
|
|
7
|
+
* feltkitCapability(entry) one of the application's capabilities as an eve tool. The call is executed by
|
|
8
|
+
* FeltKit, as the agent's worker in the person's workspace, under the person's work
|
|
9
|
+
* grant; AppPort authorizes it. A capability with `approval: "required"` pauses for a
|
|
10
|
+
* person, and runs only with the AppPort approval FeltKit issued for exactly that input.
|
|
11
|
+
*
|
|
12
|
+
* Entries come from `agent/lib/feltkit-capabilities.json`, which FeltKit generates from the application.
|
|
13
|
+
*/
|
|
14
|
+
import { type AuthFn } from "eve/channels/auth";
|
|
15
|
+
/** A JSON value. */
|
|
16
|
+
export type FeltKitJson = string | number | boolean | null | FeltKitJson[] | {
|
|
17
|
+
[key: string]: FeltKitJson;
|
|
18
|
+
};
|
|
19
|
+
/** A capability as FeltKit describes it to the agent (`agent/lib/feltkit-capabilities.json`). */
|
|
20
|
+
export interface FeltKitCapabilityEntry {
|
|
21
|
+
capability: string;
|
|
22
|
+
tool: string;
|
|
23
|
+
description: string;
|
|
24
|
+
inputSchema: {
|
|
25
|
+
[key: string]: FeltKitJson;
|
|
26
|
+
};
|
|
27
|
+
approval: "required" | "none" | string;
|
|
28
|
+
}
|
|
29
|
+
/** The error a refused or failed capability call raises in the tool (the model sees its message). */
|
|
30
|
+
export declare class FeltKitCapabilityError extends Error {
|
|
31
|
+
readonly code: string;
|
|
32
|
+
constructor(code: string, message: string);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Route auth for an agent that FeltKit runs: the identity FeltKit forwards (HS256, issuer and audience bound to
|
|
36
|
+
* this application and agent, five minutes). A person becomes `principalType: "user"` with `attributes`
|
|
37
|
+
* `{ kind, name, roles, tenantId?, grant? }`. Any other request is skipped (and refused when nothing accepts it).
|
|
38
|
+
*/
|
|
39
|
+
export declare function feltkitAuth(): AuthFn<Request>;
|
|
40
|
+
/**
|
|
41
|
+
* One of the application's capabilities as an eve tool. Name the tool file after `entry.tool`
|
|
42
|
+
* (`agent/tools/<tool>.ts`): FeltKit finds the capability of a call waiting for approval by its tool name.
|
|
43
|
+
*/
|
|
44
|
+
export declare function feltkitCapability(entry: FeltKitCapabilityEntry, options?: {
|
|
45
|
+
prompt?: (input: Record<string, unknown>) => string;
|
|
46
|
+
}): import("eve/tools").ToolDefinition<Record<string, unknown>, unknown> & {
|
|
47
|
+
execute(input: Record<string, unknown>, ctx: import("eve/tools").ToolContext): Promise<unknown>;
|
|
48
|
+
};
|
|
49
|
+
/** One update a person sent the agent, handed over at a checkpoint (appport.agent-control/1). */
|
|
50
|
+
export interface FeltKitInstruction {
|
|
51
|
+
instructionId: string;
|
|
52
|
+
text: string;
|
|
53
|
+
from: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Agent control for an agent FeltKit runs (`defineAgent({ control: feltkitControl() })`): before each model step and
|
|
57
|
+
* each step's tool calls the agent asks FeltKit whether to proceed and receives people's updates; it acknowledges each
|
|
58
|
+
* update after the step that took it. FeltKit owns the lifecycle (pause, resume, interrupt, stop, updates) and serves
|
|
59
|
+
* it over HTTP, AppPort and MCP; the agent only honours it. A refused or unreachable checkpoint holds the turn.
|
|
60
|
+
*/
|
|
61
|
+
export declare function feltkitControl(): {
|
|
62
|
+
checkpoint(input: {
|
|
63
|
+
sessionId: string;
|
|
64
|
+
turnId: string;
|
|
65
|
+
boundary: "model" | "tools";
|
|
66
|
+
}): Promise<{
|
|
67
|
+
proceed: boolean;
|
|
68
|
+
reason?: string;
|
|
69
|
+
instructions: FeltKitInstruction[];
|
|
70
|
+
}>;
|
|
71
|
+
acknowledge(input: {
|
|
72
|
+
sessionId: string;
|
|
73
|
+
instructionId: string;
|
|
74
|
+
outcome: "incorporated" | "conflict";
|
|
75
|
+
note: string;
|
|
76
|
+
}): Promise<void>;
|
|
77
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @feltdb/feltkit/eve: for an eve agent that a FeltKit application runs (`feltkit({ eve })`). Imported by the
|
|
3
|
+
* agent's own files (`agent/channels/eve.ts`, `agent/tools/*.ts`), inside the agent's process.
|
|
4
|
+
*
|
|
5
|
+
* feltkitAuth() the channel's route auth: accepts only FeltKit's signed identity for this agent
|
|
6
|
+
* (the person, their workspace and roles, their work grant). Nothing else.
|
|
7
|
+
* feltkitCapability(entry) one of the application's capabilities as an eve tool. The call is executed by
|
|
8
|
+
* FeltKit, as the agent's worker in the person's workspace, under the person's work
|
|
9
|
+
* grant; AppPort authorizes it. A capability with `approval: "required"` pauses for a
|
|
10
|
+
* person, and runs only with the AppPort approval FeltKit issued for exactly that input.
|
|
11
|
+
*
|
|
12
|
+
* Entries come from `agent/lib/feltkit-capabilities.json`, which FeltKit generates from the application.
|
|
13
|
+
*/
|
|
14
|
+
import { extractBearerToken, verifyJwtHmac } from "eve/channels/auth";
|
|
15
|
+
import { defineTool } from "eve/tools";
|
|
16
|
+
/** The error a refused or failed capability call raises in the tool (the model sees its message). */
|
|
17
|
+
export class FeltKitCapabilityError extends Error {
|
|
18
|
+
code;
|
|
19
|
+
constructor(code, message) {
|
|
20
|
+
super(`${code}: ${message}`);
|
|
21
|
+
this.name = "FeltKitCapabilityError";
|
|
22
|
+
this.code = code;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function env(name) {
|
|
26
|
+
const value = process.env[name];
|
|
27
|
+
if (!value)
|
|
28
|
+
throw new Error(`${name} is not set: this agent runs under FeltKit (feltkit dev / feltkit start), which sets it.`);
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Route auth for an agent that FeltKit runs: the identity FeltKit forwards (HS256, issuer and audience bound to
|
|
33
|
+
* this application and agent, five minutes). A person becomes `principalType: "user"` with `attributes`
|
|
34
|
+
* `{ kind, name, roles, tenantId?, grant? }`. Any other request is skipped (and refused when nothing accepts it).
|
|
35
|
+
*/
|
|
36
|
+
export function feltkitAuth() {
|
|
37
|
+
return async (request) => {
|
|
38
|
+
const result = await verifyJwtHmac(extractBearerToken(request.headers.get("authorization")), {
|
|
39
|
+
algorithm: "HS256",
|
|
40
|
+
issuer: env("FELTKIT_EVE_ISSUER"),
|
|
41
|
+
audiences: [`eve:${env("FELTKIT_EVE_AGENT")}`],
|
|
42
|
+
secret: env("FELTKIT_EVE_ASSERTION_KEY"),
|
|
43
|
+
});
|
|
44
|
+
if (!result.ok)
|
|
45
|
+
return null;
|
|
46
|
+
const auth = result.sessionAuth;
|
|
47
|
+
return { ...auth, principalType: auth.attributes.kind === "person" ? "user" : auth.principalType };
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
async function invoke(entry, input, grant, approval, sessionId, signal) {
|
|
51
|
+
if (typeof grant !== "string" || !grant)
|
|
52
|
+
throw new FeltKitCapabilityError("FORBIDDEN", "This turn carries no work grant: only a signed-in person's turn can use the application.");
|
|
53
|
+
const response = await fetch(`${env("FELTKIT_URL")}/_feltkit/eve/${env("FELTKIT_EVE_AGENT")}/invoke`, {
|
|
54
|
+
method: "POST",
|
|
55
|
+
headers: { "content-type": "application/json", authorization: `Bearer ${env("FELTKIT_EVE_SERVICE_KEY")}` },
|
|
56
|
+
body: JSON.stringify({ capability: entry.capability, input, grant, sessionId, ...(typeof approval === "string" ? { approval } : {}) }),
|
|
57
|
+
...(signal ? { signal } : {}),
|
|
58
|
+
});
|
|
59
|
+
const body = (await response.json().catch(() => null));
|
|
60
|
+
if (!body?.ok)
|
|
61
|
+
throw new FeltKitCapabilityError(body?.error?.code ?? `HTTP_${response.status}`, body?.error?.message ?? "The application refused the call.");
|
|
62
|
+
return body.value ?? null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* One of the application's capabilities as an eve tool. Name the tool file after `entry.tool`
|
|
66
|
+
* (`agent/tools/<tool>.ts`): FeltKit finds the capability of a call waiting for approval by its tool name.
|
|
67
|
+
*/
|
|
68
|
+
export function feltkitCapability(entry, options = {}) {
|
|
69
|
+
return defineTool({
|
|
70
|
+
description: entry.description,
|
|
71
|
+
inputSchema: entry.inputSchema,
|
|
72
|
+
...(entry.approval === "required"
|
|
73
|
+
? {
|
|
74
|
+
approval: {
|
|
75
|
+
request: () => "user-approval",
|
|
76
|
+
prompt: ({ input }) => options.prompt?.(input) ?? approvalPrompt(entry.description, input),
|
|
77
|
+
response: ({ request, response }) => response.decision === "deny" || (typeof response.principal.attributes.approvalRef === "string" && response.principal.attributes.answers === request.interactionId)
|
|
78
|
+
? { status: "allowed" }
|
|
79
|
+
: { status: "rejected", reason: "Approve it in the application, which records the approval." },
|
|
80
|
+
},
|
|
81
|
+
}
|
|
82
|
+
: {}),
|
|
83
|
+
async execute(input, ctx) {
|
|
84
|
+
return invoke(entry, input, ctx.session.auth.current?.attributes.grant, ctx.approval?.responder.attributes.approvalRef, ctx.session.id, ctx.abortSignal);
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/** "Allow the agent to <the description's first sentence>: “<the call's title or name>”?" */
|
|
89
|
+
function approvalPrompt(description, input) {
|
|
90
|
+
const first = (description.split(/(?<=\.)\s/)[0] ?? description).replace(/\.$/, "");
|
|
91
|
+
const action = first.charAt(0).toLowerCase() + first.slice(1);
|
|
92
|
+
const subject = typeof input.title === "string" ? input.title : typeof input.name === "string" ? input.name : null;
|
|
93
|
+
return `Allow the agent to ${action}${subject ? `: “${subject.slice(0, 120)}”` : ""}?`;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Agent control for an agent FeltKit runs (`defineAgent({ control: feltkitControl() })`): before each model step and
|
|
97
|
+
* each step's tool calls the agent asks FeltKit whether to proceed and receives people's updates; it acknowledges each
|
|
98
|
+
* update after the step that took it. FeltKit owns the lifecycle (pause, resume, interrupt, stop, updates) and serves
|
|
99
|
+
* it over HTTP, AppPort and MCP; the agent only honours it. A refused or unreachable checkpoint holds the turn.
|
|
100
|
+
*/
|
|
101
|
+
export function feltkitControl() {
|
|
102
|
+
const call = async (body) => {
|
|
103
|
+
const response = await fetch(`${env("FELTKIT_URL")}/_feltkit/eve/${env("FELTKIT_EVE_AGENT")}/control`, {
|
|
104
|
+
method: "POST",
|
|
105
|
+
headers: { "content-type": "application/json", authorization: `Bearer ${env("FELTKIT_EVE_SERVICE_KEY")}` },
|
|
106
|
+
body: JSON.stringify(body),
|
|
107
|
+
});
|
|
108
|
+
const answer = (await response.json().catch(() => null));
|
|
109
|
+
if (!answer?.ok)
|
|
110
|
+
throw new FeltKitCapabilityError(answer?.error?.code ?? `HTTP_${response.status}`, answer?.error?.message ?? "FeltKit refused the control request.");
|
|
111
|
+
return answer;
|
|
112
|
+
};
|
|
113
|
+
return {
|
|
114
|
+
async checkpoint({ sessionId, boundary }) {
|
|
115
|
+
const answer = await call({ op: "checkpoint", sessionId, boundary });
|
|
116
|
+
const instructions = Array.isArray(answer.instructions) ? answer.instructions : [];
|
|
117
|
+
return {
|
|
118
|
+
proceed: answer.proceed === true,
|
|
119
|
+
...(typeof answer.reason === "string" ? { reason: answer.reason } : {}),
|
|
120
|
+
instructions: instructions.map((i) => ({ instructionId: String(i.instructionId), text: String(i.text ?? ""), from: String(i.from ?? "") })),
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
async acknowledge({ sessionId, instructionId, outcome, note }) {
|
|
124
|
+
await call({ op: "acknowledge", sessionId, instructionId, outcome, note });
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eve/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAe,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAcvC,qGAAqG;AACrG,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IACtC,IAAI,CAAS;IACtB,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,GAAG,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,SAAS,GAAG,CAAC,IAAY;IACvB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC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,EAAE,QAAQ,EAAE,CAAC,CAAC;YACrE,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAE,MAAM,CAAC,YAA+C,CAAC,CAAC,CAAC,EAAE,CAAC;YACvH,OAAO;gBACL,OAAO,EAAE,MAAM,CAAC,OAAO,KAAK,IAAI;gBAChC,GAAG,CAAC,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvE,YAAY,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;aAC5I,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE;YAC3D,MAAM,IAAI,CAAC,EAAE,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7E,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
* export const tasks = app.collection("tasks", { title: s.string(), done: s.boolean() });
|
|
7
7
|
* export const list = app.query({ access: "tasks.read", handler: (ctx) => ctx.db.find(tasks) });
|
|
8
8
|
*/
|
|
9
|
-
export { feltkit, FeltKitApp, RESERVED_COLLECTIONS } from "./app.js";
|
|
10
|
-
export type {
|
|
9
|
+
export { feltkit, FeltKitApp, RESERVED_COLLECTIONS, functionGroup, isFunctionGroup } from "./app.js";
|
|
10
|
+
export type { FunctionGroup } from "./app.js";
|
|
11
|
+
export type { Access, AgentConfig, AgentDefinition, AuthenticateRequest, CapabilityExposure, CollectionDefinition, CollectionOptions, MigrationContext, MigrationDefinition, StoredRecord, UniqueDeclaration, FeltKitOptions, EveAgentDeclaration, ProjectAgentConfig, ProjectAgentDefinition, DevUser, AccountsOptions, AccountEmailOptions, ProviderClient, OidcProvider, SignInProviders, FunctionConfig, FunctionDefinition, FunctionKind, FunctionVisibility, MutationDefinition, ActionDefinition, PrincipalInput, QueryDefinition, } from "./app.js";
|
|
11
12
|
export { s } from "./schema.js";
|
|
12
13
|
export type { Doc, InferShape, Schema, ShapeInput, ShapeSchema } from "./schema.js";
|
|
13
14
|
export type { AuthorityMode } from "./runtime/authority-contract.js";
|
|
@@ -17,6 +18,7 @@ export type { QueryCtx, MutationCtx, ActionCtx, ActionModel, ActionAgent, AgentC
|
|
|
17
18
|
export type { GenerationMessage, GenerationResult, GenerationReceipt, ToolCall, ToolDefinition, FinishReason } from "./runtime/generation.js";
|
|
18
19
|
export type { CallerContext } from "./runtime/authority.js";
|
|
19
20
|
export type { CryptoContext } from "./runtime/crypto-token.js";
|
|
21
|
+
export type { CapabilityRequirement, CapabilityListing, CapabilityOutcome, CapabilitiesReader, CapabilitiesInvoker } from "./runtime/required-capabilities.js";
|
|
20
22
|
export type { ClaimDeclaration, ClaimSpec, ClaimStatus, ClaimProvenance } from "./runtime/claims.js";
|
|
21
23
|
export { CLAIM_TYPES, claimSpecProblem, claimSchema, isClaimSpec } from "./runtime/claims.js";
|
|
22
24
|
export type { DatabaseReader, DatabaseWriter, FindOptions, QueryRequest, QueryPage, WhereClause, OrderBy, SearchRequest } from "./runtime/data.js";
|
|
@@ -48,3 +50,6 @@ export type { Clock } from "./clock.js";
|
|
|
48
50
|
export type { GuestInfo } from "./runtime/authority.js";
|
|
49
51
|
export type { AgentGrantView, GuestLinkView, ResourceDeclaration, ResourceRef } from "./runtime/resource-access.js";
|
|
50
52
|
export type { PublicTenant, TenantBranding } from "./runtime/tenancy.js";
|
|
53
|
+
export { modelEngine, rulesEngine, type AgentEngine, type AgentTurn, type AgentTurnRequest, type AgentToolSpec, type AgentMessage, type AgentToolCall } from "./agent-engine.js";
|
|
54
|
+
export type { ReasoningDefinition } from "./app.js";
|
|
55
|
+
export type { RunOutcome as AgentRunOutcome } from "./runtime/agent-run.js";
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* export const tasks = app.collection("tasks", { title: s.string(), done: s.boolean() });
|
|
7
7
|
* export const list = app.query({ access: "tasks.read", handler: (ctx) => ctx.db.find(tasks) });
|
|
8
8
|
*/
|
|
9
|
-
export { feltkit, FeltKitApp, RESERVED_COLLECTIONS } from "./app.js";
|
|
9
|
+
export { feltkit, FeltKitApp, RESERVED_COLLECTIONS, functionGroup, isFunctionGroup } from "./app.js";
|
|
10
10
|
export { s } from "./schema.js";
|
|
11
11
|
export { FeltKitError, fail, isFeltKitError } from "./errors.js";
|
|
12
12
|
export { CLAIM_TYPES, claimSpecProblem, claimSchema, isClaimSpec } from "./runtime/claims.js";
|
|
@@ -19,4 +19,5 @@ export { INVOCATION_CONTRACT, INVOCATION_TRANSITIONS, TERMINAL as INVOCATION_TER
|
|
|
19
19
|
// Placement-neutral execution: the execution contract, placement policy and resolution (src/execution.ts).
|
|
20
20
|
export { DEFAULT_POLICY as DEFAULT_PLACEMENT_POLICY, EXECUTION_CONTRACT, PLACEMENT_CONTRACT, resolvePlacement } from "./execution.js";
|
|
21
21
|
export { LEASE_END_REASONS, LEASE_FIELDS, leaseHolds } from "./presence.js";
|
|
22
|
+
export { modelEngine, rulesEngine } from "./agent-engine.js";
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAiCrG,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAGhC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQjE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAK9F,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAMlE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,2OAA2O;AAC3O,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,mIAAmI;AACnI,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,QAAQ,IAAI,0BAA0B,EAAE,iBAAiB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAG3K,2GAA2G;AAC3G,OAAO,EAAE,cAAc,IAAI,wBAAwB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOtI,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ5E,OAAO,EAAE,WAAW,EAAE,WAAW,EAAsH,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export type NativePlatform = "ios" | "android";
|
|
2
|
+
export declare const NATIVE_PLATFORMS: readonly NativePlatform[];
|
|
3
|
+
export type NativeKind = "project" | "bundle" | "native";
|
|
4
|
+
/**
|
|
5
|
+
* The one place native dependency versions are decided: Expo SDK 58's own set (what `npx expo install` resolves for it).
|
|
6
|
+
* A generated project depends on exactly these, so two builds of one project resolve the same native modules.
|
|
7
|
+
*/
|
|
8
|
+
export declare const NATIVE_PINS: Readonly<Record<string, string>>;
|
|
9
|
+
/** `native/native.json`: what only the native app has (everything else comes from the project). */
|
|
10
|
+
export interface NativeConfig {
|
|
11
|
+
/** Name under the app's icon (default: the application's name, capitalised). */
|
|
12
|
+
name?: string;
|
|
13
|
+
/** iOS bundle identifier (default dev.feltkit.<application>: set your own before distributing). */
|
|
14
|
+
bundleIdentifier?: string;
|
|
15
|
+
/** Android application id (default: the bundle identifier). */
|
|
16
|
+
package?: string;
|
|
17
|
+
/** The URL scheme that opens the app (default: the application's name). */
|
|
18
|
+
scheme?: string;
|
|
19
|
+
/** The instance this app talks to. `--instance` and FELTKIT_URL win. */
|
|
20
|
+
instance?: string;
|
|
21
|
+
/** Extra native modules this app's own screens use, as { name: exact version }. */
|
|
22
|
+
dependencies?: Record<string, string>;
|
|
23
|
+
}
|
|
24
|
+
export interface NativeBuildOptions {
|
|
25
|
+
projectDir: string;
|
|
26
|
+
platform: NativePlatform;
|
|
27
|
+
/** Compile the native project (iOS Simulator / Android) after generating it. Default: stop at the JavaScript bundle. */
|
|
28
|
+
compile?: boolean;
|
|
29
|
+
/** Release configuration: the bundle is embedded and https is required. Default: Debug. */
|
|
30
|
+
release?: boolean;
|
|
31
|
+
/** Generate only: no install, no bundle. */
|
|
32
|
+
prepareOnly?: boolean;
|
|
33
|
+
/** Typecheck native/ with the Expo project's TypeScript before bundling (default true). */
|
|
34
|
+
typecheck?: boolean;
|
|
35
|
+
/** Skip `npm install` (the generated project must already have its node_modules). */
|
|
36
|
+
install?: boolean;
|
|
37
|
+
instance?: string;
|
|
38
|
+
/** Streams a tool's output while it runs. */
|
|
39
|
+
onOutput?: (text: string) => void;
|
|
40
|
+
}
|
|
41
|
+
export interface NativeBuildResult {
|
|
42
|
+
kind: NativeKind;
|
|
43
|
+
platform: NativePlatform;
|
|
44
|
+
application: string;
|
|
45
|
+
dir: string;
|
|
46
|
+
/** Per step: what ran and how long. */
|
|
47
|
+
steps: Array<{
|
|
48
|
+
name: string;
|
|
49
|
+
ms: number;
|
|
50
|
+
log?: string;
|
|
51
|
+
}>;
|
|
52
|
+
/** What was produced, as paths from the project. */
|
|
53
|
+
outputs: Array<{
|
|
54
|
+
what: string;
|
|
55
|
+
path: string;
|
|
56
|
+
bytes?: number;
|
|
57
|
+
}>;
|
|
58
|
+
identity: {
|
|
59
|
+
name: string;
|
|
60
|
+
id: string;
|
|
61
|
+
scheme: string;
|
|
62
|
+
version: string;
|
|
63
|
+
build: string;
|
|
64
|
+
};
|
|
65
|
+
instance: {
|
|
66
|
+
url: string;
|
|
67
|
+
source: string;
|
|
68
|
+
};
|
|
69
|
+
mode: "Debug" | "Release";
|
|
70
|
+
/** Sha-256 of everything generated and its inputs: equal inputs give an equal digest. */
|
|
71
|
+
digest: string;
|
|
72
|
+
warnings: string[];
|
|
73
|
+
/** What this build is not, in words a reader cannot mistake. */
|
|
74
|
+
notes: string[];
|
|
75
|
+
}
|
|
76
|
+
export declare function nativeDir(projectDir: string): string;
|
|
77
|
+
export declare function readNativeConfig(projectDir: string): NativeConfig;
|
|
78
|
+
/** A version the stores accept: 1 to 3 integers. The project's own version, which must be one. */
|
|
79
|
+
export declare function nativeVersion(version: unknown): string;
|
|
80
|
+
/** An integer build number from the version (1.2.3 → 10203): rises with the version, so a store accepts the upload. */
|
|
81
|
+
export declare function nativeBuildNumber(version: string): number;
|
|
82
|
+
export interface Toolchain {
|
|
83
|
+
ok: boolean;
|
|
84
|
+
problems: string[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* CocoaPods is a Ruby program, and a Ruby version manager's GEM_HOME / GEM_PATH (chruby, rbenv, rvm) point it at gems for a
|
|
88
|
+
* different Ruby: Homebrew's `pod` then fails with "Could not find 'nkf'". `pod` brings its own gems, so it runs without them.
|
|
89
|
+
*/
|
|
90
|
+
export declare function podEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
91
|
+
/** What this machine needs to compile the platform's native project: named precisely, so a blocker is actionable. */
|
|
92
|
+
export declare function toolchainProblems(platform: NativePlatform, env?: NodeJS.ProcessEnv): string[];
|
|
93
|
+
/** The files of the application the native app is built from, hashed: what makes two builds "the same app". */
|
|
94
|
+
export declare function sourceDigest(projectDir: string): string;
|
|
95
|
+
interface Generated {
|
|
96
|
+
files: Record<string, string>;
|
|
97
|
+
digest: string;
|
|
98
|
+
}
|
|
99
|
+
/** The generated project's files as text: pure of the file system apart from what it is given, so tests can read it. */
|
|
100
|
+
export declare function generateFiles(input: {
|
|
101
|
+
application: string;
|
|
102
|
+
config: NativeConfig;
|
|
103
|
+
version: string;
|
|
104
|
+
platform: NativePlatform;
|
|
105
|
+
projectDir: string;
|
|
106
|
+
sdkDir: string;
|
|
107
|
+
instance: string;
|
|
108
|
+
source: string;
|
|
109
|
+
release: boolean;
|
|
110
|
+
}): Generated;
|
|
111
|
+
export declare function buildNative(options: NativeBuildOptions): Promise<NativeBuildResult>;
|
|
112
|
+
export {};
|