allsquare 0.1.1

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 (132) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/LICENSE +21 -0
  3. package/README.md +234 -0
  4. package/dist/api/client.d.ts +46 -0
  5. package/dist/api/client.d.ts.map +1 -0
  6. package/dist/api/client.js +162 -0
  7. package/dist/api/client.js.map +1 -0
  8. package/dist/api/contract.d.ts +549 -0
  9. package/dist/api/contract.d.ts.map +1 -0
  10. package/dist/api/contract.js +49 -0
  11. package/dist/api/contract.js.map +1 -0
  12. package/dist/api/model.d.ts +627 -0
  13. package/dist/api/model.d.ts.map +1 -0
  14. package/dist/api/model.js +378 -0
  15. package/dist/api/model.js.map +1 -0
  16. package/dist/auth/auth-service.d.ts +34 -0
  17. package/dist/auth/auth-service.d.ts.map +1 -0
  18. package/dist/auth/auth-service.js +221 -0
  19. package/dist/auth/auth-service.js.map +1 -0
  20. package/dist/auth/browser.d.ts +12 -0
  21. package/dist/auth/browser.d.ts.map +1 -0
  22. package/dist/auth/browser.js +50 -0
  23. package/dist/auth/browser.js.map +1 -0
  24. package/dist/auth/credential-store.d.ts +28 -0
  25. package/dist/auth/credential-store.d.ts.map +1 -0
  26. package/dist/auth/credential-store.js +75 -0
  27. package/dist/auth/credential-store.js.map +1 -0
  28. package/dist/auth/installation-store.d.ts +14 -0
  29. package/dist/auth/installation-store.d.ts.map +1 -0
  30. package/dist/auth/installation-store.js +122 -0
  31. package/dist/auth/installation-store.js.map +1 -0
  32. package/dist/auth/model.d.ts +54 -0
  33. package/dist/auth/model.d.ts.map +1 -0
  34. package/dist/auth/model.js +24 -0
  35. package/dist/auth/model.js.map +1 -0
  36. package/dist/auth/oauth-callback.d.ts +17 -0
  37. package/dist/auth/oauth-callback.d.ts.map +1 -0
  38. package/dist/auth/oauth-callback.js +94 -0
  39. package/dist/auth/oauth-callback.js.map +1 -0
  40. package/dist/auth/oauth-client.d.ts +43 -0
  41. package/dist/auth/oauth-client.d.ts.map +1 -0
  42. package/dist/auth/oauth-client.js +191 -0
  43. package/dist/auth/oauth-client.js.map +1 -0
  44. package/dist/auth/pkce.d.ts +9 -0
  45. package/dist/auth/pkce.d.ts.map +1 -0
  46. package/dist/auth/pkce.js +12 -0
  47. package/dist/auth/pkce.js.map +1 -0
  48. package/dist/command.d.ts +3 -0
  49. package/dist/command.d.ts.map +1 -0
  50. package/dist/command.js +24 -0
  51. package/dist/command.js.map +1 -0
  52. package/dist/commands/agent-guide.d.ts +5 -0
  53. package/dist/commands/agent-guide.d.ts.map +1 -0
  54. package/dist/commands/agent-guide.js +226 -0
  55. package/dist/commands/agent-guide.js.map +1 -0
  56. package/dist/commands/auth.d.ts +5 -0
  57. package/dist/commands/auth.d.ts.map +1 -0
  58. package/dist/commands/auth.js +68 -0
  59. package/dist/commands/auth.js.map +1 -0
  60. package/dist/commands/balances.d.ts +5 -0
  61. package/dist/commands/balances.d.ts.map +1 -0
  62. package/dist/commands/balances.js +106 -0
  63. package/dist/commands/balances.js.map +1 -0
  64. package/dist/commands/config.d.ts +4 -0
  65. package/dist/commands/config.d.ts.map +1 -0
  66. package/dist/commands/config.js +16 -0
  67. package/dist/commands/config.js.map +1 -0
  68. package/dist/commands/expense-input.d.ts +17 -0
  69. package/dist/commands/expense-input.d.ts.map +1 -0
  70. package/dist/commands/expense-input.js +78 -0
  71. package/dist/commands/expense-input.js.map +1 -0
  72. package/dist/commands/expenses.d.ts +5 -0
  73. package/dist/commands/expenses.d.ts.map +1 -0
  74. package/dist/commands/expenses.js +419 -0
  75. package/dist/commands/expenses.js.map +1 -0
  76. package/dist/commands/groups.d.ts +5 -0
  77. package/dist/commands/groups.d.ts.map +1 -0
  78. package/dist/commands/groups.js +149 -0
  79. package/dist/commands/groups.js.map +1 -0
  80. package/dist/commands/recurring-expenses.d.ts +5 -0
  81. package/dist/commands/recurring-expenses.d.ts.map +1 -0
  82. package/dist/commands/recurring-expenses.js +416 -0
  83. package/dist/commands/recurring-expenses.js.map +1 -0
  84. package/dist/commands/settlements.d.ts +5 -0
  85. package/dist/commands/settlements.d.ts.map +1 -0
  86. package/dist/commands/settlements.js +225 -0
  87. package/dist/commands/settlements.js.map +1 -0
  88. package/dist/commands/shared.d.ts +6 -0
  89. package/dist/commands/shared.d.ts.map +1 -0
  90. package/dist/commands/shared.js +35 -0
  91. package/dist/commands/shared.js.map +1 -0
  92. package/dist/commands/spend-summary.d.ts +5 -0
  93. package/dist/commands/spend-summary.d.ts.map +1 -0
  94. package/dist/commands/spend-summary.js +107 -0
  95. package/dist/commands/spend-summary.js.map +1 -0
  96. package/dist/commands/update.d.ts +9 -0
  97. package/dist/commands/update.d.ts.map +1 -0
  98. package/dist/commands/update.js +78 -0
  99. package/dist/commands/update.js.map +1 -0
  100. package/dist/config.d.ts +14 -0
  101. package/dist/config.d.ts.map +1 -0
  102. package/dist/config.js +52 -0
  103. package/dist/config.js.map +1 -0
  104. package/dist/errors.d.ts +87 -0
  105. package/dist/errors.d.ts.map +1 -0
  106. package/dist/errors.js +183 -0
  107. package/dist/errors.js.map +1 -0
  108. package/dist/index.d.ts +3 -0
  109. package/dist/index.d.ts.map +1 -0
  110. package/dist/index.js +43 -0
  111. package/dist/index.js.map +1 -0
  112. package/dist/interaction.d.ts +16 -0
  113. package/dist/interaction.d.ts.map +1 -0
  114. package/dist/interaction.js +14 -0
  115. package/dist/interaction.js.map +1 -0
  116. package/dist/layers.d.ts +13 -0
  117. package/dist/layers.d.ts.map +1 -0
  118. package/dist/layers.js +17 -0
  119. package/dist/layers.js.map +1 -0
  120. package/dist/output.d.ts +31 -0
  121. package/dist/output.d.ts.map +1 -0
  122. package/dist/output.js +26 -0
  123. package/dist/output.js.map +1 -0
  124. package/dist/update/update-service.d.ts +41 -0
  125. package/dist/update/update-service.d.ts.map +1 -0
  126. package/dist/update/update-service.js +231 -0
  127. package/dist/update/update-service.js.map +1 -0
  128. package/dist/version.d.ts +3 -0
  129. package/dist/version.d.ts.map +1 -0
  130. package/dist/version.js +3 -0
  131. package/dist/version.js.map +1 -0
  132. package/package.json +41 -0
@@ -0,0 +1,43 @@
1
+ import { Context, Effect, Layer } from "effect";
2
+ import { HttpClient } from "effect/unstable/http";
3
+ import { OAuthRequestError } from "../errors.js";
4
+ import type { OAuthEndpoints, TokenResponse } from "./model.js";
5
+ export declare const buildAuthorizationUrl: (options: {
6
+ readonly endpoint: string;
7
+ readonly clientId: string;
8
+ readonly redirectUri: string;
9
+ readonly resource: string;
10
+ readonly scopes: ReadonlyArray<string>;
11
+ readonly state: string;
12
+ readonly challenge: string;
13
+ }) => string;
14
+ declare const OAuthClient_base: Context.ServiceClass<OAuthClient, "@allsquare/cli/OAuthClient", {
15
+ readonly discover: (resource: string) => Effect.Effect<OAuthEndpoints, OAuthRequestError>;
16
+ readonly register: (options: {
17
+ readonly endpoints: OAuthEndpoints;
18
+ readonly name: string;
19
+ readonly redirectUri: string;
20
+ }) => Effect.Effect<string, OAuthRequestError>;
21
+ readonly exchangeCode: (options: {
22
+ readonly endpoints: OAuthEndpoints;
23
+ readonly clientId: string;
24
+ readonly code: string;
25
+ readonly verifier: string;
26
+ readonly redirectUri: string;
27
+ }) => Effect.Effect<TokenResponse, OAuthRequestError>;
28
+ readonly refresh: (options: {
29
+ readonly endpoints: OAuthEndpoints;
30
+ readonly clientId: string;
31
+ readonly refreshToken: string;
32
+ }) => Effect.Effect<TokenResponse, OAuthRequestError>;
33
+ readonly revoke: (options: {
34
+ readonly endpoints: OAuthEndpoints;
35
+ readonly clientId: string;
36
+ readonly token: string;
37
+ }) => Effect.Effect<void, OAuthRequestError>;
38
+ }>;
39
+ export declare class OAuthClient extends OAuthClient_base {
40
+ static readonly layer: Layer.Layer<OAuthClient, never, HttpClient.HttpClient>;
41
+ }
42
+ export {};
43
+ //# sourceMappingURL=oauth-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client.d.ts","sourceRoot":"","sources":["../../src/auth/oauth-client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M,CAAC,MAAM,CAAC,aAAa,EAAE,iBAAiB,CAAC;sBACnC,CAAC,OAAO,EAAE;QAC1B,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAA;QAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;QACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;KAC9B,KAAK,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,iBAAiB,CAAC;qBACpC,CAAC,OAAO,EAAE;QACzB,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAA;QAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;QACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KACvB,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC;;AAvB9C,qBAAa,WAAY,SAAQ,gBAwBC;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAK,yDAuLpB;CACF"}
@@ -0,0 +1,191 @@
1
+ import { Context, Effect, Layer, Option, Schema } from "effect";
2
+ import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http";
3
+ import { OAuthRequestError } from "../errors.js";
4
+ import { VERSION } from "../version.js";
5
+ import { API_READ_SCOPE, API_WRITE_SCOPE } from "./model.js";
6
+ const ProtectedResourceMetadata = Schema.Struct({
7
+ resource: Schema.String,
8
+ authorization_servers: Schema.Array(Schema.String)
9
+ });
10
+ const AuthorizationServerMetadata = Schema.Struct({
11
+ authorization_endpoint: Schema.String,
12
+ token_endpoint: Schema.String,
13
+ registration_endpoint: Schema.String,
14
+ revocation_endpoint: Schema.String
15
+ });
16
+ const RegistrationResponse = Schema.Struct({
17
+ client_id: Schema.String,
18
+ token_endpoint_auth_method: Schema.Literal("none"),
19
+ scope: Schema.String
20
+ });
21
+ const OAuthTokenResponse = Schema.Struct({
22
+ access_token: Schema.String,
23
+ token_type: Schema.Literal("Bearer"),
24
+ expires_in: Schema.Number,
25
+ refresh_token: Schema.String,
26
+ scope: Schema.String
27
+ });
28
+ const OAuthErrorResponse = Schema.Struct({
29
+ error: Schema.String,
30
+ error_description: Schema.optionalKey(Schema.String)
31
+ });
32
+ const decodeOAuthError = (body) => {
33
+ try {
34
+ const decoded = Schema.decodeUnknownOption(OAuthErrorResponse)(JSON.parse(body));
35
+ return Option.isSome(decoded)
36
+ ? {
37
+ error: decoded.value.error,
38
+ ...(decoded.value.error_description === undefined
39
+ ? {}
40
+ : { description: decoded.value.error_description })
41
+ }
42
+ : {};
43
+ }
44
+ catch {
45
+ return {};
46
+ }
47
+ };
48
+ const httpError = (status, body) => {
49
+ const decoded = decodeOAuthError(body);
50
+ return new OAuthRequestError({
51
+ message: decoded.description ?? decoded.error ?? `OAuth request failed with status ${status}`,
52
+ status,
53
+ ...(decoded.error === undefined ? {} : { oauthError: decoded.error })
54
+ });
55
+ };
56
+ const validateHttpsOrLoopback = (value, label) => Effect.try({
57
+ try: () => {
58
+ const url = new URL(value);
59
+ const loopback = ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
60
+ if (url.protocol !== "https:" && !(url.protocol === "http:" && loopback)) {
61
+ throw new Error(`${label} must use HTTPS unless it is a loopback URL`);
62
+ }
63
+ if (url.username || url.password || url.hash) {
64
+ throw new Error(`${label} contains unsupported URL components`);
65
+ }
66
+ return url.toString().replace(/\/$/, "");
67
+ },
68
+ catch: (cause) => new OAuthRequestError({
69
+ message: cause instanceof Error ? cause.message : `Invalid ${label}`
70
+ })
71
+ });
72
+ const protectedResourceMetadataUrl = (resource) => {
73
+ const url = new URL(resource);
74
+ const path = url.pathname.replace(/^\/+/, "").replace(/\/+$/, "");
75
+ return `${url.origin}/.well-known/oauth-protected-resource/${path}`;
76
+ };
77
+ const authorizationServerMetadataUrl = (authorizationServer) => new URL("/.well-known/oauth-authorization-server", authorizationServer).toString();
78
+ export const buildAuthorizationUrl = (options) => {
79
+ const url = new URL(options.endpoint);
80
+ url.searchParams.set("response_type", "code");
81
+ url.searchParams.set("client_id", options.clientId);
82
+ url.searchParams.set("redirect_uri", options.redirectUri);
83
+ url.searchParams.set("resource", options.resource);
84
+ url.searchParams.set("scope", options.scopes.join(" "));
85
+ url.searchParams.set("state", options.state);
86
+ url.searchParams.set("code_challenge", options.challenge);
87
+ url.searchParams.set("code_challenge_method", "S256");
88
+ const serialized = url.toString();
89
+ const queryStart = serialized.indexOf("?");
90
+ if (queryStart === -1)
91
+ return serialized;
92
+ // Next.js normalizes loopback IP literals anywhere in a NextURL, including
93
+ // inside an encoded redirect_uri query value. Encoding the dots preserves
94
+ // the RFC 8252 loopback literal while remaining equivalent after the OAuth
95
+ // server parses the query string.
96
+ return serialized.slice(0, queryStart + 1) +
97
+ serialized.slice(queryStart + 1).replaceAll("127.0.0.1", "127%2E0%2E0%2E1");
98
+ };
99
+ export class OAuthClient extends Context.Service()("@allsquare/cli/OAuthClient") {
100
+ static layer = Layer.effect(OAuthClient, Effect.gen(function* () {
101
+ const client = yield* HttpClient.HttpClient;
102
+ const executeJson = (request, schema) => client.execute(request.pipe(HttpClientRequest.setHeader("accept", "application/json"), HttpClientRequest.setHeader("user-agent", `allsquare-cli/${VERSION}`))).pipe(Effect.flatMap((response) => {
103
+ if (response.status < 200 || response.status >= 300) {
104
+ return response.text.pipe(Effect.orElseSucceed(() => ""), Effect.flatMap((body) => Effect.fail(httpError(response.status, body))));
105
+ }
106
+ return HttpClientResponse.schemaBodyJson(schema)(response).pipe(Effect.mapError((cause) => new OAuthRequestError({
107
+ message: `OAuth server returned an invalid response: ${cause.message}`,
108
+ status: response.status
109
+ })));
110
+ }), Effect.mapError((cause) => cause instanceof OAuthRequestError
111
+ ? cause
112
+ : new OAuthRequestError({
113
+ message: `OAuth request failed: ${cause.message}`
114
+ })));
115
+ const executeEmpty = (request) => client.execute(request.pipe(HttpClientRequest.setHeader("accept", "application/json"), HttpClientRequest.setHeader("user-agent", `allsquare-cli/${VERSION}`))).pipe(Effect.flatMap((response) => response.status >= 200 && response.status < 300
116
+ ? Effect.void
117
+ : response.text.pipe(Effect.orElseSucceed(() => ""), Effect.flatMap((body) => Effect.fail(httpError(response.status, body))))), Effect.mapError((cause) => cause instanceof OAuthRequestError
118
+ ? cause
119
+ : new OAuthRequestError({
120
+ message: `OAuth request failed: ${cause.message}`
121
+ })));
122
+ const tokenResponse = (response) => ({
123
+ accessToken: response.access_token,
124
+ refreshToken: response.refresh_token,
125
+ tokenType: response.token_type,
126
+ expiresIn: response.expires_in,
127
+ scopes: response.scope.split(/\s+/).filter(Boolean)
128
+ });
129
+ return OAuthClient.of({
130
+ discover: (resource) => Effect.gen(function* () {
131
+ const canonicalResource = yield* validateHttpsOrLoopback(resource, "API resource");
132
+ const protectedMetadata = yield* executeJson(HttpClientRequest.get(protectedResourceMetadataUrl(canonicalResource)), ProtectedResourceMetadata);
133
+ const metadataResource = yield* validateHttpsOrLoopback(protectedMetadata.resource, "protected resource metadata");
134
+ if (metadataResource !== canonicalResource) {
135
+ return yield* new OAuthRequestError({
136
+ message: "Protected resource metadata does not match the configured API URL"
137
+ });
138
+ }
139
+ const authorizationServer = protectedMetadata.authorization_servers[0];
140
+ if (!authorizationServer) {
141
+ return yield* new OAuthRequestError({
142
+ message: "Protected resource metadata did not identify an authorization server"
143
+ });
144
+ }
145
+ const server = yield* validateHttpsOrLoopback(authorizationServer, "authorization server");
146
+ const metadata = yield* executeJson(HttpClientRequest.get(authorizationServerMetadataUrl(server)), AuthorizationServerMetadata);
147
+ const authorizationEndpoint = yield* validateHttpsOrLoopback(metadata.authorization_endpoint, "authorization endpoint");
148
+ const tokenEndpoint = yield* validateHttpsOrLoopback(metadata.token_endpoint, "token endpoint");
149
+ const registrationEndpoint = yield* validateHttpsOrLoopback(metadata.registration_endpoint, "registration endpoint");
150
+ const revocationEndpoint = yield* validateHttpsOrLoopback(metadata.revocation_endpoint, "revocation endpoint");
151
+ return {
152
+ resource: canonicalResource,
153
+ authorizationEndpoint,
154
+ tokenEndpoint,
155
+ registrationEndpoint,
156
+ revocationEndpoint
157
+ };
158
+ }),
159
+ register: ({ endpoints, name, redirectUri }) => HttpClientRequest.post(endpoints.registrationEndpoint).pipe(HttpClientRequest.bodyJson({
160
+ client_name: name,
161
+ redirect_uris: [redirectUri],
162
+ grant_types: ["authorization_code", "refresh_token"],
163
+ response_types: ["code"],
164
+ token_endpoint_auth_method: "none",
165
+ scope: `${API_READ_SCOPE} ${API_WRITE_SCOPE}`
166
+ }), Effect.mapError((cause) => new OAuthRequestError({
167
+ message: `Could not encode client registration: ${cause.message}`
168
+ })), Effect.flatMap((request) => executeJson(request, RegistrationResponse)), Effect.map((response) => response.client_id)),
169
+ exchangeCode: ({ endpoints, clientId, code, verifier, redirectUri }) => executeJson(HttpClientRequest.post(endpoints.tokenEndpoint).pipe(HttpClientRequest.bodyUrlParams({
170
+ grant_type: "authorization_code",
171
+ client_id: clientId,
172
+ code,
173
+ code_verifier: verifier,
174
+ redirect_uri: redirectUri,
175
+ resource: endpoints.resource
176
+ })), OAuthTokenResponse).pipe(Effect.map(tokenResponse)),
177
+ refresh: ({ endpoints, clientId, refreshToken }) => executeJson(HttpClientRequest.post(endpoints.tokenEndpoint).pipe(HttpClientRequest.bodyUrlParams({
178
+ grant_type: "refresh_token",
179
+ client_id: clientId,
180
+ refresh_token: refreshToken,
181
+ resource: endpoints.resource
182
+ })), OAuthTokenResponse).pipe(Effect.map(tokenResponse)),
183
+ revoke: ({ endpoints, clientId, token }) => executeEmpty(HttpClientRequest.post(endpoints.revocationEndpoint).pipe(HttpClientRequest.bodyUrlParams({
184
+ client_id: clientId,
185
+ token,
186
+ token_type_hint: "refresh_token"
187
+ })))
188
+ });
189
+ }));
190
+ }
191
+ //# sourceMappingURL=oauth-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-client.js","sourceRoot":"","sources":["../../src/auth/oauth-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA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B,CAAC,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,IAAI,CACvD,iBAAiB,CAAC,aAAa,CAAC;gBAC9B,SAAS,EAAE,QAAQ;gBACnB,KAAK;gBACL,eAAe,EAAE,eAAe;aACjC,CAAC,CACH,CACF;SACJ,CAAC,CAAA;IACJ,CAAC,CAAC,CACH,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { Crypto, Effect } from "effect";
2
+ import { OAuthRequestError } from "../errors.js";
3
+ export interface PkceAuthorization {
4
+ readonly verifier: string;
5
+ readonly challenge: string;
6
+ readonly state: string;
7
+ }
8
+ export declare const createPkceAuthorization: Effect.Effect<PkceAuthorization, OAuthRequestError, Crypto.Crypto>;
9
+ //# sourceMappingURL=pkce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pkce.d.ts","sourceRoot":"","sources":["../../src/auth/pkce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAY,MAAM,QAAQ,CAAA;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,CACjD,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,CAAC,MAAM,CAed,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { Crypto, Effect, Encoding } from "effect";
2
+ import { OAuthRequestError } from "../errors.js";
3
+ export const createPkceAuthorization = Effect.gen(function* () {
4
+ const crypto = yield* Crypto.Crypto;
5
+ const verifier = Encoding.encodeBase64Url(yield* crypto.randomBytes(32));
6
+ const challenge = Encoding.encodeBase64Url(yield* crypto.digest("SHA-256", new TextEncoder().encode(verifier)));
7
+ const state = Encoding.encodeBase64Url(yield* crypto.randomBytes(32));
8
+ return { verifier, challenge, state };
9
+ }).pipe(Effect.mapError((cause) => new OAuthRequestError({
10
+ message: `Could not create PKCE authorization values: ${cause.message}`
11
+ })));
12
+ //# sourceMappingURL=pkce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pkce.js","sourceRoot":"","sources":["../../src/auth/pkce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAQhD,MAAM,CAAC,MAAM,uBAAuB,GAIhC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IACtB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAA;IACnC,MAAM,QAAQ,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAA;IACxE,MAAM,SAAS,GAAG,QAAQ,CAAC,eAAe,CACxC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CACpE,CAAA;IACD,MAAM,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAA;IAErE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;AACvC,CAAC,CAAC,CAAC,IAAI,CACL,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CACxB,IAAI,iBAAiB,CAAC;IACpB,OAAO,EAAE,+CAA+C,KAAK,CAAC,OAAO,EAAE;CACxE,CAAC,CAAC,CACN,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "effect/unstable/cli";
2
+ export declare const rootCommand: Command.Command<"allsquare", {}, {}, import("./errors.js").CliConfigError | import("./errors.js").CliStorageError | import("./errors.js").OAuthRequestError | import("./errors.js").OAuthCallbackError | import("./errors.js").AuthRequiredError | import("./errors.js").RefreshLockError | import("./errors.js").ApiRequestError | import("./errors.js").CliInputError | import("./errors.js").UpdateError | import("effect/Terminal").QuitError, import("./config.js").CliConfig | import("./auth/auth-service.js").AuthService | import("./api/client.js").ApiClient | import("effect/unstable/cli/Prompt").Environment | import("./update/update-service.js").UpdateService>;
3
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAa7C,eAAO,MAAM,WAAW,kpBAcvB,CAAA"}
@@ -0,0 +1,24 @@
1
+ import { Command } from "effect/unstable/cli";
2
+ import { agentGuideCommand } from "./commands/agent-guide.js";
3
+ import { authCommand } from "./commands/auth.js";
4
+ import { balancesCommand } from "./commands/balances.js";
5
+ import { configCommand } from "./commands/config.js";
6
+ import { expensesCommand } from "./commands/expenses.js";
7
+ import { groupsCommand } from "./commands/groups.js";
8
+ import { recurringExpensesCommand } from "./commands/recurring-expenses.js";
9
+ import { settlementsCommand } from "./commands/settlements.js";
10
+ import { spendSummaryCommand } from "./commands/spend-summary.js";
11
+ import { updateCommand } from "./commands/update.js";
12
+ export const rootCommand = Command.make("allsquare").pipe(Command.withDescription("Use AllSquare from the command line"), Command.withSubcommands([
13
+ agentGuideCommand,
14
+ authCommand,
15
+ groupsCommand,
16
+ balancesCommand,
17
+ expensesCommand,
18
+ recurringExpensesCommand,
19
+ settlementsCommand,
20
+ spendSummaryCommand,
21
+ updateCommand,
22
+ configCommand
23
+ ]));
24
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CACvD,OAAO,CAAC,eAAe,CAAC,qCAAqC,CAAC,EAC9D,OAAO,CAAC,eAAe,CAAC;IACtB,iBAAiB;IACjB,WAAW;IACX,aAAa;IACb,eAAe;IACf,eAAe;IACf,wBAAwB;IACxB,kBAAkB;IAClB,mBAAmB;IACnB,aAAa;IACb,aAAa;CACd,CAAC,CACH,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { Command } from "effect/unstable/cli";
2
+ export declare const agentGuideCommand: Command.Command<"agent-guide", {
3
+ readonly json: boolean;
4
+ }, {}, never, never>;
5
+ //# sourceMappingURL=agent-guide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-guide.d.ts","sourceRoot":"","sources":["../../src/commands/agent-guide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAwT7C,eAAO,MAAM,iBAAiB;;oBAY5B,CAAA"}
@@ -0,0 +1,226 @@
1
+ import { Effect } from "effect";
2
+ import { Command } from "effect/unstable/cli";
3
+ import { printSuccess } from "../output.js";
4
+ import { VERSION } from "../version.js";
5
+ import { jsonFlag } from "./shared.js";
6
+ const guide = {
7
+ schemaVersion: 1,
8
+ cliVersion: VERSION,
9
+ rules: [
10
+ {
11
+ id: "discover-before-act",
12
+ instruction: "List resources first, present readable choices, and map the user's selection to exact IDs. Never make the user choose from unexplained IDs."
13
+ },
14
+ {
15
+ id: "prefer-json",
16
+ instruction: "Use --json for automation. Parse the stable envelope instead of scraping human tables."
17
+ },
18
+ {
19
+ id: "paginate-completely",
20
+ instruction: "When a complete expense set matters, follow nextCursor with --cursor until it is null."
21
+ },
22
+ {
23
+ id: "least-privilege",
24
+ instruction: "Use read commands for discovery and preview. The normal login grants read and write access; this grant does not authorize any particular mutation. Users who need restricted credentials can log in with --read-only."
25
+ },
26
+ {
27
+ id: "authorize-writes",
28
+ instruction: "Before any mutation, show the intended change and obtain user authorization. --yes records that authorization for non-interactive guarded commands; it is not permission by itself."
29
+ },
30
+ {
31
+ id: "retry-idempotently",
32
+ instruction: "Reuse one --idempotency-key only when retrying the same logical write, and resend the identical command: the same flags and values, including --currency, --date, and --start-date. The order of repeated flags does not matter. Never reuse a key for a different write."
33
+ },
34
+ {
35
+ id: "recurring-templates",
36
+ instruction: "A recurring template whose start date is today or earlier creates its first expense immediately; report data.recurringExpense.immediateExpenseId when present. Deleting a template stops future expenses but keeps the ones it already created. Updates cannot change the next date or currency; delete and recreate the template for that."
37
+ },
38
+ {
39
+ id: "handle-errors",
40
+ instruction: "Retry only when error.retryable is true, and retry writes with the same --idempotency-key. For other errors, fix the input or ask the user. Treat FORBIDDEN on a group ID as possibly a wrong ID, not only a permission problem."
41
+ },
42
+ {
43
+ id: "recognize-replays",
44
+ instruction: "If a write's JSON output includes \"replayed\": true, nothing new was written; the data is the original result for that key. Say so rather than reporting a new change."
45
+ },
46
+ {
47
+ id: "report-exact-results",
48
+ instruction: "Report the API result accurately. Do not claim an external payment, email delivery, or other side effect succeeded unless the result confirms it."
49
+ },
50
+ {
51
+ id: "protect-credentials",
52
+ instruction: "Never print, request, copy, or transmit stored OAuth access or refresh tokens. Use the auth commands and operating-system credential vault."
53
+ }
54
+ ],
55
+ workflows: [
56
+ {
57
+ id: "select-expenses",
58
+ purpose: "Let the user choose current expenses without handling raw IDs.",
59
+ steps: [
60
+ {
61
+ instruction: "List unsettled expenses in the target group.",
62
+ command: "allsquare expenses list --group-id <GROUP_ID> --is-settled false --json"
63
+ },
64
+ {
65
+ instruction: "Follow nextCursor with --cursor when it is non-null and the user needs the complete set."
66
+ },
67
+ {
68
+ instruction: "Present a numbered summary with description, amount, date, payer, and participants; retain the corresponding IDs internally."
69
+ },
70
+ {
71
+ instruction: "Ask the user which entries they mean, then use only the mapped IDs."
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ id: "mutate",
77
+ purpose: "Perform an additive or updating write with explicit intent.",
78
+ steps: [
79
+ {
80
+ instruction: "Resolve group, member, expense, or recurring-expense IDs with read commands before constructing the write."
81
+ },
82
+ {
83
+ instruction: "Describe the exact proposed change, including recipients of invitations or notifications."
84
+ },
85
+ {
86
+ instruction: "After the user authorizes the specific change, run the write command. If it fails with AUTH_REQUIRED, ask the user to run allsquare auth login themselves; do not retry until they have."
87
+ },
88
+ {
89
+ instruction: "Execute once with --json and report the returned result. Supply a stable idempotency key only when the operation may be retried."
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ id: "delete",
95
+ purpose: "Delete only the exact expense or recurring template the user approved.",
96
+ steps: [
97
+ {
98
+ instruction: "Read and present the current target, including its ID, before asking for confirmation."
99
+ },
100
+ {
101
+ instruction: "Obtain explicit confirmation for that target. Do not infer confirmation from an earlier read or edit request."
102
+ },
103
+ {
104
+ instruction: "After confirmation, execute the relevant delete command with --yes --json."
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ id: "update-cli",
110
+ purpose: "Check for a release and update only a recognized global installation.",
111
+ steps: [
112
+ {
113
+ instruction: "Perform the read-only check and present the current version, latest version, installation method, and proposed command.",
114
+ command: "allsquare update --check --json"
115
+ },
116
+ {
117
+ instruction: "If no update is available, stop. If automaticUpdateSupported is false, return the supplied guidance and do not improvise an update command."
118
+ },
119
+ {
120
+ instruction: "Obtain explicit user confirmation for the exact update command."
121
+ },
122
+ {
123
+ instruction: "Only after confirmation, run the guarded update. Package-manager output is captured so JSON remains parseable.",
124
+ command: "allsquare update --yes --json"
125
+ }
126
+ ]
127
+ },
128
+ {
129
+ id: "settle-expenses",
130
+ purpose: "Preview selected expenses, coordinate any external payment, and then record exactly the confirmed settlement.",
131
+ steps: [
132
+ {
133
+ instruction: "Use the select-expenses workflow and retain only the IDs the user selected."
134
+ },
135
+ {
136
+ instruction: "Preview those exact IDs before recording anything.",
137
+ command: "allsquare settlements preview <GROUP_ID> --expense-id <ID> [--expense-id <ID>] --json"
138
+ },
139
+ {
140
+ instruction: "Present every payment instruction. Render venmoMarkdownLink when present; otherwise explain that no Venmo username is saved."
141
+ },
142
+ {
143
+ instruction: "Venmo is external: the user reviews and submits each payment or request. AllSquare cannot initiate or verify it, so never claim it completed."
144
+ },
145
+ {
146
+ instruction: "After the user says the payment/request is complete or explicitly chooses to record settlement without it, confirm the exact expense IDs again."
147
+ },
148
+ {
149
+ instruction: "Record only those confirmed IDs. The CLI previews again before the write.",
150
+ command: "allsquare settlements settle <GROUP_ID> --expense-id <ID> [--expense-id <ID>] --yes --json"
151
+ }
152
+ ]
153
+ }
154
+ ],
155
+ outputContract: {
156
+ success: {
157
+ stream: "stdout",
158
+ exitCode: 0,
159
+ envelope: {
160
+ discriminant: { field: "ok", value: true },
161
+ requiredFields: ["ok", "data"]
162
+ }
163
+ },
164
+ failure: {
165
+ stream: "stderr",
166
+ exitCode: "nonzero",
167
+ envelope: {
168
+ discriminant: { field: "ok", value: false },
169
+ requiredFields: ["ok", "error"],
170
+ error: {
171
+ requiredFields: ["code", "message", "retryable"],
172
+ optionalFields: ["details"]
173
+ }
174
+ },
175
+ exitCodes: {
176
+ "2": "Invalid input or configuration; fix the command before retrying",
177
+ "3": "Authentication or permission; ask the user to run allsquare auth login, or check the ID",
178
+ "4": "Conflict with current state, such as an already settled expense",
179
+ "5": "Temporary or service failure; retry when error.retryable is true",
180
+ "6": "Not found; confirm the ID with a list command",
181
+ "1": "Unexpected failure"
182
+ },
183
+ errorCodes: [
184
+ { code: "INVALID_ARGUMENT", meaning: "Input failed validation locally or on the server; see error.message and details.fields", retryable: false },
185
+ { code: "AUTH_REQUIRED", meaning: "No usable session or the session lacks write access; the user must log in", retryable: false },
186
+ { code: "FORBIDDEN", meaning: "Not allowed. Groups you do not belong to and groups that do not exist both return this, so a wrong group ID looks like a permission error", retryable: false },
187
+ { code: "NOT_FOUND", meaning: "The expense, recurring expense, or other resource does not exist", retryable: false },
188
+ { code: "CONFLICT", meaning: "Conflicts with current state, such as settling an already settled expense or reusing an idempotency key with a different request", retryable: false },
189
+ { code: "IN_PROGRESS", meaning: "The same idempotent write is still running; wait details.retryAfterSeconds, then retry with the same idempotency key to get its result", retryable: true },
190
+ { code: "RATE_LIMITED", meaning: "Too many requests; wait details.retryAfterSeconds before retrying", retryable: true },
191
+ { code: "SERVICE_UNAVAILABLE", meaning: "The server failed; the outcome of a write is uncertain, so retry with the same idempotency key", retryable: true },
192
+ { code: "NETWORK_ERROR", meaning: "No response was received; retry a write only with the same idempotency key", retryable: true },
193
+ { code: "AUTH_BUSY", meaning: "Another CLI process is refreshing the session", retryable: true }
194
+ ]
195
+ },
196
+ pagination: "Expense lists return data.nextCursor. Pass a non-null value back with --cursor to fetch the next page."
197
+ }
198
+ };
199
+ const renderStep = (step, index) => `${index + 1}. ${step.instruction}${step.command === undefined ? "" : `\n ${step.command}`}`;
200
+ const renderGuide = (value) => [
201
+ `AllSquare CLI agent guide (schema ${value.schemaVersion}, CLI ${value.cliVersion})`,
202
+ "",
203
+ "Operating rules",
204
+ ...value.rules.map((rule, index) => `${index + 1}. ${rule.instruction}`),
205
+ ...value.workflows.flatMap((workflow) => [
206
+ "",
207
+ `${workflow.id}: ${workflow.purpose}`,
208
+ ...workflow.steps.map(renderStep)
209
+ ]),
210
+ "",
211
+ "Machine-readable output",
212
+ `- Success: ${value.outputContract.success.stream}, exit ${value.outputContract.success.exitCode}; ok=true with required fields ${value.outputContract.success.envelope.requiredFields.join(", ")}.`,
213
+ `- Failure: ${value.outputContract.failure.stream}, ${value.outputContract.failure.exitCode} exit; ok=false with required fields ${value.outputContract.failure.envelope.requiredFields.join(", ")}; error requires ${value.outputContract.failure.envelope.error.requiredFields.join(", ")} and may include ${value.outputContract.failure.envelope.error.optionalFields.join(", ")}.`,
214
+ `- Exit codes: ${Object.entries(value.outputContract.failure.exitCodes).map(([code, meaning]) => `${code} ${meaning}`).join("; ")}.`,
215
+ "- Error codes:",
216
+ ...value.outputContract.failure.errorCodes.map((entry) => ` ${entry.code}${entry.retryable ? " (retryable)" : ""}: ${entry.meaning}`),
217
+ `- Pagination: ${value.outputContract.pagination}`
218
+ ].join("\n");
219
+ export const agentGuideCommand = Command.make("agent-guide", { json: jsonFlag }, Effect.fn(function* ({ json }) {
220
+ yield* printSuccess({
221
+ data: guide,
222
+ json,
223
+ renderHuman: renderGuide
224
+ });
225
+ })).pipe(Command.withDescription("Show versioned workflows and safety rules for AI agents"));
226
+ //# sourceMappingURL=agent-guide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-guide.js","sourceRoot":"","sources":["../../src/commands/agent-guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAoDtC,MAAM,KAAK,GAAe;IACxB,aAAa,EAAE,CAAC;I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AO,CAAC,eAAe,CAC5B,yDAAyD,CAC1D,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { Command } from "effect/unstable/cli";
2
+ import { AuthService } from "../auth/auth-service.js";
3
+ import { CliInputError } from "../errors.js";
4
+ export declare const authCommand: Command.Command<"auth", {}, {}, CliInputError | import("../auth/auth-service.js").AuthError, AuthService>;
5
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAQ,MAAM,qBAAqB,CAAA;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AA+G5C,eAAO,MAAM,WAAW,2GAGvB,CAAA"}