@ai-accounts/ts-core 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -293,6 +293,24 @@ var AiAccountsClient = class {
293
293
  );
294
294
  if (!r.ok) throw await toError(r);
295
295
  }
296
+ /**
297
+ * Write arbitrary text to the CLI's stdin during an in-flight login
298
+ * session. Unlike respondLogin, this does NOT require an active
299
+ * textPrompt — used by the AccountWizard's eager paste-code form,
300
+ * which lets users submit the OAuth code before the CLI has emitted
301
+ * its own "Paste code here if prompted >" text prompt.
302
+ */
303
+ async writeEagerLogin(accountId, sessionId, text) {
304
+ const r = await this._fetch(
305
+ `${this.baseUrl}/api/v1/backends/${encodeURIComponent(accountId)}/login/write`,
306
+ {
307
+ method: "POST",
308
+ headers: this.headers(),
309
+ body: JSON.stringify({ session_id: sessionId, text })
310
+ }
311
+ );
312
+ if (!r.ok) throw await toError(r);
313
+ }
296
314
  async cancelLogin(accountId, sessionId) {
297
315
  const r = await this._fetch(
298
316
  `${this.baseUrl}/api/v1/backends/${encodeURIComponent(accountId)}/login/cancel`,
package/dist/index.d.cts CHANGED
@@ -1335,6 +1335,14 @@ declare class AiAccountsClient {
1335
1335
  session_id: string;
1336
1336
  }>;
1337
1337
  respondLogin(accountId: string, sessionId: string, promptId: string, answer: string): Promise<void>;
1338
+ /**
1339
+ * Write arbitrary text to the CLI's stdin during an in-flight login
1340
+ * session. Unlike respondLogin, this does NOT require an active
1341
+ * textPrompt — used by the AccountWizard's eager paste-code form,
1342
+ * which lets users submit the OAuth code before the CLI has emitted
1343
+ * its own "Paste code here if prompted >" text prompt.
1344
+ */
1345
+ writeEagerLogin(accountId: string, sessionId: string, text: string): Promise<void>;
1338
1346
  cancelLogin(accountId: string, sessionId: string): Promise<void>;
1339
1347
  streamLogin(accountId: string, sessionId: string): AsyncIterable<LoginEvent>;
1340
1348
  getBackendMetadata(): Promise<{
package/dist/index.d.ts CHANGED
@@ -1335,6 +1335,14 @@ declare class AiAccountsClient {
1335
1335
  session_id: string;
1336
1336
  }>;
1337
1337
  respondLogin(accountId: string, sessionId: string, promptId: string, answer: string): Promise<void>;
1338
+ /**
1339
+ * Write arbitrary text to the CLI's stdin during an in-flight login
1340
+ * session. Unlike respondLogin, this does NOT require an active
1341
+ * textPrompt — used by the AccountWizard's eager paste-code form,
1342
+ * which lets users submit the OAuth code before the CLI has emitted
1343
+ * its own "Paste code here if prompted >" text prompt.
1344
+ */
1345
+ writeEagerLogin(accountId: string, sessionId: string, text: string): Promise<void>;
1338
1346
  cancelLogin(accountId: string, sessionId: string): Promise<void>;
1339
1347
  streamLogin(accountId: string, sessionId: string): AsyncIterable<LoginEvent>;
1340
1348
  getBackendMetadata(): Promise<{
package/dist/index.js CHANGED
@@ -262,6 +262,24 @@ var AiAccountsClient = class {
262
262
  );
263
263
  if (!r.ok) throw await toError(r);
264
264
  }
265
+ /**
266
+ * Write arbitrary text to the CLI's stdin during an in-flight login
267
+ * session. Unlike respondLogin, this does NOT require an active
268
+ * textPrompt — used by the AccountWizard's eager paste-code form,
269
+ * which lets users submit the OAuth code before the CLI has emitted
270
+ * its own "Paste code here if prompted >" text prompt.
271
+ */
272
+ async writeEagerLogin(accountId, sessionId, text) {
273
+ const r = await this._fetch(
274
+ `${this.baseUrl}/api/v1/backends/${encodeURIComponent(accountId)}/login/write`,
275
+ {
276
+ method: "POST",
277
+ headers: this.headers(),
278
+ body: JSON.stringify({ session_id: sessionId, text })
279
+ }
280
+ );
281
+ if (!r.ok) throw await toError(r);
282
+ }
265
283
  async cancelLogin(accountId, sessionId) {
266
284
  const r = await this._fetch(
267
285
  `${this.baseUrl}/api/v1/backends/${encodeURIComponent(accountId)}/login/cancel`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-accounts/ts-core",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "Framework-agnostic TypeScript client and protocol for ai-accounts",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",