apps 0.0.1-beta.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/README.md +191 -0
- package/check-publish.mjs +10 -0
- package/framework-reference.json +1 -0
- package/js/chunk-22WRQZT7.js +389 -0
- package/js/chunk-2OTCEKL2.js +29480 -0
- package/js/chunk-36DNRFZQ.js +34 -0
- package/js/chunk-3ANFZFCV.js +1799 -0
- package/js/chunk-7JXHF5IF.js +138 -0
- package/js/chunk-BCSNKUAC.js +0 -0
- package/js/chunk-BKVL7XAJ.js +47 -0
- package/js/chunk-BPEFS4YF.js +1323 -0
- package/js/chunk-C24KEZXR.js +59 -0
- package/js/chunk-D6BKYP2L.js +877 -0
- package/js/chunk-EP6AEUZO.js +19 -0
- package/js/chunk-HP7E42X6.js +1719 -0
- package/js/chunk-KWTCHVLT.js +284 -0
- package/js/chunk-LOKGDT6B.js +28 -0
- package/js/chunk-MLKGABMK.js +9 -0
- package/js/chunk-OWD2YICM.js +2486 -0
- package/js/chunk-Q2FD5IBM.js +899 -0
- package/js/chunk-R6JMJSVT.js +590 -0
- package/js/chunk-SBKHUC5L.js +56 -0
- package/js/chunk-VFUZI3NY.js +75 -0
- package/js/chunk-W7Q5EOTS.js +4375 -0
- package/js/chunk-WIDTG42X.js +171 -0
- package/js/chunk-X3YBZCJW.js +246 -0
- package/js/chunk-YDR4CPJA.js +2357 -0
- package/js/client.js +1023 -0
- package/js/contracts.js +163 -0
- package/js/effect.js +44 -0
- package/js/graphql.js +392 -0
- package/js/host.js +193 -0
- package/js/index.js +284 -0
- package/js/mcp/effect.js +23 -0
- package/js/mcp/stdio.js +123 -0
- package/js/mcp.js +37 -0
- package/js/openapi.js +246 -0
- package/js/operations/approval.js +9 -0
- package/js/react.js +37 -0
- package/js/storage/facet.js +546 -0
- package/js/ui/auth/contracts.js +19 -0
- package/js/ui/auth.js +28 -0
- package/js/ui/contracts.js +24 -0
- package/js/ui/serving.js +286 -0
- package/package.json +116 -0
- package/runtime.json +1 -0
- package/types/app-data/src/contracts/database.d.ts +193 -0
- package/types/app-data/src/implementation/cursor.d.ts +10 -0
- package/types/app-data/src/implementation/index-key.d.ts +7 -0
- package/types/app-data/src/implementation/promise.d.ts +68 -0
- package/types/app-data/src/implementation/range.d.ts +8 -0
- package/types/app-data/src/implementation/schema.d.ts +33 -0
- package/types/app-data/src/implementation/sqlite.d.ts +11 -0
- package/types/app-data/src/index.d.ts +4 -0
- package/types/apps/src/approval.d.ts +10 -0
- package/types/apps/src/client.d.ts +5 -0
- package/types/apps/src/contracts/app.d.ts +58 -0
- package/types/apps/src/contracts/approval.d.ts +14 -0
- package/types/apps/src/contracts/context.d.ts +25 -0
- package/types/apps/src/contracts/elicitation.d.ts +86 -0
- package/types/apps/src/contracts/graphql.d.ts +102 -0
- package/types/apps/src/contracts/host.d.ts +568 -0
- package/types/apps/src/contracts/http.d.ts +20 -0
- package/types/apps/src/contracts/live.d.ts +26 -0
- package/types/apps/src/contracts/mcp.d.ts +93 -0
- package/types/apps/src/contracts/openapi.d.ts +105 -0
- package/types/apps/src/contracts/operations.d.ts +30 -0
- package/types/apps/src/contracts/optimistic.d.ts +22 -0
- package/types/apps/src/contracts/provider.d.ts +96 -0
- package/types/apps/src/contracts/schedules.d.ts +51 -0
- package/types/apps/src/contracts/schema.d.ts +20 -0
- package/types/apps/src/contracts/storage.d.ts +68 -0
- package/types/apps/src/contracts/tools.d.ts +11 -0
- package/types/apps/src/contracts/ui-auth.d.ts +28 -0
- package/types/apps/src/contracts/ui.d.ts +90 -0
- package/types/apps/src/contracts/webhook-protocol.d.ts +102 -0
- package/types/apps/src/contracts/webhooks.d.ts +53 -0
- package/types/apps/src/contracts/workflows.d.ts +277 -0
- package/types/apps/src/effect.d.ts +10 -0
- package/types/apps/src/facet.d.ts +5 -0
- package/types/apps/src/graphql.d.ts +10 -0
- package/types/apps/src/host.d.ts +16 -0
- package/types/apps/src/implementation/account-operations.d.ts +32 -0
- package/types/apps/src/implementation/app.d.ts +40 -0
- package/types/apps/src/implementation/authoring.d.ts +12 -0
- package/types/apps/src/implementation/elicitation.d.ts +103 -0
- package/types/apps/src/implementation/graphql.d.ts +5 -0
- package/types/apps/src/implementation/host.d.ts +3 -0
- package/types/apps/src/implementation/http.d.ts +5 -0
- package/types/apps/src/implementation/live.d.ts +18 -0
- package/types/apps/src/implementation/mcp-call.d.ts +19 -0
- package/types/apps/src/implementation/mcp-client.d.ts +50 -0
- package/types/apps/src/implementation/mcp-stdio.d.ts +4 -0
- package/types/apps/src/implementation/mcp-tools.d.ts +6 -0
- package/types/apps/src/implementation/mcp.d.ts +4 -0
- package/types/apps/src/implementation/openapi-request.d.ts +11 -0
- package/types/apps/src/implementation/openapi.d.ts +5 -0
- package/types/apps/src/implementation/operations.d.ts +65 -0
- package/types/apps/src/implementation/optimistic.d.ts +30 -0
- package/types/apps/src/implementation/protocol-operations.d.ts +24 -0
- package/types/apps/src/implementation/provider.d.ts +16 -0
- package/types/apps/src/implementation/query-commit.d.ts +10 -0
- package/types/apps/src/implementation/schedules.d.ts +16 -0
- package/types/apps/src/implementation/schema.d.ts +93 -0
- package/types/apps/src/implementation/storage.d.ts +13 -0
- package/types/apps/src/implementation/ui-auth.d.ts +13 -0
- package/types/apps/src/implementation/ui-client.d.ts +16 -0
- package/types/apps/src/implementation/ui-errors.d.ts +2 -0
- package/types/apps/src/implementation/ui-serving.d.ts +16 -0
- package/types/apps/src/implementation/ui-watch.d.ts +2 -0
- package/types/apps/src/implementation/webhooks.d.ts +29 -0
- package/types/apps/src/implementation/workflow-context.d.ts +8 -0
- package/types/apps/src/implementation/workflow-rpc.d.ts +5 -0
- package/types/apps/src/implementation/workflows.d.ts +27 -0
- package/types/apps/src/index.d.ts +58 -0
- package/types/apps/src/mcp-stdio.d.ts +8 -0
- package/types/apps/src/mcp.d.ts +10 -0
- package/types/apps/src/openapi.d.ts +10 -0
- package/types/apps/src/react.d.ts +7 -0
- package/types/apps/src/ui-auth.d.ts +3 -0
- package/types/apps/src/ui-serving.d.ts +3 -0
- package/types/telemetry/src/browser-operations.d.ts +16 -0
- package/types/telemetry/src/browser-performance.d.ts +11 -0
- package/types/telemetry/src/browser-request-timing.d.ts +2 -0
- package/types/telemetry/src/browser.d.ts +27 -0
- package/types/telemetry/src/config.d.ts +83 -0
- package/types/telemetry/src/context.d.ts +14 -0
- package/types/telemetry/src/index.d.ts +9 -0
- package/types/telemetry/src/layer.d.ts +7 -0
- package/types/telemetry/src/measurements.d.ts +8 -0
- package/types/telemetry/src/pending-span.d.ts +7 -0
- package/types/telemetry/src/relay.d.ts +28 -0
- package/types/telemetry/src/span-attributes.d.ts +29 -0
- package/types/telemetry/src/trace-context.d.ts +20 -0
- package/types/telemetry/src/transport.d.ts +6 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Schema_exports
|
|
3
|
+
} from "./chunk-2OTCEKL2.js";
|
|
4
|
+
|
|
5
|
+
// ../app-data/src/contracts/database.ts
|
|
6
|
+
var DataName = Schema_exports.String.check(
|
|
7
|
+
Schema_exports.makeFilter((value) => /^[A-Za-z][A-Za-z0-9_]*$/.test(value) && value.length <= 128)
|
|
8
|
+
);
|
|
9
|
+
var Scalar = Schema_exports.Union([Schema_exports.String, Schema_exports.Finite, Schema_exports.Boolean]);
|
|
10
|
+
var Field = Schema_exports.Struct({
|
|
11
|
+
kind: Schema_exports.Literals(["string", "number", "boolean", "id", "userId"]),
|
|
12
|
+
optional: Schema_exports.optional(Schema_exports.Boolean),
|
|
13
|
+
default: Schema_exports.optional(Scalar),
|
|
14
|
+
references: Schema_exports.optional(DataName)
|
|
15
|
+
});
|
|
16
|
+
var Index = Schema_exports.Struct({ name: DataName, fields: Schema_exports.NonEmptyArray(DataName) });
|
|
17
|
+
var Table = Schema_exports.Struct({
|
|
18
|
+
fields: Schema_exports.Record(DataName, Field),
|
|
19
|
+
indexes: Schema_exports.Array(Index)
|
|
20
|
+
});
|
|
21
|
+
var DatabaseSchema = Schema_exports.Record(DataName, Table);
|
|
22
|
+
var Row = Schema_exports.Record(Schema_exports.String, Scalar);
|
|
23
|
+
var RowMetadata = Schema_exports.Struct({
|
|
24
|
+
id: Schema_exports.NonEmptyString,
|
|
25
|
+
createdAt: Schema_exports.String,
|
|
26
|
+
updatedAt: Schema_exports.String
|
|
27
|
+
});
|
|
28
|
+
var Patch = Schema_exports.Record(DataName, Schema_exports.NullOr(Scalar));
|
|
29
|
+
var RangeClause = Schema_exports.Struct({
|
|
30
|
+
field: DataName,
|
|
31
|
+
op: Schema_exports.Literals(["eq", "gt", "gte", "lt", "lte"]),
|
|
32
|
+
value: Schema_exports.NullOr(Scalar)
|
|
33
|
+
});
|
|
34
|
+
var QueryPlan = Schema_exports.Struct({
|
|
35
|
+
table: DataName,
|
|
36
|
+
index: DataName,
|
|
37
|
+
order: Schema_exports.Literals(["asc", "desc"]),
|
|
38
|
+
clauses: Schema_exports.Array(RangeClause)
|
|
39
|
+
});
|
|
40
|
+
var QueryTerminal = Schema_exports.Union([
|
|
41
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("collect") }),
|
|
42
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("count") }),
|
|
43
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("first") }),
|
|
44
|
+
Schema_exports.Struct({
|
|
45
|
+
kind: Schema_exports.Literal("take"),
|
|
46
|
+
count: Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(0))
|
|
47
|
+
}),
|
|
48
|
+
Schema_exports.Struct({
|
|
49
|
+
kind: Schema_exports.Literal("paginate"),
|
|
50
|
+
cursor: Schema_exports.NullOr(Schema_exports.String),
|
|
51
|
+
numItems: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
52
|
+
})
|
|
53
|
+
]);
|
|
54
|
+
var DatabaseOperation = Schema_exports.Union([
|
|
55
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("get"), table: DataName, id: Schema_exports.NonEmptyString }),
|
|
56
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("insert"), table: DataName, value: Patch }),
|
|
57
|
+
Schema_exports.Struct({
|
|
58
|
+
kind: Schema_exports.Literal("update"),
|
|
59
|
+
table: DataName,
|
|
60
|
+
id: Schema_exports.NonEmptyString,
|
|
61
|
+
patch: Patch
|
|
62
|
+
}),
|
|
63
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("delete"), table: DataName, id: Schema_exports.NonEmptyString }),
|
|
64
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("query"), plan: QueryPlan, terminal: QueryTerminal })
|
|
65
|
+
]);
|
|
66
|
+
var PaginationResult = Schema_exports.Struct({
|
|
67
|
+
page: Schema_exports.Array(Row),
|
|
68
|
+
continueCursor: Schema_exports.NullOr(Schema_exports.String),
|
|
69
|
+
isDone: Schema_exports.Boolean
|
|
70
|
+
});
|
|
71
|
+
var OperationResult = Schema_exports.Union([
|
|
72
|
+
Row,
|
|
73
|
+
Schema_exports.Array(Row),
|
|
74
|
+
PaginationResult,
|
|
75
|
+
Schema_exports.Boolean,
|
|
76
|
+
Schema_exports.Finite,
|
|
77
|
+
Schema_exports.Null
|
|
78
|
+
]);
|
|
79
|
+
var AppDatabaseError = class extends Schema_exports.TaggedError()("AppDatabaseError", {
|
|
80
|
+
reason: Schema_exports.Literals([
|
|
81
|
+
"schema",
|
|
82
|
+
"schema_changed",
|
|
83
|
+
"table",
|
|
84
|
+
"index",
|
|
85
|
+
"range",
|
|
86
|
+
"value",
|
|
87
|
+
"readonly",
|
|
88
|
+
"cursor",
|
|
89
|
+
"limit",
|
|
90
|
+
"closed",
|
|
91
|
+
"storage",
|
|
92
|
+
"replay"
|
|
93
|
+
])
|
|
94
|
+
}) {
|
|
95
|
+
};
|
|
96
|
+
var DatabaseLimits = Schema_exports.Struct({
|
|
97
|
+
rowsRead: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
98
|
+
rowsReturned: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
99
|
+
bytesRead: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
100
|
+
writes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
101
|
+
scanCalls: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
102
|
+
directGets: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
103
|
+
valueBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
104
|
+
indexBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
105
|
+
});
|
|
106
|
+
var defaultDatabaseLimits = {
|
|
107
|
+
rowsRead: 5e3,
|
|
108
|
+
rowsReturned: 1e3,
|
|
109
|
+
bytesRead: 4 * 1024 * 1024,
|
|
110
|
+
writes: 1e3,
|
|
111
|
+
scanCalls: 100,
|
|
112
|
+
directGets: 1e3,
|
|
113
|
+
valueBytes: 64 * 1024,
|
|
114
|
+
indexBytes: 2048
|
|
115
|
+
};
|
|
116
|
+
var DatabaseRuntimeLimits = Schema_exports.Struct({
|
|
117
|
+
maxCursorChars: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
118
|
+
connectionCacheCapacity: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
119
|
+
connectionCacheTtlMs: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
120
|
+
});
|
|
121
|
+
var defaultDatabaseRuntimeLimits = DatabaseRuntimeLimits.make({
|
|
122
|
+
maxCursorChars: 8192,
|
|
123
|
+
connectionCacheCapacity: 64,
|
|
124
|
+
connectionCacheTtlMs: 5 * 60 * 1e3
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
export {
|
|
128
|
+
DatabaseSchema,
|
|
129
|
+
Row,
|
|
130
|
+
RowMetadata,
|
|
131
|
+
RangeClause,
|
|
132
|
+
DatabaseOperation,
|
|
133
|
+
PaginationResult,
|
|
134
|
+
AppDatabaseError,
|
|
135
|
+
DatabaseLimits,
|
|
136
|
+
defaultDatabaseLimits,
|
|
137
|
+
defaultDatabaseRuntimeLimits
|
|
138
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
HttpServerResponse_exports
|
|
3
|
+
} from "./chunk-W7Q5EOTS.js";
|
|
4
|
+
|
|
5
|
+
// src/implementation/ui-auth.ts
|
|
6
|
+
var appPrivateHeaders = {
|
|
7
|
+
"cache-control": "no-store",
|
|
8
|
+
"referrer-policy": "no-referrer",
|
|
9
|
+
"x-content-type-options": "nosniff",
|
|
10
|
+
"content-security-policy": "frame-ancestors 'none'"
|
|
11
|
+
};
|
|
12
|
+
var appSignInPage = () => HttpServerResponse_exports.text(
|
|
13
|
+
`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Opening app</title></head><body><p>Opening app\u2026</p><a href="/" hidden>Try again</a><script src="/_executor/auth/browser.js"></script></body></html>`,
|
|
14
|
+
{
|
|
15
|
+
contentType: "text/html",
|
|
16
|
+
headers: {
|
|
17
|
+
...appPrivateHeaders,
|
|
18
|
+
"content-security-policy": "default-src 'none'; script-src 'self'; connect-src 'self'; frame-ancestors 'none'; base-uri 'none'"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
var appSignInScript = () => HttpServerResponse_exports.text(
|
|
23
|
+
`
|
|
24
|
+
const callback = location.pathname === "/_executor/auth/callback";
|
|
25
|
+
const parameters = new URLSearchParams(location.hash.slice(1));
|
|
26
|
+
const body = callback
|
|
27
|
+
? {request: parameters.get("request"), code: parameters.get("code")}
|
|
28
|
+
: {returnTo: location.pathname + location.search + location.hash};
|
|
29
|
+
if (callback) history.replaceState(null, "", location.pathname);
|
|
30
|
+
fetch(callback ? "/_executor/auth/complete" : "/_executor/auth/start", {
|
|
31
|
+
method: "POST", headers: {"content-type":"application/json"}, body: JSON.stringify(body)
|
|
32
|
+
}).then(async response => {
|
|
33
|
+
if (!response.ok) throw new Error();
|
|
34
|
+
const result = await response.json();
|
|
35
|
+
location.replace(callback ? result.returnTo : result.url);
|
|
36
|
+
}).catch(() => {
|
|
37
|
+
document.querySelector("p").textContent = "Could not sign in to this app. Try opening it again.";
|
|
38
|
+
document.querySelector("a").hidden = false;
|
|
39
|
+
});`,
|
|
40
|
+
{ contentType: "text/javascript", headers: appPrivateHeaders }
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
appPrivateHeaders,
|
|
45
|
+
appSignInPage,
|
|
46
|
+
appSignInScript
|
|
47
|
+
};
|