@extentos/mcp-server 0.0.75 → 0.0.78
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/tools/data/codeExamples.d.ts +53 -0
- package/dist/tools/data/codeExamples.d.ts.map +1 -1
- package/dist/tools/data/codeExamples.js +254 -62
- package/dist/tools/data/codeExamples.js.map +1 -1
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +6 -8
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/docs/index.d.ts.map +1 -1
- package/dist/tools/docs/index.js +38 -24
- package/dist/tools/docs/index.js.map +1 -1
- package/dist/tools/handlers/createSimulatorSession.d.ts.map +1 -1
- package/dist/tools/handlers/createSimulatorSession.js +16 -4
- package/dist/tools/handlers/createSimulatorSession.js.map +1 -1
- package/dist/tools/handlers/generateConnectionModule.d.ts.map +1 -1
- package/dist/tools/handlers/generateConnectionModule.js +20 -13
- package/dist/tools/handlers/generateConnectionModule.js.map +1 -1
- package/dist/tools/handlers/getCodeExample.d.ts.map +1 -1
- package/dist/tools/handlers/getCodeExample.js +11 -1
- package/dist/tools/handlers/getCodeExample.js.map +1 -1
- package/dist/tools/handlers/getCredentialGuide.js +57 -8
- package/dist/tools/handlers/getCredentialGuide.js.map +1 -1
- package/dist/tools/handlers/getEventLog.d.ts.map +1 -1
- package/dist/tools/handlers/getEventLog.js +8 -10
- package/dist/tools/handlers/getEventLog.js.map +1 -1
- package/dist/tools/handlers/inspectIntegration.d.ts.map +1 -1
- package/dist/tools/handlers/inspectIntegration.js +8 -3
- package/dist/tools/handlers/inspectIntegration.js.map +1 -1
- package/dist/tools/handlers/validateIntegration.d.ts.map +1 -1
- package/dist/tools/handlers/validateIntegration.js +9 -3
- package/dist/tools/handlers/validateIntegration.js.map +1 -1
- package/dist/tools/util/generatedHash.d.ts +24 -8
- package/dist/tools/util/generatedHash.d.ts.map +1 -1
- package/dist/tools/util/generatedHash.js +88 -11
- package/dist/tools/util/generatedHash.js.map +1 -1
- package/package.json +1 -1
- package/dist/tools/data/examplePatterns.d.ts +0 -4
- package/dist/tools/data/examplePatterns.d.ts.map +0 -1
- package/dist/tools/data/examplePatterns.js +0 -546
- package/dist/tools/data/examplePatterns.js.map +0 -1
- package/dist/tools/data/presetTriggers.d.ts +0 -4
- package/dist/tools/data/presetTriggers.d.ts.map +0 -1
- package/dist/tools/data/presetTriggers.js +0 -47
- package/dist/tools/data/presetTriggers.js.map +0 -1
- package/dist/tools/handlers/generateConsumer.d.ts +0 -3
- package/dist/tools/handlers/generateConsumer.d.ts.map +0 -1
- package/dist/tools/handlers/generateConsumer.js +0 -477
- package/dist/tools/handlers/generateConsumer.js.map +0 -1
- package/dist/tools/handlers/getExampleSpec.d.ts +0 -3
- package/dist/tools/handlers/getExampleSpec.d.ts.map +0 -1
- package/dist/tools/handlers/getExampleSpec.js +0 -50
- package/dist/tools/handlers/getExampleSpec.js.map +0 -1
- package/dist/tools/handlers/initSpec.d.ts +0 -3
- package/dist/tools/handlers/initSpec.d.ts.map +0 -1
- package/dist/tools/handlers/initSpec.js +0 -350
- package/dist/tools/handlers/initSpec.js.map +0 -1
- package/dist/tools/handlers/planIntegration.d.ts +0 -3
- package/dist/tools/handlers/planIntegration.d.ts.map +0 -1
- package/dist/tools/handlers/planIntegration.js +0 -293
- package/dist/tools/handlers/planIntegration.js.map +0 -1
- package/dist/tools/handlers/updateSpec.d.ts +0 -3
- package/dist/tools/handlers/updateSpec.d.ts.map +0 -1
- package/dist/tools/handlers/updateSpec.js +0 -579
- package/dist/tools/handlers/updateSpec.js.map +0 -1
- package/dist/tools/handlers/validateSpec.d.ts +0 -3
- package/dist/tools/handlers/validateSpec.d.ts.map +0 -1
- package/dist/tools/handlers/validateSpec.js +0 -33
- package/dist/tools/handlers/validateSpec.js.map +0 -1
- package/dist/tools/templates/callbackHandler.d.ts +0 -11
- package/dist/tools/templates/callbackHandler.d.ts.map +0 -1
- package/dist/tools/templates/callbackHandler.js +0 -215
- package/dist/tools/templates/callbackHandler.js.map +0 -1
- package/dist/tools/templates/streamConsumer.d.ts +0 -8
- package/dist/tools/templates/streamConsumer.d.ts.map +0 -1
- package/dist/tools/templates/streamConsumer.js +0 -322
- package/dist/tools/templates/streamConsumer.js.map +0 -1
- package/dist/tools/util/userCodeMerge.d.ts +0 -69
- package/dist/tools/util/userCodeMerge.d.ts.map +0 -1
- package/dist/tools/util/userCodeMerge.js +0 -168
- package/dist/tools/util/userCodeMerge.js.map +0 -1
- package/dist/tools/validation/validateSpec.d.ts +0 -22
- package/dist/tools/validation/validateSpec.d.ts.map +0 -1
- package/dist/tools/validation/validateSpec.js +0 -623
- package/dist/tools/validation/validateSpec.js.map +0 -1
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// validateSpec — detached spec validation (no filesystem).
|
|
2
|
-
// Spec: docs/mcp/MCP_TOOLS.md § validateSpec
|
|
3
|
-
// Wraps the reference validateSpec() in ../validation/validateSpec.ts.
|
|
4
|
-
import { validateSpec } from "../validation/validateSpec.js";
|
|
5
|
-
import { okResponse, errorResponse } from "../response.js";
|
|
6
|
-
export function handleValidateSpec(raw) {
|
|
7
|
-
if (!raw || typeof raw !== "object") {
|
|
8
|
-
return errorResponse({
|
|
9
|
-
code: "invalid_arguments",
|
|
10
|
-
message: "validateSpec requires an object argument with { spec }.",
|
|
11
|
-
fixHint: "Pass { spec: <spec object> }.",
|
|
12
|
-
retryable: false,
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
const obj = raw;
|
|
16
|
-
if (!obj.spec || typeof obj.spec !== "object") {
|
|
17
|
-
return errorResponse({
|
|
18
|
-
code: "invalid_arguments",
|
|
19
|
-
message: "spec is required and must be an object.",
|
|
20
|
-
fixHint: "Pass the spec JSON you want validated as { spec: {...} }.",
|
|
21
|
-
retryable: false,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
const result = validateSpec(obj.spec);
|
|
25
|
-
const errCount = result.errors?.length ?? 0;
|
|
26
|
-
const warnCount = result.warnings?.length ?? 0;
|
|
27
|
-
const valid = result.valid ?? errCount === 0;
|
|
28
|
-
const summary = valid
|
|
29
|
-
? `Spec valid${warnCount ? ` (${warnCount} warning${warnCount === 1 ? "" : "s"})` : ""}.`
|
|
30
|
-
: `Spec invalid: ${errCount} error${errCount === 1 ? "" : "s"}${warnCount ? `, ${warnCount} warning${warnCount === 1 ? "" : "s"}` : ""}.`;
|
|
31
|
-
return okResponse({ ...result, summary });
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=validateSpec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateSpec.js","sourceRoot":"","sources":["../../../src/tools/handlers/validateSpec.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,6CAA6C;AAC7C,uEAAuE;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAmB,MAAM,gBAAgB,CAAC;AAE5E,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC7C,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,aAAa,CAAC;YACnB,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,yDAAyD;YAClE,OAAO,EAAE,+BAA+B;YACxC,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;IACL,CAAC;IACD,MAAM,GAAG,GAAG,GAA8B,CAAC;IAC3C,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9C,OAAO,aAAa,CAAC;YACnB,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,yCAAyC;YAClD,OAAO,EAAE,2DAA2D;YACpE,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;IACL,CAAC;IACD,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAI,MAAiC,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC;IACxE,MAAM,SAAS,GAAI,MAAmC,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,CAAC;IAC7E,MAAM,KAAK,GAAI,MAA8B,CAAC,KAAK,IAAI,QAAQ,KAAK,CAAC,CAAC;IACtE,MAAM,OAAO,GAAG,KAAK;QACnB,CAAC,CAAC,aAAa,SAAS,CAAC,CAAC,CAAC,KAAK,SAAS,WAAW,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG;QACzF,CAAC,CAAC,iBAAiB,QAAQ,SAAS,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,SAAS,WAAW,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;IAC5I,OAAO,UAAU,CAAC,EAAE,GAAI,MAAiB,EAAE,OAAO,EAAE,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface HandlerSpec {
|
|
2
|
-
name: string;
|
|
3
|
-
inputKeys?: string[];
|
|
4
|
-
service?: string;
|
|
5
|
-
suggestedProvider?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function renderAndroidCallbacks(appPackage: string, handlerNames: string[]): string;
|
|
8
|
-
export declare function renderIosCallbacks(handlerNames: string[]): string;
|
|
9
|
-
export declare function renderAndroidCallbacksRich(appPackage: string, handlers: HandlerSpec[], concise: boolean): string;
|
|
10
|
-
export declare function renderIosCallbacksRich(handlers: HandlerSpec[], concise: boolean): string;
|
|
11
|
-
//# sourceMappingURL=callbackHandler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"callbackHandler.d.ts","sourceRoot":"","sources":["../../../src/tools/templates/callbackHandler.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CA2CzF;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CAgDjE;AAED,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,WAAW,EAAE,EACvB,OAAO,EAAE,OAAO,GACf,MAAM,CAwDR;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAuDxF"}
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
// ExtentosCallbacks.{kt,swift} templates.
|
|
2
|
-
// Two render paths:
|
|
3
|
-
// - renderAndroidCallbacks / renderIosCallbacks: bare stubs used by initSpec.
|
|
4
|
-
// - renderAndroidCallbacksRich / renderIosCallbacksRich: BYOK-enriched stubs used
|
|
5
|
-
// by generateConsumer (service, inputKeys, suggestedProvider → TODO reference).
|
|
6
|
-
// Scoped markers per docs/mcp/INTEGRATION_SHAPE.md § Generated File Conventions.
|
|
7
|
-
export function renderAndroidCallbacks(appPackage, handlerNames) {
|
|
8
|
-
const dispatchArms = handlerNames.length
|
|
9
|
-
? handlerNames.map((h) => ` "${h}" -> handle${toPascalCase(h)}(call)`).join("\n")
|
|
10
|
-
: ' // (no handlers declared in the spec — add one via updateSpec and regenerate with generateConsumer)';
|
|
11
|
-
const handlerFns = handlerNames
|
|
12
|
-
.map((h) => {
|
|
13
|
-
const fn = `handle${toPascalCase(h)}`;
|
|
14
|
-
return (`private suspend fun ${fn}(call: AppCall): AppCallbackResult {\n` +
|
|
15
|
-
` // USER-CODE-START:${h}\n` +
|
|
16
|
-
` // TODO: implement the "${h}" handler. Return AppCallbackResult.Success(value) or .Error(code, message).\n` +
|
|
17
|
-
` return AppCallbackResult.Error(code = "not_implemented", message = "TODO: implement ${h} handler")\n` +
|
|
18
|
-
` // USER-CODE-END:${h}\n` +
|
|
19
|
-
`}`);
|
|
20
|
-
})
|
|
21
|
-
.join("\n\n");
|
|
22
|
-
return (`// EXTENTOS-GENERATED — do not edit the dispatch structure. Regenerate via MCP tools.\n` +
|
|
23
|
-
`package ${appPackage}.extentos\n\n` +
|
|
24
|
-
`// USER-CODE-START:imports\n` +
|
|
25
|
-
`// Auto-imports from your IDE land HERE — anything OUTSIDE this block is\n` +
|
|
26
|
-
`// regenerated and your edits will be lost. Add any extra imports inside this\n` +
|
|
27
|
-
`// block; the core library imports below are pre-populated for you.\n` +
|
|
28
|
-
`import com.extentos.glasses.core.AppCall\n` +
|
|
29
|
-
`import com.extentos.glasses.core.AppCallbackHandler\n` +
|
|
30
|
-
`import com.extentos.glasses.core.AppCallbackResult\n` +
|
|
31
|
-
`// USER-CODE-END:imports\n\n` +
|
|
32
|
-
`val extentosCallbackHandler = AppCallbackHandler { call ->\n` +
|
|
33
|
-
` // EXTENTOS-GENERATED-START:dispatch\n` +
|
|
34
|
-
` when (call.handler) {\n` +
|
|
35
|
-
`${dispatchArms}\n` +
|
|
36
|
-
` else -> AppCallbackResult.Error(\n` +
|
|
37
|
-
` code = "unknown_handler",\n` +
|
|
38
|
-
` message = "No handler for '\${call.handler}'"\n` +
|
|
39
|
-
` )\n` +
|
|
40
|
-
` }\n` +
|
|
41
|
-
` // EXTENTOS-GENERATED-END:dispatch\n` +
|
|
42
|
-
`}\n` +
|
|
43
|
-
(handlerFns ? `\n${handlerFns}\n` : ""));
|
|
44
|
-
}
|
|
45
|
-
export function renderIosCallbacks(handlerNames) {
|
|
46
|
-
const dispatchArms = handlerNames.length
|
|
47
|
-
? handlerNames
|
|
48
|
-
.map((h) => ` case "${h}":\n return await handle${toPascalCase(h)}(call)`)
|
|
49
|
-
.join("\n")
|
|
50
|
-
: ` // (no handlers declared in the spec — add one via updateSpec and regenerate with generateConsumer)`;
|
|
51
|
-
const handlerFns = handlerNames
|
|
52
|
-
.map((h) => {
|
|
53
|
-
const fn = `handle${toPascalCase(h)}`;
|
|
54
|
-
return (`private func ${fn}(_ call: AppCall) async -> AppCallbackResult {\n` +
|
|
55
|
-
` // USER-CODE-START:${h}\n` +
|
|
56
|
-
` // TODO: implement the "${h}" handler. Return .success(value:) or .error(code:, message:).\n` +
|
|
57
|
-
` return .error(code: "not_implemented", message: "TODO: implement ${h} handler")\n` +
|
|
58
|
-
` // USER-CODE-END:${h}\n` +
|
|
59
|
-
`}`);
|
|
60
|
-
})
|
|
61
|
-
.join("\n\n");
|
|
62
|
-
return (`// EXTENTOS-GENERATED — do not edit the dispatch structure. Regenerate via MCP tools.\n` +
|
|
63
|
-
`// USER-CODE-START:imports\n` +
|
|
64
|
-
`// Auto-imports from your IDE land HERE — anything OUTSIDE this block is\n` +
|
|
65
|
-
`// regenerated and your edits will be lost. Add any extra imports inside this\n` +
|
|
66
|
-
`// block; the core library imports below are pre-populated for you.\n` +
|
|
67
|
-
`import Foundation\n` +
|
|
68
|
-
`import GlassesCore\n` +
|
|
69
|
-
`// USER-CODE-END:imports\n\n` +
|
|
70
|
-
`final class ExtentosCallbacks: AppCallbackHandler {\n` +
|
|
71
|
-
` func handle(_ call: AppCall) async -> AppCallbackResult {\n` +
|
|
72
|
-
` // EXTENTOS-GENERATED-START:dispatch\n` +
|
|
73
|
-
` switch call.handler {\n` +
|
|
74
|
-
`${dispatchArms}\n` +
|
|
75
|
-
` default:\n` +
|
|
76
|
-
` return .error(code: "unknown_handler", message: "No handler for '\\(call.handler)'")\n` +
|
|
77
|
-
` }\n` +
|
|
78
|
-
` // EXTENTOS-GENERATED-END:dispatch\n` +
|
|
79
|
-
` }\n` +
|
|
80
|
-
(handlerFns
|
|
81
|
-
? `\n${handlerFns.replace(/^/gm, " ")}\n`
|
|
82
|
-
: "") +
|
|
83
|
-
`}\n`);
|
|
84
|
-
}
|
|
85
|
-
export function renderAndroidCallbacksRich(appPackage, handlers, concise) {
|
|
86
|
-
const dispatchArms = handlers.length
|
|
87
|
-
? handlers.map((h) => ` "${h.name}" -> handle${toPascalCase(h.name)}(call)`).join("\n")
|
|
88
|
-
: ` // (no handlers declared in the spec — add via updateSpec)`;
|
|
89
|
-
const handlerFns = handlers
|
|
90
|
-
.map((h) => {
|
|
91
|
-
const fn = `handle${toPascalCase(h.name)}`;
|
|
92
|
-
const inputShape = h.inputKeys && h.inputKeys.length
|
|
93
|
-
? ` // Input: { ${h.inputKeys.map((k) => `"${k}": "<string>"`).join(", ")} }\n`
|
|
94
|
-
: "";
|
|
95
|
-
// BYOK example only when an AI provider is actually suggested. Otherwise
|
|
96
|
-
// a generic "implement this handler" comment fits non-AI handlers (DB,
|
|
97
|
-
// local logic, file IO, etc.) instead of misleading them toward an
|
|
98
|
-
// imagined provider client they don't need.
|
|
99
|
-
const guideBlock = concise
|
|
100
|
-
? ""
|
|
101
|
-
: h.suggestedProvider
|
|
102
|
-
? renderAndroidByokExample(h)
|
|
103
|
-
: ` // TODO: implement the "${h.name}" handler. Return AppCallbackResult.Success(value) or .Error(code, message).\n`;
|
|
104
|
-
return (`private suspend fun ${fn}(call: AppCall): AppCallbackResult {\n` +
|
|
105
|
-
inputShape +
|
|
106
|
-
` // USER-CODE-START:${h.name}\n` +
|
|
107
|
-
guideBlock +
|
|
108
|
-
` return AppCallbackResult.Error(code = "not_implemented", message = "TODO: implement ${h.name} handler")\n` +
|
|
109
|
-
` // USER-CODE-END:${h.name}\n` +
|
|
110
|
-
`}`);
|
|
111
|
-
})
|
|
112
|
-
.join("\n\n");
|
|
113
|
-
return (`// EXTENTOS-GENERATED — do not edit the dispatch structure. Regenerate via MCP tools.\n` +
|
|
114
|
-
`package ${appPackage}.extentos\n\n` +
|
|
115
|
-
`// USER-CODE-START:imports\n` +
|
|
116
|
-
`// Auto-imports from your IDE land HERE — anything OUTSIDE this block is\n` +
|
|
117
|
-
`// regenerated and your edits will be lost. Add any extra imports inside this\n` +
|
|
118
|
-
`// block; the core library imports below are pre-populated for you.\n` +
|
|
119
|
-
`import com.extentos.glasses.core.AppCall\n` +
|
|
120
|
-
`import com.extentos.glasses.core.AppCallbackHandler\n` +
|
|
121
|
-
`import com.extentos.glasses.core.AppCallbackResult\n` +
|
|
122
|
-
`// USER-CODE-END:imports\n\n` +
|
|
123
|
-
`val extentosCallbackHandler = AppCallbackHandler { call ->\n` +
|
|
124
|
-
` // EXTENTOS-GENERATED-START:dispatch\n` +
|
|
125
|
-
` when (call.handler) {\n` +
|
|
126
|
-
`${dispatchArms}\n` +
|
|
127
|
-
` else -> AppCallbackResult.Error(\n` +
|
|
128
|
-
` code = "unknown_handler",\n` +
|
|
129
|
-
` message = "No handler for '\${call.handler}'"\n` +
|
|
130
|
-
` )\n` +
|
|
131
|
-
` }\n` +
|
|
132
|
-
` // EXTENTOS-GENERATED-END:dispatch\n` +
|
|
133
|
-
`}\n` +
|
|
134
|
-
(handlerFns ? `\n${handlerFns}\n` : ""));
|
|
135
|
-
}
|
|
136
|
-
export function renderIosCallbacksRich(handlers, concise) {
|
|
137
|
-
const dispatchArms = handlers.length
|
|
138
|
-
? handlers
|
|
139
|
-
.map((h) => ` case "${h.name}":\n return await handle${toPascalCase(h.name)}(call)`)
|
|
140
|
-
.join("\n")
|
|
141
|
-
: ` // (no handlers declared in the spec — add via updateSpec)`;
|
|
142
|
-
const handlerFns = handlers
|
|
143
|
-
.map((h) => {
|
|
144
|
-
const fn = `handle${toPascalCase(h.name)}`;
|
|
145
|
-
const inputShape = h.inputKeys && h.inputKeys.length
|
|
146
|
-
? ` // call.input: { ${h.inputKeys.map((k) => `"${k}": "<string>"`).join(", ")} }\n`
|
|
147
|
-
: "";
|
|
148
|
-
const guideBlock = concise
|
|
149
|
-
? ""
|
|
150
|
-
: h.suggestedProvider
|
|
151
|
-
? renderIosByokExample(h)
|
|
152
|
-
: ` // TODO: implement the "${h.name}" handler. Return .success(value:) or .error(code:, message:).\n`;
|
|
153
|
-
return (`private func ${fn}(_ call: AppCall) async -> AppCallbackResult {\n` +
|
|
154
|
-
inputShape +
|
|
155
|
-
` // USER-CODE-START:${h.name}\n` +
|
|
156
|
-
guideBlock +
|
|
157
|
-
` return .error(code: "not_implemented", message: "TODO: implement ${h.name} handler")\n` +
|
|
158
|
-
` // USER-CODE-END:${h.name}\n` +
|
|
159
|
-
`}`);
|
|
160
|
-
})
|
|
161
|
-
.join("\n\n");
|
|
162
|
-
return (`// EXTENTOS-GENERATED — do not edit the dispatch structure. Regenerate via MCP tools.\n` +
|
|
163
|
-
`// USER-CODE-START:imports\n` +
|
|
164
|
-
`// Auto-imports from your IDE land HERE — anything OUTSIDE this block is\n` +
|
|
165
|
-
`// regenerated and your edits will be lost. Add any extra imports inside this\n` +
|
|
166
|
-
`// block; the core library imports below are pre-populated for you.\n` +
|
|
167
|
-
`import Foundation\n` +
|
|
168
|
-
`import GlassesCore\n` +
|
|
169
|
-
`// USER-CODE-END:imports\n\n` +
|
|
170
|
-
`final class ExtentosCallbacks: AppCallbackHandler {\n` +
|
|
171
|
-
` func handle(_ call: AppCall) async -> AppCallbackResult {\n` +
|
|
172
|
-
` // EXTENTOS-GENERATED-START:dispatch\n` +
|
|
173
|
-
` switch call.handler {\n` +
|
|
174
|
-
`${dispatchArms}\n` +
|
|
175
|
-
` default:\n` +
|
|
176
|
-
` return .error(code: "unknown_handler", message: "No handler for '\\(call.handler)'")\n` +
|
|
177
|
-
` }\n` +
|
|
178
|
-
` // EXTENTOS-GENERATED-END:dispatch\n` +
|
|
179
|
-
` }\n` +
|
|
180
|
-
(handlerFns ? `\n${handlerFns.replace(/^/gm, " ")}\n` : "") +
|
|
181
|
-
`}\n`);
|
|
182
|
-
}
|
|
183
|
-
// `service` defaults to a neutral valid identifier so the rendered example
|
|
184
|
-
// always lexes as Kotlin/Swift code. The previous default ("your service")
|
|
185
|
-
// emitted `client.your service(call.input)` — looks like an unsubstituted
|
|
186
|
-
// template fragment.
|
|
187
|
-
function renderAndroidByokExample(h) {
|
|
188
|
-
const provider = h.suggestedProvider ?? "your AI provider";
|
|
189
|
-
const service = h.service ?? "send";
|
|
190
|
-
const keyName = h.suggestedProvider
|
|
191
|
-
? `${h.suggestedProvider.toUpperCase()}_API_KEY`
|
|
192
|
-
: "MY_API_KEY";
|
|
193
|
-
return (` // TODO: wire your ${provider} client here (you supply the API key).\n` +
|
|
194
|
-
` // val client = YourClient(apiKey = BuildConfig.${keyName})\n` +
|
|
195
|
-
` // val result = client.${service.replace(/\//g, ".")}(call.input)\n` +
|
|
196
|
-
` // return AppCallbackResult.Success(yourResult) // shape per your call.input → output mapping\n`);
|
|
197
|
-
}
|
|
198
|
-
function renderIosByokExample(h) {
|
|
199
|
-
const provider = h.suggestedProvider ?? "your AI provider";
|
|
200
|
-
const service = h.service ?? "send";
|
|
201
|
-
return (` // TODO: wire your ${provider} client here (you supply the API key).\n` +
|
|
202
|
-
` // let client = YourClient(apiKey: Self.apiKey)\n` +
|
|
203
|
-
` // let result = try await client.${service.replace(/\//g, ".")}(call.input)\n` +
|
|
204
|
-
` // return .success(value: .object(["result": .string(result)]))\n`);
|
|
205
|
-
}
|
|
206
|
-
function toPascalCase(s) {
|
|
207
|
-
if (!s)
|
|
208
|
-
return s;
|
|
209
|
-
return s
|
|
210
|
-
.split(/[^a-zA-Z0-9]+/)
|
|
211
|
-
.filter((x) => x.length > 0)
|
|
212
|
-
.map((x) => x.charAt(0).toUpperCase() + x.slice(1))
|
|
213
|
-
.join("");
|
|
214
|
-
}
|
|
215
|
-
//# sourceMappingURL=callbackHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"callbackH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,CACzG,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,CAAc;IAC1C,MAAM,QAAQ,GAAG,CAAC,CAAC,iBAAiB,IAAI,kBAAkB,CAAC;IAC3D,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,IAAI,MAAM,CAAC;IACpC,OAAO,CACL,0BAA0B,QAAQ,0CAA0C;QAC5E,yDAAyD;QACzD,0CAA0C,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,gBAAgB;QACrF,yEAAyE,CAC1E,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,CAAS;IAC7B,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IACjB,OAAO,CAAC;SACL,KAAK,CAAC,eAAe,CAAC;SACtB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;SAC3B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAClD,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface StreamDecl {
|
|
2
|
-
id: string;
|
|
3
|
-
type: "video_frames" | "audio_chunks" | "transcription_incremental" | "outgoing_audio_stream" | "outgoing_video_stream";
|
|
4
|
-
}
|
|
5
|
-
export type StreamScope = "lifecycle" | "connection";
|
|
6
|
-
export declare function renderAndroidStreams(appPackage: string, streams: StreamDecl[], scope: StreamScope, concise: boolean): string;
|
|
7
|
-
export declare function renderIosStreams(streams: StreamDecl[], scope: StreamScope, concise: boolean): string;
|
|
8
|
-
//# sourceMappingURL=streamConsumer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"streamConsumer.d.ts","sourceRoot":"","sources":["../../../src/tools/templates/streamConsumer.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EACA,cAAc,GACd,cAAc,GACd,2BAA2B,GAC3B,uBAAuB,GACvB,uBAAuB,CAAC;CAC7B;AAED,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,YAAY,CAAC;AAErD,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,UAAU,EAAE,EACrB,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,OAAO,GACf,MAAM,CAGR;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAGpG"}
|
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
// Stream consumer templates per docs/mcp/MCP_TOOLS.md § generateStreamConsumer.
|
|
2
|
-
// Android: Flow<T> with repeatOnLifecycle(STARTED) or GlassesState.Active.scope
|
|
3
|
-
// iOS: AsyncStream<T> consumed in a Task with the appropriate QoS.
|
|
4
|
-
export function renderAndroidStreams(appPackage, streams, scope, concise) {
|
|
5
|
-
if (scope === "lifecycle")
|
|
6
|
-
return androidLifecycleTemplate(appPackage, streams, concise);
|
|
7
|
-
return androidConnectionTemplate(appPackage, streams, concise);
|
|
8
|
-
}
|
|
9
|
-
export function renderIosStreams(streams, scope, concise) {
|
|
10
|
-
if (scope === "lifecycle")
|
|
11
|
-
return iosLifecycleTemplate(streams, concise);
|
|
12
|
-
return iosConnectionTemplate(streams, concise);
|
|
13
|
-
}
|
|
14
|
-
// All public lib types live in com.extentos.glasses.core (flat — no sub-
|
|
15
|
-
// packages despite earlier template versions claiming `audio.Transcript` /
|
|
16
|
-
// `camera.VideoFrame`).
|
|
17
|
-
//
|
|
18
|
-
// Two accessor shapes here:
|
|
19
|
-
// - Direct (audio.audioChunks(AudioChunkConfig()) / camera.videoFrames(...)):
|
|
20
|
-
// manual-lifecycle Flow, takes a typed Config object. No spec involvement.
|
|
21
|
-
// - Spec-driven (streams.transcriptionIncremental("<spec_id>")): toggle-gated
|
|
22
|
-
// Flow whose config comes from spec.streams[id] and whose lifecycle is
|
|
23
|
-
// governed by the catalog-declared toggle (transcription_enabled). F-R5-10
|
|
24
|
-
// fix — delivers on the docs' "Gated by toggle" promise. Today only
|
|
25
|
-
// transcription_incremental has a documented toggle gate; if/when
|
|
26
|
-
// audio_chunks (audio_capture_enabled) and video_frames
|
|
27
|
-
// (camera_streaming_enabled) gain spec-driven toggle gating, switch their
|
|
28
|
-
// codegen to `glasses.streams.<accessor>(<id>)` here.
|
|
29
|
-
const ANDROID_TYPES_BY_STREAM = {
|
|
30
|
-
video_frames: ["VideoFrame", "VideoFrameConfig"],
|
|
31
|
-
audio_chunks: ["AudioChunk", "AudioChunkConfig"],
|
|
32
|
-
// transcription_incremental uses glasses.streams.transcriptionIncremental(id)
|
|
33
|
-
// — config (TranscriptionConfig) is read from the spec, not constructed
|
|
34
|
-
// by the consumer, so we don't import TranscriptionConfig here. We only
|
|
35
|
-
// need the Transcript sealed type for the per-item handler.
|
|
36
|
-
transcription_incremental: ["Transcript"],
|
|
37
|
-
// outgoing_audio_stream / outgoing_video_stream: lib has no accessor (DAT
|
|
38
|
-
// limitation); we emit a TODO instead of broken imports.
|
|
39
|
-
outgoing_audio_stream: [],
|
|
40
|
-
outgoing_video_stream: [],
|
|
41
|
-
};
|
|
42
|
-
function androidLifecycleTemplate(appPackage, streams, concise) {
|
|
43
|
-
const types = collectAndroidTypes(streams);
|
|
44
|
-
const header = `// EXTENTOS-GENERATED — stream consumer boilerplate. Regenerate via MCP tools.\n` +
|
|
45
|
-
`package ${appPackage}.extentos\n\n` +
|
|
46
|
-
`// USER-CODE-START:imports\n` +
|
|
47
|
-
`// Auto-imports from your IDE land HERE — anything OUTSIDE this block is\n` +
|
|
48
|
-
`// regenerated and your edits will be lost. The core library imports below\n` +
|
|
49
|
-
`// are pre-populated; add any extras inside this block.\n` +
|
|
50
|
-
`import androidx.lifecycle.Lifecycle\n` +
|
|
51
|
-
`import androidx.lifecycle.LifecycleOwner\n` +
|
|
52
|
-
`import androidx.lifecycle.lifecycleScope\n` +
|
|
53
|
-
`import androidx.lifecycle.repeatOnLifecycle\n` +
|
|
54
|
-
`import com.extentos.glasses.core.ExtentosGlasses\n` +
|
|
55
|
-
types.map((t) => `import com.extentos.glasses.core.${t}\n`).join("") +
|
|
56
|
-
`import kotlinx.coroutines.flow.catch\n` +
|
|
57
|
-
`import kotlinx.coroutines.launch\n` +
|
|
58
|
-
`// USER-CODE-END:imports\n\n`;
|
|
59
|
-
const prose = concise
|
|
60
|
-
? ""
|
|
61
|
-
: `/**\n * Call from onCreate() or a LaunchedEffect after glasses are connected.\n * Collection stops when the lifecycle drops below STARTED (screen off, backgrounded)\n * and resumes automatically when STARTED again.\n */\n`;
|
|
62
|
-
const body = streams.map((s) => androidStreamBlock(s, "lifecycle", concise)).join("\n");
|
|
63
|
-
return (header +
|
|
64
|
-
prose +
|
|
65
|
-
`fun LifecycleOwner.collectExtentosStreams(glasses: ExtentosGlasses) {\n` +
|
|
66
|
-
body +
|
|
67
|
-
`}\n`);
|
|
68
|
-
}
|
|
69
|
-
function androidConnectionTemplate(appPackage, streams, concise) {
|
|
70
|
-
const types = collectAndroidTypes(streams);
|
|
71
|
-
const header = `// EXTENTOS-GENERATED — stream consumer boilerplate (connection-scoped). Regenerate via MCP tools.\n` +
|
|
72
|
-
`package ${appPackage}.extentos\n\n` +
|
|
73
|
-
`// USER-CODE-START:imports\n` +
|
|
74
|
-
`// Auto-imports from your IDE land HERE — anything OUTSIDE this block is\n` +
|
|
75
|
-
`// regenerated and your edits will be lost. The core library imports below\n` +
|
|
76
|
-
`// are pre-populated; add any extras inside this block.\n` +
|
|
77
|
-
`import com.extentos.glasses.core.ExtentosGlasses\n` +
|
|
78
|
-
`import com.extentos.glasses.core.GlassesState\n` +
|
|
79
|
-
types.map((t) => `import com.extentos.glasses.core.${t}\n`).join("") +
|
|
80
|
-
`import kotlinx.coroutines.flow.catch\n` +
|
|
81
|
-
`import kotlinx.coroutines.launch\n` +
|
|
82
|
-
`// USER-CODE-END:imports\n\n`;
|
|
83
|
-
const prose = concise
|
|
84
|
-
? ""
|
|
85
|
-
: `// These collectors live as long as the glasses are connected. They survive\n// Activity recreation but stop on disconnect — the per-connection scope\n// cancels all children automatically when glasses disconnect.\n\n`;
|
|
86
|
-
const body = streams.map((s) => androidStreamBlock(s, "connection", concise)).join("\n");
|
|
87
|
-
return (header +
|
|
88
|
-
prose +
|
|
89
|
-
`suspend fun collectExtentosStreams(glasses: ExtentosGlasses) {\n` +
|
|
90
|
-
` glasses.connection.state.collect { state ->\n` +
|
|
91
|
-
` if (state is GlassesState.Active) {\n` +
|
|
92
|
-
body +
|
|
93
|
-
` }\n` +
|
|
94
|
-
` }\n` +
|
|
95
|
-
`}\n`);
|
|
96
|
-
}
|
|
97
|
-
function collectAndroidTypes(streams) {
|
|
98
|
-
const set = new Set();
|
|
99
|
-
for (const s of streams) {
|
|
100
|
-
for (const t of ANDROID_TYPES_BY_STREAM[s.type])
|
|
101
|
-
set.add(t);
|
|
102
|
-
}
|
|
103
|
-
// Stable order so regenerations are idempotent.
|
|
104
|
-
return [...set].sort();
|
|
105
|
-
}
|
|
106
|
-
function androidStreamBlock(s, scope, concise) {
|
|
107
|
-
const meta = androidStreamMeta(s);
|
|
108
|
-
// Outgoing streams have no lib accessor today (DAT limitation). Emit an
|
|
109
|
-
// explicit TODO block instead of code that references a non-existent
|
|
110
|
-
// method. Keeps the marker so future regen merges cleanly.
|
|
111
|
-
if (meta.unsupported) {
|
|
112
|
-
const indent = scope === "lifecycle" ? " " : " ";
|
|
113
|
-
return (`${indent}// ── ${s.type}: "${s.id}" ──\n` +
|
|
114
|
-
`${indent}// USER-CODE-START:${s.id}\n` +
|
|
115
|
-
`${indent}// TODO: ${meta.unsupported} The spec accepts this stream type, but\n` +
|
|
116
|
-
`${indent}// no consumer accessor exists yet. Watch the lib's release notes for the\n` +
|
|
117
|
-
`${indent}// outgoing-direction API.\n` +
|
|
118
|
-
`${indent}// USER-CODE-END:${s.id}\n`);
|
|
119
|
-
}
|
|
120
|
-
const launchPrefix = scope === "lifecycle"
|
|
121
|
-
? ` lifecycleScope.launch {\n repeatOnLifecycle(Lifecycle.State.STARTED) {\n `
|
|
122
|
-
: ` state.scope.launch {\n `;
|
|
123
|
-
const launchSuffix = scope === "lifecycle" ? `\n }\n }` : `\n }`;
|
|
124
|
-
const indentBase = scope === "lifecycle" ? " " : " ";
|
|
125
|
-
const comment = concise
|
|
126
|
-
? ""
|
|
127
|
-
: ` // ── ${s.type}: "${s.id}" ──\n` +
|
|
128
|
-
` // Flow<${meta.kotlinType}> — ${meta.backpressure}\n`;
|
|
129
|
-
const inner = `glasses.${meta.kotlinAccessor}(${meta.configCtor})\n` +
|
|
130
|
-
`${indentBase}.catch { _ -> /* TODO: handle stream error — log, show UI, retry */ }\n` +
|
|
131
|
-
`${indentBase}.collect { item: ${meta.kotlinType} ->\n` +
|
|
132
|
-
`${indentBase} // USER-CODE-START:${s.id}\n` +
|
|
133
|
-
(concise
|
|
134
|
-
? ""
|
|
135
|
-
: `${indentBase} // ${meta.shapeComment}\n${indentBase} //\n${indentBase} // ${meta.exampleComment}\n`) +
|
|
136
|
-
`${indentBase} // TODO: process ${s.type} "${s.id}"\n` +
|
|
137
|
-
`${indentBase} // USER-CODE-END:${s.id}\n` +
|
|
138
|
-
`${indentBase}}`;
|
|
139
|
-
return comment + launchPrefix + inner + launchSuffix + "\n";
|
|
140
|
-
}
|
|
141
|
-
function androidStreamMeta(s) {
|
|
142
|
-
switch (s.type) {
|
|
143
|
-
case "video_frames":
|
|
144
|
-
return {
|
|
145
|
-
kotlinAccessor: "camera.videoFrames",
|
|
146
|
-
kotlinType: "VideoFrame",
|
|
147
|
-
// Direct ungated API. config is constructed by the consumer.
|
|
148
|
-
configCtor: "VideoFrameConfig()",
|
|
149
|
-
backpressure: "DropOldest backpressure (skips stale frames)",
|
|
150
|
-
shapeComment: "item.data: ByteArray (encoded frame), item.width, item.height, item.timestampMs",
|
|
151
|
-
exampleComment: "Example: val result = myDetector.detect(item.data, item.width, item.height)",
|
|
152
|
-
};
|
|
153
|
-
case "audio_chunks":
|
|
154
|
-
return {
|
|
155
|
-
kotlinAccessor: "audio.audioChunks",
|
|
156
|
-
kotlinType: "AudioChunk",
|
|
157
|
-
configCtor: "AudioChunkConfig()",
|
|
158
|
-
backpressure: "Suspend(16) backpressure (~320ms buffer)",
|
|
159
|
-
shapeComment: "item.data: ByteArray (PCM 16-bit LE), item.sampleRate, item.timestampMs",
|
|
160
|
-
exampleComment: "Example: val label = soundClassifier.classify(item.data, item.sampleRate)",
|
|
161
|
-
};
|
|
162
|
-
case "transcription_incremental":
|
|
163
|
-
// F-R5-10: spec-driven, toggle-gated path. The library reads the
|
|
164
|
-
// stream's config from the loaded spec and observes the
|
|
165
|
-
// `transcription_enabled` toggle; flipping it true starts the
|
|
166
|
-
// recognizer, flipping it false cancels the active recognizer
|
|
167
|
-
// immediately (transport sees stream_stop, SCO mic released).
|
|
168
|
-
// Wire the toggle from a spec trigger:
|
|
169
|
-
// { type: "set_toggle", key: "transcription_enabled", value: true }
|
|
170
|
-
return {
|
|
171
|
-
kotlinAccessor: "streams.transcriptionIncremental",
|
|
172
|
-
kotlinType: "Transcript",
|
|
173
|
-
configCtor: `"${s.id}"`,
|
|
174
|
-
backpressure: "sealed: Transcript.Partial | Transcript.Final (toggle-gated by transcription_enabled)",
|
|
175
|
-
shapeComment: "when (item) { is Transcript.Partial -> …; is Transcript.Final -> … }",
|
|
176
|
-
exampleComment: "Example: if (item is Transcript.Final) updateCaptionView(item.text)",
|
|
177
|
-
};
|
|
178
|
-
case "outgoing_audio_stream":
|
|
179
|
-
return {
|
|
180
|
-
kotlinAccessor: "",
|
|
181
|
-
kotlinType: "",
|
|
182
|
-
configCtor: "",
|
|
183
|
-
backpressure: "",
|
|
184
|
-
shapeComment: "",
|
|
185
|
-
exampleComment: "",
|
|
186
|
-
unsupported: "outgoing_audio_stream is not exposed by the Android lib (no AudioClient.outgoingAudio accessor).",
|
|
187
|
-
};
|
|
188
|
-
case "outgoing_video_stream":
|
|
189
|
-
return {
|
|
190
|
-
kotlinAccessor: "",
|
|
191
|
-
kotlinType: "",
|
|
192
|
-
configCtor: "",
|
|
193
|
-
backpressure: "",
|
|
194
|
-
shapeComment: "",
|
|
195
|
-
exampleComment: "",
|
|
196
|
-
unsupported: "outgoing_video_stream is not exposed by the Android lib (no CameraClient.outgoingVideo accessor).",
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
function iosLifecycleTemplate(streams, concise) {
|
|
201
|
-
const header = `// EXTENTOS-GENERATED — stream consumer boilerplate. Regenerate via MCP tools.\n` +
|
|
202
|
-
`// USER-CODE-START:imports\n` +
|
|
203
|
-
`// Auto-imports from your IDE land HERE — anything OUTSIDE this block is\n` +
|
|
204
|
-
`// regenerated and your edits will be lost. The core library imports below\n` +
|
|
205
|
-
`// are pre-populated; add any extras inside this block.\n` +
|
|
206
|
-
`import Foundation\n` +
|
|
207
|
-
`import GlassesCore\n` +
|
|
208
|
-
`// USER-CODE-END:imports\n\n`;
|
|
209
|
-
const prose = concise
|
|
210
|
-
? ""
|
|
211
|
-
: `/// Call from your View's .task { ... } after glasses are connected.\n/// The Tasks are cancelled automatically when the parent task is cancelled.\n`;
|
|
212
|
-
const body = streams.map((s) => iosStreamBlock(s, "lifecycle", concise)).join("\n");
|
|
213
|
-
return (header +
|
|
214
|
-
prose +
|
|
215
|
-
`@MainActor\n` +
|
|
216
|
-
`func collectExtentosStreams(glasses: ExtentosGlasses) async {\n` +
|
|
217
|
-
body +
|
|
218
|
-
`}\n`);
|
|
219
|
-
}
|
|
220
|
-
function iosConnectionTemplate(streams, concise) {
|
|
221
|
-
const header = `// EXTENTOS-GENERATED — stream consumer boilerplate (connection-scoped). Regenerate via MCP tools.\n` +
|
|
222
|
-
`// USER-CODE-START:imports\n` +
|
|
223
|
-
`// Auto-imports from your IDE land HERE — anything OUTSIDE this block is\n` +
|
|
224
|
-
`// regenerated and your edits will be lost. The core library imports below\n` +
|
|
225
|
-
`// are pre-populated; add any extras inside this block.\n` +
|
|
226
|
-
`import Foundation\n` +
|
|
227
|
-
`import GlassesCore\n` +
|
|
228
|
-
`// USER-CODE-END:imports\n\n`;
|
|
229
|
-
const prose = concise
|
|
230
|
-
? ""
|
|
231
|
-
: `/// Observes ExtentosGlasses state and launches per-connection Tasks that are\n/// cancelled automatically when the glasses disconnect.\n`;
|
|
232
|
-
const body = streams.map((s) => iosStreamBlock(s, "connection", concise)).join("\n");
|
|
233
|
-
return (header +
|
|
234
|
-
prose +
|
|
235
|
-
`func collectExtentosStreams(glasses: ExtentosGlasses) async {\n` +
|
|
236
|
-
` for await state in glasses.connection.state.values {\n` +
|
|
237
|
-
` guard case .active(let activeState) = state else { continue }\n` +
|
|
238
|
-
body +
|
|
239
|
-
` }\n` +
|
|
240
|
-
`}\n`);
|
|
241
|
-
}
|
|
242
|
-
function iosStreamBlock(s, scope, concise) {
|
|
243
|
-
const { swiftAccessor, swiftType, qos, shapeComment, exampleComment, backpressure } = iosStreamMeta(s.type);
|
|
244
|
-
const indent = scope === "lifecycle" ? " " : " ";
|
|
245
|
-
const taskOpener = scope === "lifecycle"
|
|
246
|
-
? `${indent}Task(priority: .${qos}) {\n`
|
|
247
|
-
: `${indent}activeState.addTask(priority: .${qos}) {\n`;
|
|
248
|
-
const comment = concise
|
|
249
|
-
? ""
|
|
250
|
-
: `${indent}// ── ${s.type}: "${s.id}" ──\n` +
|
|
251
|
-
`${indent}// AsyncStream<${swiftType}> — ${backpressure}\n` +
|
|
252
|
-
`${indent}// QoS: ${qos}\n`;
|
|
253
|
-
const body = taskOpener +
|
|
254
|
-
`${indent} do {\n` +
|
|
255
|
-
`${indent} for try await item in glasses.${swiftAccessor}("${s.id}") {\n` +
|
|
256
|
-
`${indent} // USER-CODE-START:${s.id}\n` +
|
|
257
|
-
(concise
|
|
258
|
-
? ""
|
|
259
|
-
: `${indent} // ${shapeComment}\n${indent} //\n${indent} // ${exampleComment}\n`) +
|
|
260
|
-
`${indent} // TODO: process ${s.type} "${s.id}"\n` +
|
|
261
|
-
`${indent} _ = item\n` +
|
|
262
|
-
`${indent} // USER-CODE-END:${s.id}\n` +
|
|
263
|
-
`${indent} }\n` +
|
|
264
|
-
`${indent} } catch {\n` +
|
|
265
|
-
`${indent} // TODO: handle stream error — log, show UI, retry\n` +
|
|
266
|
-
`${indent} }\n` +
|
|
267
|
-
`${indent}}\n`;
|
|
268
|
-
return comment + body;
|
|
269
|
-
}
|
|
270
|
-
function iosStreamMeta(type) {
|
|
271
|
-
switch (type) {
|
|
272
|
-
case "video_frames":
|
|
273
|
-
return {
|
|
274
|
-
swiftAccessor: "camera.videoFrames",
|
|
275
|
-
swiftType: "VideoFrame",
|
|
276
|
-
qos: "userInitiated",
|
|
277
|
-
backpressure: "DropOldest (skips stale frames)",
|
|
278
|
-
shapeComment: "item.buffer: CMSampleBuffer, item.width, item.height, item.presentationTime",
|
|
279
|
-
exampleComment: "Example: let result = myDetector.detect(item.buffer)",
|
|
280
|
-
};
|
|
281
|
-
case "audio_chunks":
|
|
282
|
-
return {
|
|
283
|
-
swiftAccessor: "audio.audioChunks",
|
|
284
|
-
swiftType: "AudioChunk",
|
|
285
|
-
qos: "userInitiated",
|
|
286
|
-
backpressure: "Suspend(16) backpressure (~320ms buffer)",
|
|
287
|
-
shapeComment: "item.samples: Data (PCM 16-bit), item.sampleRate, item.timestampMs",
|
|
288
|
-
exampleComment: "Example: let label = soundClassifier.classify(item.samples, item.sampleRate)",
|
|
289
|
-
};
|
|
290
|
-
case "transcription_incremental":
|
|
291
|
-
// F-R5-10: spec-driven, toggle-gated path on iOS. Mirrors Android's
|
|
292
|
-
// glasses.streams.transcriptionIncremental(id). The library observes
|
|
293
|
-
// transcription_enabled and switches the recognizer on/off.
|
|
294
|
-
return {
|
|
295
|
-
swiftAccessor: "streams.transcriptionIncremental",
|
|
296
|
-
swiftType: "Transcript",
|
|
297
|
-
qos: "userInteractive",
|
|
298
|
-
backpressure: "enum: .partial | .final (toggle-gated by transcription_enabled)",
|
|
299
|
-
shapeComment: "switch item { case .partial(let t): …; case .final(let t): … }",
|
|
300
|
-
exampleComment: "Example: await updateCaptionView(item)",
|
|
301
|
-
};
|
|
302
|
-
case "outgoing_audio_stream":
|
|
303
|
-
return {
|
|
304
|
-
swiftAccessor: "audio.outgoingAudio",
|
|
305
|
-
swiftType: "AudioChunk",
|
|
306
|
-
qos: "utility",
|
|
307
|
-
backpressure: "Suspend(16) backpressure",
|
|
308
|
-
shapeComment: "item.samples (Opus or PCM per codec), item.sampleRate, item.timestampMs",
|
|
309
|
-
exampleComment: "Example: peerConnection.sendAudioFrame(item.samples, item.timestampMs)",
|
|
310
|
-
};
|
|
311
|
-
case "outgoing_video_stream":
|
|
312
|
-
return {
|
|
313
|
-
swiftAccessor: "camera.outgoingVideo",
|
|
314
|
-
swiftType: "VideoFrame",
|
|
315
|
-
qos: "utility",
|
|
316
|
-
backpressure: "DropOldest backpressure",
|
|
317
|
-
shapeComment: "item.buffer: CMSampleBuffer (HEVC compressed — pass-through)",
|
|
318
|
-
exampleComment: "Example: peerConnection.sendVideoFrame(item.buffer, item.presentationTime)",
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
//# sourceMappingURL=streamConsumer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"streamConsumer.js","sourceRoot":"","sources":["../../../src/tools/templates/streamConsumer.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gFAAgF;AAChF,mEAAmE;AAcnE,MAAM,UAAU,oBAAoB,CAClC,UAAkB,EAClB,OAAqB,EACrB,KAAkB,EAClB,OAAgB;IAEhB,IAAI,KAAK,KAAK,WAAW;QAAE,OAAO,wBAAwB,CAAC,U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