@omg-dev/protocol 0.6.235 → 0.6.236

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.
@@ -0,0 +1,25 @@
1
+ /**
2
+ * A project folder links to one hosted app through `.omg/project.json`. The
3
+ * runtime puts that link on each repo row as `deploy`. Web and iOS both show it
4
+ * for the session's project, so the matching rule lives here once.
5
+ */
6
+ export type AppLink = {
7
+ slug: string;
8
+ url: string;
9
+ name?: string;
10
+ projectId?: string;
11
+ };
12
+ type RepoWithLink = {
13
+ cwd: string;
14
+ project?: string;
15
+ deploy?: AppLink;
16
+ };
17
+ /** The repo a session runs in: its folder, or the repo that holds its worktree. */
18
+ export declare function sessionAppRepo<R extends RepoWithLink>(session: {
19
+ cwd?: string | null;
20
+ project?: string | null;
21
+ }, repos: readonly R[]): R | undefined;
22
+ /** The app's page in the developer console. */
23
+ export declare function consoleAppUrl(slug: string): string;
24
+ export {};
25
+ //# sourceMappingURL=app-link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-link.d.ts","sourceRoot":"","sources":["../src/app-link.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvF,KAAK,YAAY,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAExE,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,CAAC,SAAS,YAAY,EACnD,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACzD,KAAK,EAAE,SAAS,CAAC,EAAE,GAClB,CAAC,GAAG,SAAS,CASf;AAED,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
@@ -0,0 +1,18 @@
1
+ /** The repo a session runs in: its folder, or the repo that holds its worktree. */
2
+ export function sessionAppRepo(session, repos) {
3
+ const cwd = session.cwd?.trim();
4
+ if (!cwd)
5
+ return undefined;
6
+ const byFolder = repos
7
+ .filter((repo) => cwd === repo.cwd || cwd.startsWith(`${repo.cwd}/`))
8
+ .sort((a, b) => b.cwd.length - a.cwd.length)[0];
9
+ if (byFolder)
10
+ return byFolder;
11
+ // A worktree lives outside its repo folder. The project label still names it.
12
+ return session.project ? repos.find((repo) => repo.project === session.project) : undefined;
13
+ }
14
+ /** The app's page in the developer console. */
15
+ export function consoleAppUrl(slug) {
16
+ return `https://console.omg.dev/apps/${encodeURIComponent(slug)}`;
17
+ }
18
+ //# sourceMappingURL=app-link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-link.js","sourceRoot":"","sources":["../src/app-link.ts"],"names":[],"mappings":"AASA,mFAAmF;AACnF,MAAM,UAAU,cAAc,CAC5B,OAAyD,EACzD,KAAmB;IAEnB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;IAChC,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAC3B,MAAM,QAAQ,GAAG,KAAK;SACnB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;SACpE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,8EAA8E;IAC9E,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9F,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,gCAAgC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;AACpE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omg-dev/protocol",
3
- "version": "0.6.235",
3
+ "version": "0.6.236",
4
4
  "description": "Typed public protocol for OMG sessions and live streams.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://omg.dev",