@hitch42/applet 0.1.1-beta.21 → 0.1.1-beta.23

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 (54) hide show
  1. package/dist/_internal/server.d.ts +1 -1
  2. package/dist/applet.js +16 -16
  3. package/dist/{store-E5NhITHl.js → auth-OvyoB6M-.js} +203 -4
  4. package/dist/{batch-CiLZ177G.js → batch-DwyWmiaE.js} +1 -1
  5. package/dist/{build-FAQSHJgm.js → build-CrrTAX6T.js} +1 -1
  6. package/dist/build-YzjhhLw0.js +1 -0
  7. package/dist/{ci-oWlUJKm9.js → ci-B1XyXpHa.js} +2 -2
  8. package/dist/client/hitch/client.d.ts +1 -1
  9. package/dist/client/hitch/client.js +1 -1
  10. package/dist/client/hitch.d.ts +1 -1
  11. package/dist/client/hitch.js +1 -1
  12. package/dist/client/react/markdown-editor.d.ts +1 -1
  13. package/dist/client/react/markdown.d.ts +1 -1
  14. package/dist/client/react/markdown.js +1 -1
  15. package/dist/client/react.d.ts +2 -2
  16. package/dist/client/react.js +1 -1
  17. package/dist/{deploy-BM55ZoSp.js → deploy-WdARFHmA.js} +7 -7
  18. package/dist/{email-protocol-CEqzASSx.d.ts → email-protocol-BWja_v7c.d.ts} +16 -10
  19. package/dist/{generate-48pqFh5M.js → generate-Ct-Rbh0f.js} +11 -11
  20. package/dist/generate-_u-zFzrv.js +1 -0
  21. package/dist/{git-credential-CU7-Erzs.js → git-credential-DuLNowIb.js} +1 -1
  22. package/dist/{git-deploy-C12nMNB6.js → git-deploy-BjSAv5Qm.js} +1 -2
  23. package/dist/git-deploy-CByu_uli.js +1 -0
  24. package/dist/{git-migration-CIq-sN61.js → git-migration-6V31iafL.js} +3 -3
  25. package/dist/{hitch-client-Dph_kzDd.js → hitch-client-CNN-dU6d.js} +2 -2
  26. package/dist/{hitch-client-D33JOEOi.d.ts → hitch-client-k7_jIjPw.d.ts} +1 -1
  27. package/dist/index.d.ts +8 -5
  28. package/dist/index.js +12 -12
  29. package/dist/{init-Bb6WT8UB.js → init-C5HqIRt8.js} +5 -6
  30. package/dist/{load-config-Cffvj-aM.js → load-config-Df-zmfrd.js} +1 -0
  31. package/dist/{login-BWZKo7Ui.js → login-B41-WWtD.js} +1 -2
  32. package/dist/{logs-glCVHI-8.js → logs-DrL2ytmg.js} +2 -2
  33. package/dist/{markdown-BXt65dDo.d.ts → markdown-CnB35mjc.d.ts} +1 -1
  34. package/dist/{markdown-BA_XzFxq.js → markdown-DLdJOJ59.js} +2 -0
  35. package/dist/{markdown-editor-CB_nWLzj.d.ts → markdown-editor-xF3uATBp.d.ts} +1 -1
  36. package/dist/{project-DZGk765E.js → project-BbpU_VN2.js} +2 -2
  37. package/dist/{schedules-CSUb84e2.js → schedules-2Q_fkY_a.js} +1 -1
  38. package/dist/server.d.ts +1 -1
  39. package/dist/server.js +2 -2
  40. package/dist/{upload-DtMavo8Q.js → upload-D1mzpsSk.js} +2 -2
  41. package/dist/{upload-DXZyjZSS.d.ts → upload-wp-Ilsv6.d.ts} +3 -3
  42. package/dist/{variables-CgZstC7I.js → variables-CGwbmUom.js} +2 -2
  43. package/dist/vite.js +3 -3
  44. package/package.json +8 -7
  45. package/scaffold/.agents/skills/hitch-applets/references/email-tracking.md +4 -4
  46. package/scaffold/.agents/skills/hitch-applets/references/files.md +2 -2
  47. package/scaffold/.agents/skills/hitch-applets/references/performance.md +2 -2
  48. package/scaffold/.agents/skills/hitch-applets/references/records.md +7 -7
  49. package/scaffold/.agents/skills/hitch-cli/SKILL.md +21 -21
  50. package/dist/auth-DuMRqSGe.js +0 -49
  51. package/dist/build-C7hi2yg4.js +0 -1
  52. package/dist/device-CZWWckCq.js +0 -155
  53. package/dist/generate-BYK4aNud.js +0 -1
  54. package/dist/git-deploy-CNz6mxiF.js +0 -1
@@ -1,5 +1,5 @@
1
- import { n as withFilesUpload, r as getRegisteredHitchContract } from "./upload-DtMavo8Q.js";
2
- import { t as withBatchRecorder } from "./batch-CiLZ177G.js";
1
+ import { n as withFilesUpload, r as getRegisteredHitchContract } from "./upload-D1mzpsSk.js";
2
+ import { t as withBatchRecorder } from "./batch-DwyWmiaE.js";
3
3
  import { t as createLazyClientProxy } from "./lazy-client--QCL0wiu.js";
4
4
  import { createORPCClient } from "@orpc/client";
5
5
  import { OpenAPILink } from "@orpc/openapi-client/fetch";
@@ -1,7 +1,7 @@
1
1
  import { l as RegisteredContract, u as RegisteredManifest } from "./manifest-CpghlaJc.js";
2
2
  import { t as NarrowContract } from "./contract-CUc0B2rl.js";
3
3
  import { i as WithBatchRecorder, n as WithRecordCreates, r as WithSingleRecordCreates, t as WithRecordCreateCalls } from "./create-BJqLT8Uq.js";
4
- import { o as WithFilesUpload } from "./upload-DXZyjZSS.js";
4
+ import { o as WithFilesUpload } from "./upload-wp-Ilsv6.js";
5
5
  import { t as ExactRouterUtils } from "./query-utils-okxIoKM3.js";
6
6
  import { ContractRouterClient } from "@orpc/contract";
7
7
  type AuthorContract = NarrowContract<RegisteredContract, RegisteredManifest>;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as AppletSourceDefinition, c as RegisteredCatalog, d as RegisteredRouter, f as RegisteredVariableKeys, h as registerHitchContract, i as AppletPackages, l as RegisteredContract, m as RegisteredWorkflows, n as AppletManifest, o as RegisteredAppletSourceDefinition, p as RegisteredVariables, r as AppletManifestObject, s as HitchRegister, t as AppletDefinition, u as RegisteredManifest } from "./manifest-CpghlaJc.js";
2
2
  import { n as pruneContract, t as NarrowContract } from "./contract-CUc0B2rl.js";
3
- import { a as UploadedHitchFile, c as filesContract, i as UploadProgress, n as FilesUpload, r as UploadFileOptions, s as uploadFile, t as FilesClient } from "./upload-DXZyjZSS.js";
4
- import { a as EmailTracker, c as HitchEmailMessage, f as ListEmailTrackersOutput, g as emailContract, h as SendHitchEmailInput, i as EmailContract, l as HitchEmailThread, m as ListHitchEmailThreadsInput, n as TelephonyMessageReceivedEvent, o as HitchEmailAddress, p as ListHitchEmailMessagesInput, s as HitchEmailAttachment, t as EmailMessageReceivedEvent, u as HitchMailbox } from "./email-protocol-CEqzASSx.js";
3
+ import { a as UploadedHitchFile, c as filesContract, i as UploadProgress, n as FilesUpload, r as UploadFileOptions, s as uploadFile, t as FilesClient } from "./upload-wp-Ilsv6.js";
4
+ import { a as EmailTracker, c as HitchEmailMessage, f as ListEmailTrackersOutput, g as emailContract, h as SendHitchEmailInput, i as EmailContract, l as HitchEmailThread, m as ListHitchEmailThreadsInput, n as TelephonyMessageReceivedEvent, o as HitchEmailAddress, p as ListHitchEmailMessagesInput, s as HitchEmailAttachment, t as EmailMessageReceivedEvent, u as HitchMailbox } from "./email-protocol-BWja_v7c.js";
5
5
  import { ContractProcedure, Meta, Schema } from "@orpc/contract";
6
6
  interface HitchConfig {
7
7
  sdk: string;
@@ -109,7 +109,10 @@ type SendHitchMessageInput = {
109
109
  requestId?: string;
110
110
  };
111
111
  type MessageIdInput = {
112
- id: string;
112
+ messageId: string;
113
+ };
114
+ type CallIdInput = {
115
+ callId: string;
113
116
  };
114
117
  type NumbersOutput = {
115
118
  data: HitchPhoneNumber[];
@@ -124,7 +127,7 @@ type CallsOutput = {
124
127
  };
125
128
  type TelephonyContract = {
126
129
  calls: {
127
- get: ContractProcedure<Schema<MessageIdInput, MessageIdInput>, Schema<HitchCall, HitchCall>, Record<never, never>, Meta>;
130
+ get: ContractProcedure<Schema<CallIdInput, CallIdInput>, Schema<HitchCall, HitchCall>, Record<never, never>, Meta>;
128
131
  list: ContractProcedure<Schema<ListHitchCallsInput, ListHitchCallsInput>, Schema<CallsOutput, CallsOutput>, Record<never, never>, Meta>;
129
132
  };
130
133
  numbers: {
@@ -150,7 +153,7 @@ type HitchTeamMember = {
150
153
  };
151
154
  type TeamInput = {
152
155
  params: {
153
- team: string;
156
+ teamCode: string;
154
157
  };
155
158
  };
156
159
  type TeamsOutput = {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as registerHitchContract, t as uploadFile } from "./upload-DtMavo8Q.js";
1
+ import { i as registerHitchContract, t as uploadFile } from "./upload-D1mzpsSk.js";
2
2
  import { t as pruneContract } from "./contract-D9LCNGjD.js";
3
3
  import { oc, type } from "@orpc/contract";
4
4
  // src/hitch/email.ts
@@ -16,7 +16,7 @@ function emailContract(appletCode) {
16
16
  }).input(type()).output(type()),
17
17
  get: oc.route({
18
18
  method: "GET",
19
- path: "/resource/v1/email/threads/{id}"
19
+ path: "/resource/v1/email/threads/{threadId}"
20
20
  }).input(type()).output(type())
21
21
  },
22
22
  messages: {
@@ -26,7 +26,7 @@ function emailContract(appletCode) {
26
26
  }).input(type()).output(type()),
27
27
  get: oc.route({
28
28
  method: "GET",
29
- path: "/resource/v1/email/messages/{id}"
29
+ path: "/resource/v1/email/messages/{messageId}"
30
30
  }).input(type()).output(type()),
31
31
  send: oc.route({
32
32
  method: "POST",
@@ -35,12 +35,12 @@ function emailContract(appletCode) {
35
35
  }).input(type()).output(type()),
36
36
  raw: oc.route({
37
37
  method: "GET",
38
- path: "/resource/v1/email/messages/{id}/raw"
38
+ path: "/resource/v1/email/messages/{messageId}/raw"
39
39
  }).input(type()).output(type())
40
40
  },
41
41
  attachments: { get: oc.route({
42
42
  method: "GET",
43
- path: "/resource/v1/email/attachments/{id}"
43
+ path: "/resource/v1/email/attachments/{attachmentId}"
44
44
  }).input(type()).output(type()) },
45
45
  tracking: {
46
46
  createPixel: oc.route({
@@ -50,11 +50,11 @@ function emailContract(appletCode) {
50
50
  }).input(type()).output(type()),
51
51
  markSent: oc.route({
52
52
  method: "PATCH",
53
- path: `${path}/{id}`
53
+ path: `${path}/{trackerId}`
54
54
  }).input(type()).output(type()),
55
55
  get: oc.route({
56
56
  method: "GET",
57
- path: `${path}/{id}`
57
+ path: `${path}/{trackerId}`
58
58
  }).input(type()).output(type()),
59
59
  list: oc.route({
60
60
  method: "POST",
@@ -73,13 +73,13 @@ const filesContract = {
73
73
  }).input(type()).output(type()),
74
74
  confirm: oc.route({
75
75
  method: "POST",
76
- path: "/resource/v1/files/{file}/confirm",
76
+ path: "/resource/v1/files/{fileId}/confirm",
77
77
  successStatus: 200,
78
78
  inputStructure: "detailed"
79
79
  }).input(type()).output(type()),
80
80
  get: oc.route({
81
81
  method: "GET",
82
- path: "/resource/v1/files/{file}",
82
+ path: "/resource/v1/files/{fileId}",
83
83
  inputStructure: "detailed"
84
84
  }).input(type()).output(type())
85
85
  };
@@ -93,7 +93,7 @@ const telephonyContract = {
93
93
  calls: {
94
94
  get: oc.route({
95
95
  method: "GET",
96
- path: "/resource/v1/telephony/calls/{id}"
96
+ path: "/resource/v1/telephony/calls/{callId}"
97
97
  }).input(type()).output(type()),
98
98
  list: oc.route({
99
99
  method: "GET",
@@ -107,7 +107,7 @@ const telephonyContract = {
107
107
  messages: {
108
108
  get: oc.route({
109
109
  method: "GET",
110
- path: "/resource/v1/telephony/messages/{id}"
110
+ path: "/resource/v1/telephony/messages/{messageId}"
111
111
  }).input(type()).output(type()),
112
112
  list: oc.route({
113
113
  method: "GET",
@@ -128,7 +128,7 @@ const teamsContract = {
128
128
  }).input(type()).output(type()),
129
129
  members: { list: oc.route({
130
130
  method: "GET",
131
- path: "/resource/v1/teams/{team}/members",
131
+ path: "/resource/v1/teams/{teamCode}/members",
132
132
  inputStructure: "detailed"
133
133
  }).input(type()).output(type()) }
134
134
  };
@@ -1,13 +1,12 @@
1
1
  import { r as writeGeneratedAgents } from "./generated-agents-BUnJ0FQA.js";
2
- import { f as resolveAuth, m as resolveInstanceUrl, p as resolveAuthForOrg } from "./store-E5NhITHl.js";
2
+ import { _ as resolveInstanceUrl, g as resolveAuthForOrg, h as resolveAuth, r as orgUsesHitchGit, t as canCheckHitchGit } from "./auth-OvyoB6M-.js";
3
3
  import { a as findWorkspaceRoot, i as findWorkspaceConfig, o as isRootLayout, r as findParentRoot, s as readWorkspaceConfig } from "./workspace-CtIKSgMD.js";
4
- import { r as orgUsesHitchGit, t as canCheckHitchGit } from "./auth-DuMRqSGe.js";
5
- import { n as loadAppletSourceDefinition } from "./load-config-Cffvj-aM.js";
6
- import { r as runGenerate } from "./generate-48pqFh5M.js";
4
+ import { n as loadAppletSourceDefinition } from "./load-config-Df-zmfrd.js";
5
+ import { r as runGenerate } from "./generate-Ct-Rbh0f.js";
7
6
  import { n as ORG_CODE_PATTERN, t as APPLET_CODE_PATTERN } from "./manifest-patterns-BfxqImlp.js";
8
- import { l as writeRootSupport, n as loadCliManifest, r as loadPackageManifest, s as writeAppletSupport, t as assertWorkspaceCli, u as writeWorkspaceSupport } from "./project-DZGk765E.js";
7
+ import { l as writeRootSupport, n as loadCliManifest, r as loadPackageManifest, s as writeAppletSupport, t as assertWorkspaceCli, u as writeWorkspaceSupport } from "./project-BbpU_VN2.js";
9
8
  import { n as childApplets } from "./parent-Zx8Eg1Ki.js";
10
- import { t as migrateIfEnabled } from "./git-migration-CIq-sN61.js";
9
+ import { t as migrateIfEnabled } from "./git-migration-6V31iafL.js";
11
10
  import { access, cp, mkdir, readdir, writeFile } from "node:fs/promises";
12
11
  import { relative, resolve } from "node:path";
13
12
  import { spawn } from "node:child_process";
@@ -1,3 +1,4 @@
1
+ import "./auth-OvyoB6M-.js";
1
2
  import { c as validateRootManifest, i as findWorkspaceConfig, n as findAppletRoot, o as isRootLayout } from "./workspace-CtIKSgMD.js";
2
3
  import { n as ORG_CODE_PATTERN, t as APPLET_CODE_PATTERN } from "./manifest-patterns-BfxqImlp.js";
3
4
  import { z } from "zod";
@@ -1,5 +1,4 @@
1
- import { c as normalizeInstanceUrl, h as revokeOAuthCredentials, m as resolveInstanceUrl, s as deleteCredentials, t as AuthenticationError, u as readCredentialStore } from "./store-E5NhITHl.js";
2
- import { t as loginWithDevice } from "./device-CZWWckCq.js";
1
+ import { _ as resolveInstanceUrl, a as loginWithDevice, d as normalizeInstanceUrl, o as AuthenticationError, p as readCredentialStore, u as deleteCredentials, v as revokeOAuthCredentials } from "./auth-OvyoB6M-.js";
3
2
  import { i as findWorkspaceConfig } from "./workspace-CtIKSgMD.js";
4
3
  // src/login.ts
5
4
  async function runLogin(options) {
@@ -1,6 +1,6 @@
1
+ import { n as fetchWithOrgAuth } from "./auth-OvyoB6M-.js";
1
2
  import { s as readWorkspaceConfig } from "./workspace-CtIKSgMD.js";
2
- import { n as fetchWithOrgAuth } from "./auth-DuMRqSGe.js";
3
- import { o as resolveWorkspaceOrg, t as loadAppletConfig } from "./load-config-Cffvj-aM.js";
3
+ import { o as resolveWorkspaceOrg, t as loadAppletConfig } from "./load-config-Df-zmfrd.js";
4
4
  import { t as APPLET_CODE_PATTERN } from "./manifest-patterns-BfxqImlp.js";
5
5
  import { z } from "zod";
6
6
  // src/logs.ts
@@ -1,4 +1,4 @@
1
- import { a as UploadedHitchFile } from "./upload-DXZyjZSS.js";
1
+ import { a as UploadedHitchFile } from "./upload-wp-Ilsv6.js";
2
2
  import { ReactElement } from "react";
3
3
  type MarkdownFiles = {
4
4
  download: (id: string) => Promise<Pick<UploadedHitchFile, "downloadUrl">>;
@@ -70,6 +70,7 @@ function HitchImage({ src, alt, files, node: _node, ...props }) {
70
70
  }
71
71
  });
72
72
  }
73
+ const LINK_SAFETY = { enabled: false };
73
74
  function Markdown({ children, files, className }) {
74
75
  const rehypePlugins = useMemo(withHitchFileProtocol, []);
75
76
  const components = useMemo(() => ({ img: (props) => /* @__PURE__ */ jsx(HitchImage, {
@@ -79,6 +80,7 @@ function Markdown({ children, files, className }) {
79
80
  return /* @__PURE__ */ jsx(Streamdown, {
80
81
  className,
81
82
  components,
83
+ linkSafety: LINK_SAFETY,
82
84
  rehypePlugins,
83
85
  urlTransform: (url, key, node) => url.startsWith("hitch-file://") ? url : defaultUrlTransform(url, key, node),
84
86
  children
@@ -1,4 +1,4 @@
1
- import { a as UploadedHitchFile } from "./upload-DXZyjZSS.js";
1
+ import { a as UploadedHitchFile } from "./upload-wp-Ilsv6.js";
2
2
  import { ReactElement } from "react";
3
3
  import "@tiptap/core";
4
4
  type MarkdownEditorFiles = {
@@ -1,7 +1,7 @@
1
1
  import { r as writeGeneratedAgents, t as GENERATED_SKILLS } from "./generated-agents-BUnJ0FQA.js";
2
- import { l as organizationInstanceUrl, n as DEFAULT_INSTANCE_URL } from "./store-E5NhITHl.js";
2
+ import { f as organizationInstanceUrl, s as DEFAULT_INSTANCE_URL } from "./auth-OvyoB6M-.js";
3
3
  import { a as findWorkspaceRoot, n as findAppletRoot, o as isRootLayout, s as readWorkspaceConfig } from "./workspace-CtIKSgMD.js";
4
- import { n as loadAppletSourceDefinition, r as appletMountPath } from "./load-config-Cffvj-aM.js";
4
+ import { n as loadAppletSourceDefinition, r as appletMountPath } from "./load-config-Df-zmfrd.js";
5
5
  import { z } from "zod";
6
6
  import { existsSync } from "node:fs";
7
7
  import { cp, mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
@@ -1,5 +1,5 @@
1
1
  import { n as findAppletRoot } from "./workspace-CtIKSgMD.js";
2
- import { t as loadAppletConfig } from "./load-config-Cffvj-aM.js";
2
+ import { t as loadAppletConfig } from "./load-config-Df-zmfrd.js";
3
3
  import { t as question } from "./prompt-CW98R-Un.js";
4
4
  import { RPCLink } from "@orpc/client/fetch";
5
5
  import { readFile } from "node:fs/promises";
package/dist/server.d.ts CHANGED
@@ -2,7 +2,7 @@ import { a as createWorkflow, i as WorkflowStep, n as WorkflowDefinition, r as W
2
2
  import { l as RegisteredContract, m as RegisteredWorkflows, p as RegisteredVariables, u as RegisteredManifest } from "./manifest-CpghlaJc.js";
3
3
  import { t as NarrowContract } from "./contract-CUc0B2rl.js";
4
4
  import { i as WithBatchRecorder, n as WithRecordCreates } from "./create-BJqLT8Uq.js";
5
- import { o as WithFilesUpload } from "./upload-DXZyjZSS.js";
5
+ import { o as WithFilesUpload } from "./upload-wp-Ilsv6.js";
6
6
  import { ContractRouterClient } from "@orpc/contract";
7
7
  type WorkflowRunStatus<Result> = {
8
8
  id: string;
package/dist/server.js CHANGED
@@ -1,8 +1,8 @@
1
- import { n as withFilesUpload, r as getRegisteredHitchContract } from "./upload-DtMavo8Q.js";
1
+ import { n as withFilesUpload, r as getRegisteredHitchContract } from "./upload-D1mzpsSk.js";
2
2
  import { t as HITCH_APPLET_CODE_HEADER } from "./headers-BcEMIVCo.js";
3
3
  import { a as getRequestContext, i as getIdentityBearer, n as createWorkflow, s as tryGetRequestContext } from "./workflow-l2SlVePB.js";
4
4
  import { s as publishNote, t as APP_CONTEXT_CHANNEL } from "./log-context-BepwdjrR.js";
5
- import { t as withBatchRecorder } from "./batch-CiLZ177G.js";
5
+ import { t as withBatchRecorder } from "./batch-DwyWmiaE.js";
6
6
  import { t as createLazyClientProxy } from "./lazy-client--QCL0wiu.js";
7
7
  import { createORPCClient } from "@orpc/client";
8
8
  import { OpenAPILink } from "@orpc/openapi-client/fetch";
@@ -79,7 +79,7 @@ async function uploadFile(files, file, options = {}) {
79
79
  } }, { signal: options.signal });
80
80
  const status = await putFile(file, created.uploadUrl, created.data.contentType, options);
81
81
  if (status < 200 || status >= 300) throw new Error(`Upload of "${file.name}" failed with status ${status}.`);
82
- const confirmed = await files.confirm({ params: { file: created.data.id } }, { signal: options.signal });
82
+ const confirmed = await files.confirm({ params: { fileId: created.data.id } }, { signal: options.signal });
83
83
  return {
84
84
  ...confirmed.data,
85
85
  downloadUrl: confirmed.downloadUrl
@@ -94,7 +94,7 @@ function withFilesUpload(target, files) {
94
94
  const proxy = new Proxy(value, { get: (filesInner, filesProperty, filesReceiver) => {
95
95
  if (filesProperty === "upload") return (file, options) => uploadFile(files(), file, options);
96
96
  if (filesProperty === "download") return async (id, options) => {
97
- const result = await files().get({ params: { file: id } }, options);
97
+ const result = await files().get({ params: { fileId: id } }, options);
98
98
  return {
99
99
  ...result.data,
100
100
  downloadUrl: result.downloadUrl
@@ -27,7 +27,7 @@ type CreateFileOutput = {
27
27
  };
28
28
  type FileInput = {
29
29
  params: {
30
- file: string;
30
+ fileId: string;
31
31
  };
32
32
  };
33
33
  type FileOutput = {
@@ -57,7 +57,7 @@ type FilesClient = {
57
57
  }>;
58
58
  confirm(input: {
59
59
  params: {
60
- file: string;
60
+ fileId: string;
61
61
  };
62
62
  }, options?: {
63
63
  signal?: AbortSignal;
@@ -67,7 +67,7 @@ type FilesClient = {
67
67
  }>;
68
68
  get(input: {
69
69
  params: {
70
- file: string;
70
+ fileId: string;
71
71
  };
72
72
  }, options?: {
73
73
  signal?: AbortSignal;
@@ -1,5 +1,5 @@
1
- import { n as fetchWithOrgAuth } from "./auth-DuMRqSGe.js";
2
- import { t as loadAppletConfig } from "./load-config-Cffvj-aM.js";
1
+ import { n as fetchWithOrgAuth } from "./auth-OvyoB6M-.js";
2
+ import { t as loadAppletConfig } from "./load-config-Df-zmfrd.js";
3
3
  import { t as question } from "./prompt-CW98R-Un.js";
4
4
  import { z } from "zod";
5
5
  // src/variables.ts
package/dist/vite.js CHANGED
@@ -3,10 +3,10 @@ import { a as openQueryCacheDatabase } from "./query-cache-DQJy45RT.js";
3
3
  import { d as HITCH_SESSION_HEADER, f as HITCH_USER_HEADER } from "./headers-BcEMIVCo.js";
4
4
  import { a as workflowOutcomeSchema, n as runWorkflowJournal } from "./workflow-engine-CyyaVENo.js";
5
5
  import { r as writeGeneratedAgents } from "./generated-agents-BUnJ0FQA.js";
6
- import { d as rejectEnvironmentKey, i as bearerToken, l as organizationInstanceUrl, m as resolveInstanceUrl, p as resolveAuthForOrg } from "./store-E5NhITHl.js";
6
+ import { _ as resolveInstanceUrl, f as organizationInstanceUrl, g as resolveAuthForOrg, l as bearerToken, m as rejectEnvironmentKey } from "./auth-OvyoB6M-.js";
7
7
  import { c as validateRootManifest, o as isRootLayout } from "./workspace-CtIKSgMD.js";
8
- import { a as appletSourceDefinitionSchema, i as appletReleaseManifest, o as resolveWorkspaceOrg, r as appletMountPath } from "./load-config-Cffvj-aM.js";
9
- import { a as writeRegisterDeclaration, c as writeAppletRoot, d as writeServerEntry, i as syncContract, l as writeClientEntry, n as routesModuleSource, u as writeManifestGen } from "./generate-48pqFh5M.js";
8
+ import { a as appletSourceDefinitionSchema, i as appletReleaseManifest, o as resolveWorkspaceOrg, r as appletMountPath } from "./load-config-Df-zmfrd.js";
9
+ import { a as writeRegisterDeclaration, c as writeAppletRoot, d as writeServerEntry, i as syncContract, l as writeClientEntry, n as routesModuleSource, u as writeManifestGen } from "./generate-Ct-Rbh0f.js";
10
10
  import { t as APPLET_CODE_PATTERN } from "./manifest-patterns-BfxqImlp.js";
11
11
  import { z } from "zod";
12
12
  import { randomUUID } from "node:crypto";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitch42/applet",
3
- "version": "0.1.1-beta.21",
3
+ "version": "0.1.1-beta.23",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "applet": "./dist/applet.js"
@@ -13,7 +13,8 @@
13
13
  ],
14
14
  "type": "module",
15
15
  "sideEffects": [
16
- "*.css"
16
+ "*.css",
17
+ "./src/auth.ts"
17
18
  ],
18
19
  "exports": {
19
20
  ".": {
@@ -55,10 +56,10 @@
55
56
  }
56
57
  },
57
58
  "dependencies": {
58
- "@cloudflare/vite-plugin": "^1.51.1",
59
+ "@cloudflare/vite-plugin": "^1.66.0",
59
60
  "@fontsource-variable/geist-mono": "^5.3.0",
60
61
  "@fontsource-variable/inter": "^5.3.0",
61
- "@hey-api/openapi-ts": "0.0.0-next-20260824173136",
62
+ "@hey-api/openapi-ts": "0.0.0-next-20260930190945",
62
63
  "@napi-rs/keyring": "2.1.2",
63
64
  "@orpc/client": "^1.15.0",
64
65
  "@orpc/contract": "^1.15.0",
@@ -67,8 +68,8 @@
67
68
  "@react-aria/optimize-locales-plugin": "^2.1.0",
68
69
  "@tailwindcss/vite": "^4.3.0",
69
70
  "@tanstack/react-query-persist-client": "5.101.4",
70
- "@tanstack/router-cli": "^1.167.24",
71
- "@tanstack/router-plugin": "^1.168.23",
71
+ "@tanstack/router-cli": "^1.167.46",
72
+ "@tanstack/router-plugin": "^1.168.48",
72
73
  "@telnyx/webrtc": "^2.27.10",
73
74
  "@tiptap/core": "^3.30.3",
74
75
  "@tiptap/extension-image": "^3.30.3",
@@ -101,7 +102,7 @@
101
102
  "peerDependencies": {
102
103
  "@orpc/server": "^1.15.0",
103
104
  "@tanstack/react-query": "5.101.4",
104
- "@tanstack/react-router": "^1.170.18",
105
+ "@tanstack/react-router": "^1.170.46",
105
106
  "@types/node": "^24",
106
107
  "@types/react": "^19.2.0",
107
108
  "@types/react-dom": "^19.2.0",
@@ -9,15 +9,15 @@ const { id, url } = await hitch.email.tracking.createPixel({
9
9
  });
10
10
  const html = `<p>Hello</p><img src="${url}" width="1" height="1" alt="">`;
11
11
  // Send the email with the applet's email provider.
12
- await hitch.email.tracking.markSent({ id });
12
+ await hitch.email.tracking.markSent({ trackerId: id });
13
13
  ```
14
14
 
15
- `markSent({ id, sentAt })` accepts an ISO time. A later call replaces the sent time.
16
- `get({ id })` returns one tracker. `list()` returns up to 100 trackers by default.
15
+ `markSent({ trackerId, sentAt })` accepts an ISO time. A later call replaces the sent time.
16
+ `get({ trackerId })` returns one tracker. `list()` returns up to 100 trackers by default.
17
17
  Use `filter`, `sentAt`, `cursor`, and `limit` to select a page.
18
18
 
19
19
  ```ts
20
- const tracker = await hitch.email.tracking.get({ id });
20
+ const tracker = await hitch.email.tracking.get({ trackerId: id });
21
21
  const query = {
22
22
  filter: { buyerId: "acme" },
23
23
  sentAt: { $gte: "2026-10-01T00:00:00Z" },
@@ -77,7 +77,7 @@ Use the `get` query utilities when React needs file metadata as query state.
77
77
  ```ts
78
78
  const fileQuery = useQuery(
79
79
  hitch.files.get.queryOptions({
80
- input: { params: { file: id } },
80
+ input: { params: { fileId: id } },
81
81
  }),
82
82
  );
83
83
 
@@ -100,7 +100,7 @@ Store `uploaded.id` as the value of an attachment attribute. A multi-value attac
100
100
  const uploaded = await hitch.files.upload(file);
101
101
 
102
102
  await hitch.records.claims.update.call({
103
- params: { record: claimId },
103
+ params: { recordId: claimId },
104
104
  body: { receipt_id: uploaded.id }, // multi-value: [uploaded.id]
105
105
  });
106
106
  ```
@@ -50,8 +50,8 @@ await hitch.batch(
50
50
  (tx) => {
51
51
  tx.companies.create({ body: { id: companyId, name: "Acme" } });
52
52
  tx.deals.create({ body: { name: "Acme renewal", company_id: companyId } });
53
- tx.deals.update({ params: { record: dealId }, body: { stage: "won" } });
54
- tx.deals.delete({ params: { record: staleDealId } });
53
+ tx.deals.update({ params: { recordId: dealId }, body: { stage: "won" } });
54
+ tx.deals.delete({ params: { recordId: staleDealId } });
55
55
  tx.deals.updateWhere({ body: { filter: { stage: "open" }, set: { stage: "lost" } } });
56
56
  },
57
57
  { idempotencyKey: `import-${runId}-${chunkIndex}` },
@@ -15,15 +15,15 @@ Use the generated Hitch contract as the typed data plane.
15
15
 
16
16
  - `list` sends `GET /v1/<objectCode>` and lists records with query parameters.
17
17
  - `create` sends `POST /v1/<objectCode>` and creates one record or an array of records.
18
- - `get` sends `GET /v1/<objectCode>/{record}` and gets one record.
19
- - `history` sends `GET /v1/<objectCode>/{record}/history` and gets record changes.
20
- - `update` sends `PATCH /v1/<objectCode>/{record}` and updates one record.
21
- - `delete` sends `DELETE /v1/<objectCode>/{record}` and deletes one record.
18
+ - `get` sends `GET /v1/<objectCode>/{recordId}` and gets one record.
19
+ - `history` sends `GET /v1/<objectCode>/{recordId}/history` and gets record changes.
20
+ - `update` sends `PATCH /v1/<objectCode>/{recordId}` and updates one record.
21
+ - `delete` sends `DELETE /v1/<objectCode>/{recordId}` and deletes one record.
22
22
  - `query` sends `POST /v1/<objectCode>/query` and lists records with a structured body.
23
23
  - `updateWhere` sends `POST /v1/<objectCode>/bulk-update` and updates matching records.
24
24
  - `aggregate` sends `POST /v1/<objectCode>/aggregate` and calculates aggregate values.
25
25
 
26
- - Pass a record ID in `params.record` for `get`, `history`, `update`, and `delete`.
26
+ - Pass a record ID in `params.recordId` for `get`, `history`, `update`, and `delete`.
27
27
  - Pass record fields in `body` for `create` and `update`.
28
28
  - Pass structured query data in `body` for `query`.
29
29
 
@@ -67,7 +67,7 @@ const deals = await hitch.records.deals.query({
67
67
  });
68
68
 
69
69
  const deal = await hitch.records.deals.get({
70
- params: { record: dealId },
70
+ params: { recordId: dealId },
71
71
  });
72
72
  ```
73
73
 
@@ -93,7 +93,7 @@ The first record has index 0. An empty array returns an empty array and requires
93
93
 
94
94
  ```ts
95
95
  const page = await hitch.records.deals.history({
96
- params: { record: id },
96
+ params: { recordId: id },
97
97
  query: { limit: 25, cursor },
98
98
  });
99
99
 
@@ -44,7 +44,7 @@ Every generated command comes from an API route. The words of the command are th
44
44
  - `hitch manage ...` changes the organization: objects and attributes, changesets, grants, teams, members, invitations, capabilities, API keys, applets, and the theme. Each command needs a capability.
45
45
  - `hitch me get` shows who you are. `hitch me teams list` and `hitch me applets list` show your teams and the applets that you can open.
46
46
  - The verb comes from the HTTP method: `list` or `get` for GET, `create` for POST, `update` for PATCH, `set` for PUT, `delete` for DELETE. A POST to an action uses the action as the verb: `hitch manage changesets apply`.
47
- - Every path, query, and body field becomes a flag in kebab case. A path field names its thing: `--object`, `--record`, `--team`, `--grant`, `--changeset`. An object field takes JSON: `--filter '{"stage":"won"}'`. An array field takes one JSON value per item: `--aggregates '{"op":"sum","attribute":"amount","as":"total"}' '{"op":"count","as":"n"}'`.
47
+ - Every path, query, and body field becomes a flag in kebab case. A path field names its thing: `--object-code`, `--record-id`, `--team-code`, `--changeset-id`. An object field takes JSON: `--filter '{"stage":"won"}'`. An array field takes one JSON value per item: `--aggregates '{"op":"sum","attribute":"amount","as":"total"}' '{"op":"count","as":"n"}'`.
48
48
  - A required field is a required flag. The CLI does not prompt for a missing value. It prints the usage error.
49
49
  - Run `hitch <command> --help` to see its flags. The flags of a data command follow that organization's schema.
50
50
  - Every `delete` command asks for confirmation. Pass `--yes` to skip it. A script without a terminal must pass `--yes`.
@@ -57,16 +57,16 @@ Examples use an object called `deals` with attributes `amount`, `stage`, and `ow
57
57
 
58
58
  ```sh
59
59
  hitch deals list --limit 20 --include owner
60
- hitch deals get --record 0192f1a2-3b4c-7d5e-8f60-123456789abc --include owner
60
+ hitch deals get --record-id 0192f1a2-3b4c-7d5e-8f60-123456789abc --include owner
61
61
  hitch deals create --name "Acme renewal" --amount 5000 --stage open
62
- hitch deals update --record 0192f1a2-3b4c-7d5e-8f60-123456789abc --stage won
63
- hitch deals delete --record 0192f1a2-3b4c-7d5e-8f60-123456789abc --yes
64
- hitch deals history get --record 0192f1a2-3b4c-7d5e-8f60-123456789abc
62
+ hitch deals update --record-id 0192f1a2-3b4c-7d5e-8f60-123456789abc --stage won
63
+ hitch deals delete --record-id 0192f1a2-3b4c-7d5e-8f60-123456789abc --yes
64
+ hitch deals history get --record-id 0192f1a2-3b4c-7d5e-8f60-123456789abc
65
65
  hitch deals query --filter '{"stage":{"$in":["open","won"]}}' --sort '{"attribute":"createdAt","direction":"desc"}' --limit 50
66
66
  hitch deals bulk-update --filter '{"stage":"open"}' --set '{"stage":"lost"}' --expect 3
67
67
  hitch deals aggregate --aggregates '{"op":"sum","attribute":"amount","as":"total"}' --group-by '[{"attribute":"stage"}]'
68
68
  hitch batch run --requests '{"method":"POST","path":"/v1/deals","body":{"name":"A","stage":"open"}}'
69
- hitch objects schema get --object deals
69
+ hitch objects schema get --object-code deals
70
70
  ```
71
71
 
72
72
  - The filter, sort, include, aggregate, and batch bodies use the same shapes as the SDK. Read the `hitch-data` skill for the rules and limits.
@@ -80,21 +80,21 @@ hitch objects schema get --object deals
80
80
  ```sh
81
81
  hitch resource teams list
82
82
  hitch manage teams create --name Sales
83
- hitch manage teams members set --team sales --member james@acme.com
83
+ hitch manage teams members set --team-code sales --member-email james@acme.com
84
84
  hitch manage invitations create --email bob@acme.com
85
85
  hitch manage capabilities list
86
- hitch manage capabilities grants set --capability objects:manage --grant sales
87
- hitch manage objects access get --object deals
88
- hitch manage objects grants set --object deals --grant sales --can-create --can-read --can-update --conditions '{"path":["owner"],"operator":"equals","operand":"current_user"}'
89
- hitch manage objects grants set --object deals --grant default --can-read
90
- hitch manage objects grants delete --object deals --grant sales --yes
91
- hitch manage applets access get --applet sales_portal
92
- hitch manage applets grants set --applet sales_portal --grant sales
86
+ hitch manage capabilities grants set --capability-name objects:manage --team-code sales
87
+ hitch manage objects access get --object-code deals
88
+ hitch manage objects grants set --object-code deals --team-code sales --can-create --can-read --can-update --conditions '{"path":["owner"],"operator":"equals","operand":"current_user"}'
89
+ hitch manage objects grants set --object-code deals --team-code default --can-read
90
+ hitch manage objects grants delete --object-code deals --team-code sales --yes
91
+ hitch manage applets access get --applet-code sales_portal
92
+ hitch manage applets grants set --applet-code sales_portal --team-code sales
93
93
  ```
94
94
 
95
- - Paths name things by key, not by id. `--team` and `--grant` take a team code. `--member` and `--invitation` take an email. `--api-key` takes the key name, for example `CI_DEPLOY`. `--object` and `--attribute` take a code. `--mailbox` takes the mailbox address.
95
+ - Paths name things by key, not by id. `--team-code` takes a team code. `--member-email` and `--invitation-email` take an email. `--api-key-name` takes the key name, for example `CI_DEPLOY`. `--object-code` and `--attribute-code` take a code. `--mailbox-email` takes the mailbox address.
96
96
  - A team code is the team name folded to ASCII and lower case, with each run of other characters as one `_`. `Sales Team` has the code `sales_team`. A rename changes the code.
97
- - `manage objects grants set` sets the whole object grant of one grantee: a verb that you leave out is off, and the conditions and attribute rules that you pass replace the saved ones. `--grant` is a team code, or `default` for the grant that every member holds.
97
+ - `manage objects grants set` sets the whole object grant of one grantee: a verb that you leave out is off, and the conditions and attribute rules that you pass replace the saved ones. `--team-code` is a team code, or `default` for the grant that every member holds.
98
98
  - Pass each condition and each attribute rule as one JSON value, for example `--attributes '{"attribute":"owner","canUpdate":true}'`. Name attributes by code.
99
99
  - Add `--delegate '"company"'` to delegate through a reference attribute. The value is the attribute code as a JSON string.
100
100
  - `manage objects access get` shows each object grant in the shape that `manage objects grants set` takes. `manage applets access get` shows which grantees cannot use what an applet reads.
@@ -106,11 +106,11 @@ Schema changes go through a changeset.
106
106
  ```sh
107
107
  hitch manage changesets create
108
108
  hitch manage objects create --name Deals --changeset-id <changesetId>
109
- hitch manage objects attributes create --object deals --name Amount --type currency --changeset-id <changesetId>
110
- hitch manage changesets check --changeset <changesetId>
111
- hitch manage changesets apply --changeset <changesetId>
112
- hitch manage changesets merge --changeset <changesetId> --from <otherChangesetId>
113
- hitch manage changesets abandon --changeset <changesetId>
109
+ hitch manage objects attributes create --object-code deals --name Amount --type currency --changeset-id <changesetId>
110
+ hitch manage changesets check --changeset-id <changesetId>
111
+ hitch manage changesets apply --changeset-id <changesetId>
112
+ hitch manage changesets merge --changeset-id <changesetId> --from <otherChangesetId>
113
+ hitch manage changesets abandon --changeset-id <changesetId>
114
114
  ```
115
115
 
116
116
  - A schema command without `--changeset-id` applies at once when it has no blockers. With a blocker, Hitch stages it in a new pending changeset and names it in the error.
@@ -1,49 +0,0 @@
1
- import { a as configureKeyring, d as rejectEnvironmentKey, i as bearerToken, l as organizationInstanceUrl, m as resolveInstanceUrl, p as resolveAuthForOrg, r as LoginRequiredError, t as AuthenticationError, u as readCredentialStore } from "./store-E5NhITHl.js";
2
- import { n as parseMe, t as loginWithDevice } from "./device-CZWWckCq.js";
3
- import "./workspace-CtIKSgMD.js";
4
- import { Entry, findCredentials } from "@napi-rs/keyring";
5
- // src/auth.ts
6
- configureKeyring(Entry, findCredentials);
7
- async function fetchWithOrgAuth(orgCode, request) {
8
- return withOrgAuth(orgCode, async (organizationUrl, accessToken) => {
9
- const response = await request(organizationUrl, accessToken);
10
- return {
11
- response,
12
- unauthorized: response.status === 401
13
- };
14
- }).then(({ response }) => response);
15
- }
16
- async function withOrgAuth(orgCode, request) {
17
- const instanceUrl = await resolveInstanceUrl();
18
- const organizationUrl = organizationInstanceUrl(instanceUrl, orgCode);
19
- const auth = await resolveAuthForOrg(instanceUrl, orgCode).catch((error) => {
20
- if (error instanceof LoginRequiredError && process.stdin.isTTY === true) return void 0;
21
- throw error;
22
- });
23
- if (auth !== void 0) {
24
- const result = await request(organizationUrl, bearerToken(auth));
25
- if ("response" in result && result.response instanceof Response) rejectEnvironmentKey(result.response, auth);
26
- if (!result.unauthorized) return result;
27
- if (auth.source === "environment") throw new AuthenticationError("HITCH_API_KEY was rejected.");
28
- }
29
- if (process.stdin.isTTY !== true) throw new LoginRequiredError();
30
- await loginWithDevice(instanceUrl, { expectedOrg: orgCode });
31
- const credentials = await resolveAuthForOrg(instanceUrl, orgCode);
32
- if (credentials === void 0) throw new Error(`login did not provide credentials for organization "${orgCode}"`);
33
- return request(organizationUrl, bearerToken(credentials));
34
- }
35
- async function orgUsesHitchGit(org) {
36
- const response = await fetchWithOrgAuth(org, (organizationUrl, token) => fetch(`${organizationUrl}/api/me/v1`, { headers: { Authorization: `Bearer ${token}` } }));
37
- if (!response.ok) throw new AuthenticationError(`Could not read organization membership (${response.status}).`);
38
- const membership = parseMe(await response.json()).memberships.find((item) => item.code === org);
39
- if (membership === void 0) throw new AuthenticationError(`You are not a member of ${org}.`);
40
- if (typeof membership.gitEnabled !== "boolean") throw new Error("The membership response has no \"gitEnabled\" flag. Update the Hitch server.");
41
- return membership.gitEnabled;
42
- }
43
- async function canCheckHitchGit() {
44
- if (process.env.GITHUB_ACTIONS === "true") return false;
45
- if (process.env.HITCH_API_KEY) return true;
46
- const instance = await resolveInstanceUrl();
47
- return Object.entries((await readCredentialStore()).instances).some(([url, credentials]) => url === instance && Object.keys(credentials).length > 0);
48
- }
49
- export { withOrgAuth as i, fetchWithOrgAuth as n, orgUsesHitchGit as r, canCheckHitchGit as t };
@@ -1 +0,0 @@
1
- export { i as runBuild } from "./build-FAQSHJgm.js";