@soederpop/luca 0.0.20 → 0.0.22

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.
@@ -1,7 +1,7 @@
1
1
  import { setBuildTimeData, setContainerBuildTimeData } from './index.js';
2
2
 
3
3
  // Auto-generated introspection registry data
4
- // Generated at: 2026-03-21T01:13:42.185Z
4
+ // Generated at: 2026-03-21T15:48:33.058Z
5
5
 
6
6
  setBuildTimeData('features.containerLink', {
7
7
  "id": "features.containerLink",
@@ -56,6 +56,7 @@ import "./features/google-drive";
56
56
  import "./features/google-sheets";
57
57
  import "./features/google-calendar";
58
58
  import "./features/google-docs";
59
+ import "./features/google-mail";
59
60
  import "./features/window-manager";
60
61
  import "./features/nlp";
61
62
  import "./features/process-manager"
@@ -100,6 +101,7 @@ import type { GoogleDrive } from './features/google-drive';
100
101
  import type { GoogleSheets } from './features/google-sheets';
101
102
  import type { GoogleCalendar } from './features/google-calendar';
102
103
  import type { GoogleDocs } from './features/google-docs';
104
+ import type { GoogleMail } from './features/google-mail';
103
105
  import type { WindowManager } from './features/window-manager';
104
106
  import type { NLP } from './features/nlp';
105
107
  import type { ProcessManager } from './features/process-manager'
@@ -139,6 +141,7 @@ export {
139
141
  type GoogleSheets,
140
142
  type GoogleCalendar,
141
143
  type GoogleDocs,
144
+ type GoogleMail,
142
145
  type WindowManager,
143
146
  type NLP,
144
147
  type ProcessManager,
@@ -204,6 +207,7 @@ export interface NodeFeatures extends AvailableFeatures {
204
207
  googleSheets: typeof GoogleSheets;
205
208
  googleCalendar: typeof GoogleCalendar;
206
209
  googleDocs: typeof GoogleDocs;
210
+ googleMail: typeof GoogleMail;
207
211
  windowManager: typeof WindowManager;
208
212
  nlp: typeof NLP;
209
213
  processManager: typeof ProcessManager;
@@ -218,9 +222,20 @@ export type ClientsAndServersInterface = ClientsInterface & ServersInterface & C
218
222
 
219
223
  export interface NodeContainer extends ClientsAndServersInterface {}
220
224
 
225
+ /*
226
+ export interface NodeContainerState extends ContainerState {
227
+ // in luca.cli.ts you can set this to true and instead of displaying the help screen
228
+ // it will emit a 'commandMissing' event with the command name and args
229
+ // so that you can handle it however you want. This allows for a CLI dx like
230
+ // luca literally type whatever you want and if your project wants to try and do
231
+ // something with it, it will try and do it.
232
+ captureMissingCommands?: boolean;
233
+ }
234
+ */
235
+
221
236
  export class NodeContainer<
222
237
  Features extends NodeFeatures = NodeFeatures,
223
- K extends ContainerState = ContainerState
238
+ K extends ContainerState = ContainerState
224
239
  > extends Container<Features, K> {
225
240
  fs!: FS;
226
241
  git!: Git;
@@ -252,6 +267,7 @@ export class NodeContainer<
252
267
  googleSheets?: GoogleSheets;
253
268
  googleCalendar?: GoogleCalendar;
254
269
  googleDocs?: GoogleDocs;
270
+ googleMail?: GoogleMail;
255
271
  windowManager?: WindowManager;
256
272
  nlp?: NLP;
257
273
  processManager?: ProcessManager;
@@ -285,6 +301,10 @@ export class NodeContainer<
285
301
  }
286
302
  });
287
303
 
304
+ if (this.isBun) {
305
+ this.addContext('Bun', Bun)
306
+ }
307
+
288
308
  this.use(Client).use(Server).use(Command).use(Endpoint).use(Selector);
289
309
  }
290
310
 
@@ -350,4 +370,18 @@ export class NodeContainer<
350
370
  parse
351
371
  };
352
372
  }
373
+
374
+ /**
375
+ * In your project's luca.cli.ts you can call this method and pass it a function
376
+ * and when you call an invalid command, the function will be called with the command name and args
377
+ * this allows you to define your own DX behavior for handling unknown commands in your project
378
+ *
379
+ * This is a special luca cli hook. The function will be called with { words: string[], phrase: string, argv: any }
380
+ */
381
+ private onMissingCommand(handler: any) {
382
+ // @ts-ignore
383
+ this.state.set('missingCommandHandler', handler)
384
+
385
+ return this
386
+ }
353
387
  }
@@ -139,6 +139,7 @@ export class GoogleAuth extends Feature<GoogleAuthState, GoogleAuthOptions> {
139
139
  'https://www.googleapis.com/auth/spreadsheets.readonly',
140
140
  'https://www.googleapis.com/auth/calendar.readonly',
141
141
  'https://www.googleapis.com/auth/documents.readonly',
142
+ 'https://www.googleapis.com/auth/gmail.readonly',
142
143
  ]
143
144
  }
144
145
 
@@ -57,6 +57,7 @@ export const GoogleCalendarStateSchema = FeatureStateSchema.extend({
57
57
  export type GoogleCalendarState = z.infer<typeof GoogleCalendarStateSchema>
58
58
 
59
59
  export const GoogleCalendarOptionsSchema = FeatureOptionsSchema.extend({
60
+ auth: z.any().describe('An authorized instance of the googleAuth feature').optional(),
60
61
  defaultCalendarId: z.string().optional()
61
62
  .describe('Default calendar ID (default: "primary")'),
62
63
  timeZone: z.string().optional()
@@ -114,6 +115,10 @@ export class GoogleCalendar extends Feature<GoogleCalendarState, GoogleCalendarO
114
115
 
115
116
  /** Access the google-auth feature lazily. */
116
117
  get auth(): GoogleAuth {
118
+ if (this.options.auth) {
119
+ return this.options.auth as GoogleAuth
120
+ }
121
+
117
122
  return this.container.feature('googleAuth') as unknown as GoogleAuth
118
123
  }
119
124
 
@@ -15,7 +15,10 @@ export const GoogleDocsStateSchema = FeatureStateSchema.extend({
15
15
  })
16
16
  export type GoogleDocsState = z.infer<typeof GoogleDocsStateSchema>
17
17
 
18
- export const GoogleDocsOptionsSchema = FeatureOptionsSchema.extend({})
18
+ export const GoogleDocsOptionsSchema = FeatureOptionsSchema.extend({
19
+ auth: z.any().describe('An authorized instance of the googleAuth feature').optional(),
20
+ })
21
+
19
22
  export type GoogleDocsOptions = z.infer<typeof GoogleDocsOptionsSchema>
20
23
 
21
24
  export const GoogleDocsEventsSchema = FeatureEventsSchema.extend({
@@ -65,6 +68,10 @@ export class GoogleDocs extends Feature<GoogleDocsState, GoogleDocsOptions> {
65
68
 
66
69
  /** Access the google-auth feature lazily. */
67
70
  get auth(): GoogleAuth {
71
+ if (this.options.auth) {
72
+ return this.options.auth as GoogleAuth
73
+ }
74
+
68
75
  return this.container.feature('googleAuth') as unknown as GoogleAuth
69
76
  }
70
77
 
@@ -59,6 +59,8 @@ export const GoogleDriveStateSchema = FeatureStateSchema.extend({
59
59
  export type GoogleDriveState = z.infer<typeof GoogleDriveStateSchema>
60
60
 
61
61
  export const GoogleDriveOptionsSchema = FeatureOptionsSchema.extend({
62
+ auth: z.any().describe('An authorized instance of the googleAuth feature').optional(),
63
+
62
64
  defaultCorpora: z.enum(['user', 'drive', 'allDrives']).optional()
63
65
  .describe('Default corpus for file queries (default: user)'),
64
66
  pageSize: z.number().optional()
@@ -114,6 +116,10 @@ export class GoogleDrive extends Feature<GoogleDriveState, GoogleDriveOptions> {
114
116
 
115
117
  /** Access the google-auth feature lazily. */
116
118
  get auth(): GoogleAuth {
119
+ if (this.options.auth) {
120
+ return this.options.auth as GoogleAuth
121
+ }
122
+
117
123
  return this.container.feature('googleAuth') as unknown as GoogleAuth
118
124
  }
119
125